diff --git a/build.gradle.kts b/build.gradle.kts index b8b86a1570559..3989a1972f155 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -28,6 +28,7 @@ plugins { `java-base` gradlebuild.`build-types` gradlebuild.`ci-reporting` + gradlebuild.security // TODO Apply this plugin in the BuildScanConfigurationPlugin once binary plugins can apply plugins via the new plugin DSL // We have to apply it here at the moment, so that when the build scan plugin is auto-applied via --scan can detect that // the plugin has been already applied. For that the plugin has to be applied with the new plugin DSL syntax. diff --git a/buildSrc/subprojects/plugins/src/main/kotlin/gradlebuild/security.gradle.kts b/buildSrc/subprojects/plugins/src/main/kotlin/gradlebuild/security.gradle.kts new file mode 100644 index 0000000000000..45f653cafcfea --- /dev/null +++ b/buildSrc/subprojects/plugins/src/main/kotlin/gradlebuild/security.gradle.kts @@ -0,0 +1,95 @@ +/* + * Copyright 2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package gradlebuild + +import java.net.URI +import java.util.concurrent.locks.ReentrantLock +import kotlin.concurrent.withLock + +val lock = ReentrantLock() +val allowedSchemes = setOf("https") +val alreadyChecked = mutableSetOf() +val insecureRepos = mutableSetOf() +val repoToSource = mutableMapOf() + +allprojects { + repositories.whenObjectAdded { + Exception().stackTrace.forEachIndexed { idx, it -> + if (idx > 1 && !repoToSource.containsKey(this) && it.isBuildScript()) { + repoToSource.put(this, "${it.fileName}:${it.lineNumber} in ${it.className}") + } + } + } + val project = this + configurations.all { + incoming.beforeResolve { + repositories.checkRepositories(project) + } + } + afterEvaluate { + extensions.findByType(PublishingExtension::class.java)?.run { + repositories.checkRepositories(project) + } + } +} + +gradle.buildFinished { + if (!insecureRepos.isEmpty()) { + val byProject = insecureRepos + .groupBy(InsecureRepository::projectPath) + .mapKeys { + "In project '${it.key}' :" + }.mapValues { + it.value.map { repo -> + val location = if (repo.location != null) { + "declared at ${repo.location}" + } else { + "(unknown location)" + } + " - Repository ${repo.repositoryName} : ${repo.url} $location" + }.joinToString("\n") + } + val detail = byProject.map { + val (key, value) = it + " * $key\n$value" + }.joinToString("\n") + + throw GradleException("This build used insecure repositories:\n${detail}\n\nMake sure to use HTTPS") + } +} + +fun RepositoryHandler.checkRepositories(project: Project) = forEach { + lock.withLock { + if (alreadyChecked.add(it)) { + if (it is MavenArtifactRepository) { + checkURLs(project, it, setOf(it.url)) + checkURLs(project, it, it.artifactUrls) + } else if (it is IvyArtifactRepository) { + checkURLs(project, it, setOf(it.url)) + } + } + } +} + +fun checkURLs(project: Project, repository: ArtifactRepository, uris: Collection) = uris.forEach { + if (it.scheme.toLowerCase() !in allowedSchemes) { + insecureRepos.add(InsecureRepository(project.path, repository.name, it, repoToSource.get(repository))) + } +} + +data class InsecureRepository(val projectPath: String, val repositoryName: String, val url: URI, val location: String?) + +fun StackTraceElement.isBuildScript() = fileName != null && (fileName.endsWith(".gradle") || fileName.endsWith(".gradle.kts")) diff --git a/subprojects/base-services/src/main/java/org/gradle/api/file/RelativePath.java b/subprojects/base-services/src/main/java/org/gradle/api/file/RelativePath.java index 7620631f854f9..120c70062f166 100644 --- a/subprojects/base-services/src/main/java/org/gradle/api/file/RelativePath.java +++ b/subprojects/base-services/src/main/java/org/gradle/api/file/RelativePath.java @@ -142,7 +142,6 @@ public File getFile(File baseDir) { return new File(baseDir, getPathString()); } - @Nullable public String getLastName() { if (segments.length > 0) { return segments[segments.length - 1]; @@ -185,7 +184,6 @@ public String toString() { * * @return The parent of this path, or null if this is the root path. */ - @Nullable public RelativePath getParent() { switch (segments.length) { case 0: diff --git a/subprojects/core/src/integTest/groovy/org/gradle/api/tasks/IncrementalInputsIntegrationTest.groovy b/subprojects/core/src/integTest/groovy/org/gradle/api/tasks/IncrementalInputsIntegrationTest.groovy index 4308da7e8dc3c..15b694f4e06fa 100644 --- a/subprojects/core/src/integTest/groovy/org/gradle/api/tasks/IncrementalInputsIntegrationTest.groovy +++ b/subprojects/core/src/integTest/groovy/org/gradle/api/tasks/IncrementalInputsIntegrationTest.groovy @@ -196,13 +196,20 @@ class IncrementalInputsIntegrationTest extends AbstractIncrementalTasksIntegrati buildFile << """ class MyTask extends DefaultTask { + File inputOne + File inputTwo + @Incremental @InputDirectory - File inputOne + File getInputOne() { + inputOne + } @Incremental @InputDirectory - File inputTwo + File getInputTwo() { + inputTwo + } @OutputDirectory File outputDirectory diff --git a/subprojects/core/src/main/java/org/gradle/api/internal/tasks/TaskPropertyUtils.java b/subprojects/core/src/main/java/org/gradle/api/internal/tasks/TaskPropertyUtils.java index b5f141403b416..e2162e5eec391 100644 --- a/subprojects/core/src/main/java/org/gradle/api/internal/tasks/TaskPropertyUtils.java +++ b/subprojects/core/src/main/java/org/gradle/api/internal/tasks/TaskPropertyUtils.java @@ -28,6 +28,7 @@ import javax.annotation.Nullable; import java.util.ArrayList; +import java.util.Collections; import java.util.List; @NonNullApi @@ -84,6 +85,7 @@ void assertNoProblems() { if (problems.size() == 1) { message = String.format("A problem was found with the configuration of %s.", task); } else { + Collections.sort(problems); message = String.format("Some problems were found with the configuration of %s.", task); } throw new TaskValidationException(message, CollectionUtils.collect(problems, new Transformer() { @@ -111,5 +113,10 @@ public void visitErrorStrict(String message) { } problems.add(message); } + + @Override + public void visitErrorStrict(@Nullable String ownerPath, String propertyName, String message) { + visitErrorStrict(message); + } } } diff --git a/subprojects/core/src/main/java/org/gradle/api/internal/tasks/execution/ValidatingTaskExecuter.java b/subprojects/core/src/main/java/org/gradle/api/internal/tasks/execution/ValidatingTaskExecuter.java index ec6d3d013de39..a82642472bcb0 100644 --- a/subprojects/core/src/main/java/org/gradle/api/internal/tasks/execution/ValidatingTaskExecuter.java +++ b/subprojects/core/src/main/java/org/gradle/api/internal/tasks/execution/ValidatingTaskExecuter.java @@ -30,6 +30,7 @@ import org.gradle.api.tasks.TaskValidationException; import org.gradle.internal.file.ReservedFileSystemLocationRegistry; +import java.util.Collections; import java.util.List; /** @@ -62,6 +63,7 @@ public TaskExecuterResult execute(TaskInternal task, TaskStateInternal state, Ta } private static void report(Task task, List messages, TaskStateInternal state) { + Collections.sort(messages); List causes = Lists.newArrayListWithCapacity(messages.size()); for (String message : messages) { causes.add(new InvalidUserDataException(message)); diff --git a/subprojects/core/src/main/java/org/gradle/api/internal/tasks/properties/DefaultParameterValidationContext.java b/subprojects/core/src/main/java/org/gradle/api/internal/tasks/properties/DefaultParameterValidationContext.java index 7e4fba423bd16..c9904e2582d70 100644 --- a/subprojects/core/src/main/java/org/gradle/api/internal/tasks/properties/DefaultParameterValidationContext.java +++ b/subprojects/core/src/main/java/org/gradle/api/internal/tasks/properties/DefaultParameterValidationContext.java @@ -28,13 +28,19 @@ public DefaultParameterValidationContext(Collection messages) { this.messages = messages; } - @Override - public void visitError(@Nullable String ownerPath, String propertyName, String message) { + private static String decorateMessage(@Nullable String ownerPath, String propertyName, String message) { + String decoratedMessage; if (ownerPath == null) { - visitError("Property '" + propertyName + "' " + message + "."); + decoratedMessage = "Property '" + propertyName + "' " + message + "."; } else { - visitError("Property '" + ownerPath + '.' + propertyName + "' " + message + "."); + decoratedMessage = "Property '" + ownerPath + '.' + propertyName + "' " + message + "."; } + return decoratedMessage; + } + + @Override + public void visitError(@Nullable String ownerPath, String propertyName, String message) { + visitError(decorateMessage(ownerPath, propertyName, message)); } @Override @@ -42,6 +48,11 @@ public void visitError(String message) { messages.add(message); } + @Override + public void visitErrorStrict(@Nullable String ownerPath, String propertyName, String message) { + visitErrorStrict(decorateMessage(ownerPath, propertyName, message)); + } + @Override public void visitErrorStrict(String message) { visitError(message); diff --git a/subprojects/core/src/main/java/org/gradle/api/internal/tasks/properties/DefaultTypeMetadataStore.java b/subprojects/core/src/main/java/org/gradle/api/internal/tasks/properties/DefaultTypeMetadataStore.java index 6bee320a7e368..1df6a17f1f9a7 100644 --- a/subprojects/core/src/main/java/org/gradle/api/internal/tasks/properties/DefaultTypeMetadataStore.java +++ b/subprojects/core/src/main/java/org/gradle/api/internal/tasks/properties/DefaultTypeMetadataStore.java @@ -17,6 +17,7 @@ package org.gradle.api.internal.tasks.properties; import com.google.common.base.Function; +import com.google.common.collect.Collections2; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; @@ -53,7 +54,6 @@ import javax.annotation.Nullable; import java.lang.annotation.Annotation; import java.util.Collection; -import java.util.Map; import java.util.Set; public class DefaultTypeMetadataStore implements TypeMetadataStore { @@ -84,12 +84,12 @@ public Class apply(PropertyAnnotationHandler handler) { }); this.typeAnnotationHandlers = typeAnnotationHandlers; Multimap, Class> annotationOverrides = collectAnnotationOverrides(annotationHandlers); - Set> relevantAnnotationTypes = collectRelevantAnnotationTypes(((Map, PropertyAnnotationHandler>) Maps.uniqueIndex(annotationHandlers, new Function>() { + Set> relevantAnnotationTypes = collectRelevantAnnotationTypes(Collections2.transform(annotationHandlers, new Function>() { @Override public Class apply(PropertyAnnotationHandler handler) { return handler.getAnnotationType(); } - })).keySet()); + })); String displayName = calculateDisplayName(annotationHandlers); this.propertyExtractor = new PropertyExtractor(displayName, this.annotationHandlers.keySet(), relevantAnnotationTypes, annotationOverrides, otherKnownAnnotations, IGNORED_SUPER_CLASSES, IGNORED_METHODS); this.cache = cacheFactory.newClassCache(); @@ -116,7 +116,7 @@ private static Multimap, Class return builder.build(); } - private static Set> collectRelevantAnnotationTypes(Set> propertyTypeAnnotations) { + private static Set> collectRelevantAnnotationTypes(Collection> propertyTypeAnnotations) { return ImmutableSet.>builder() .addAll(propertyTypeAnnotations) .add(Optional.class) @@ -178,6 +178,16 @@ public void collect(@Nullable String ownerPropertyPath, ParameterValidationConte }); } + @Override + public void visitErrorStrict(@Nullable final String ownerPath, final String propertyName, final String message) { + builder.add(new ValidationProblem() { + @Override + public void collect(@Nullable String ownerPropertyPath, ParameterValidationContext validationContext) { + validationContext.visitErrorStrict(ownerPath, propertyName, message); + } + }); + } + @Override public void visitErrorStrict(final String message) { builder.add(new ValidationProblem() { diff --git a/subprojects/core/src/main/java/org/gradle/api/internal/tasks/properties/PropertyValidationAccess.java b/subprojects/core/src/main/java/org/gradle/api/internal/tasks/properties/PropertyValidationAccess.java index de694e271bbcf..20584207be917 100644 --- a/subprojects/core/src/main/java/org/gradle/api/internal/tasks/properties/PropertyValidationAccess.java +++ b/subprojects/core/src/main/java/org/gradle/api/internal/tasks/properties/PropertyValidationAccess.java @@ -260,15 +260,19 @@ public CollectingParameterValidationContext(Class topLevelBean, ProblemCollec this.problems = problems; } - @Override - public void visitError(@Nullable String ownerPath, String propertyName, String message) { + private String decorateMessage(String propertyName, String message) { String decoratedMessage; if (Task.class.isAssignableFrom(topLevelBean)) { decoratedMessage = String.format("Task type '%s': property '%s' %s.", topLevelBean.getName(), getQualifiedPropertyName(propertyName), message); } else { decoratedMessage = String.format("Type '%s': property '%s' %s.", topLevelBean.getName(), getQualifiedPropertyName(propertyName), message); } - visitError(decoratedMessage); + return decoratedMessage; + } + + @Override + public void visitError(@Nullable String ownerPath, String propertyName, String message) { + visitError(decorateMessage(propertyName, message)); } @Override @@ -276,6 +280,11 @@ public void visitError(String message) { problems.error(message, false); } + @Override + public void visitErrorStrict(@Nullable String ownerPath, String propertyName, String message) { + visitErrorStrict(decorateMessage(propertyName, message)); + } + @Override public void visitErrorStrict(String message) { problems.error(message, true); diff --git a/subprojects/core/src/main/java/org/gradle/api/internal/tasks/properties/annotations/InputPropertyAnnotationHandler.java b/subprojects/core/src/main/java/org/gradle/api/internal/tasks/properties/annotations/InputPropertyAnnotationHandler.java index dd90a6b38558f..5d96b76441e84 100755 --- a/subprojects/core/src/main/java/org/gradle/api/internal/tasks/properties/annotations/InputPropertyAnnotationHandler.java +++ b/subprojects/core/src/main/java/org/gradle/api/internal/tasks/properties/annotations/InputPropertyAnnotationHandler.java @@ -23,6 +23,7 @@ import org.gradle.api.tasks.Optional; import org.gradle.internal.reflect.ParameterValidationContext; import org.gradle.internal.reflect.PropertyMetadata; +import org.gradle.work.Incremental; import java.io.File; import java.lang.annotation.Annotation; @@ -53,7 +54,11 @@ public void validatePropertyMetadata(PropertyMetadata propertyMetadata, Paramete if (File.class.isAssignableFrom(valueType) || java.nio.file.Path.class.isAssignableFrom(valueType) || FileCollection.class.isAssignableFrom(valueType)) { - visitor.visitError(null, propertyMetadata.getPropertyName(), "has @Input annotation used on property of type " + valueType.getName()); + visitor.visitError(null, propertyMetadata.getPropertyName(), + String.format("has @Input annotation used on property of type %s", valueType.getName())); + } + if (propertyMetadata.isAnnotationPresent(Incremental.class)) { + visitor.visitErrorStrict(null, propertyMetadata.getPropertyName(), "has @Incremental annotation used on an @Input property"); } } } diff --git a/subprojects/dependency-management/src/integTest/groovy/org/gradle/integtests/resolve/transform/ArtifactTransformValuesInjectionIntegrationTest.groovy b/subprojects/dependency-management/src/integTest/groovy/org/gradle/integtests/resolve/transform/ArtifactTransformValuesInjectionIntegrationTest.groovy index 891e92c53a5c0..bc293b1204e3d 100644 --- a/subprojects/dependency-management/src/integTest/groovy/org/gradle/integtests/resolve/transform/ArtifactTransformValuesInjectionIntegrationTest.groovy +++ b/subprojects/dependency-management/src/integTest/groovy/org/gradle/integtests/resolve/transform/ArtifactTransformValuesInjectionIntegrationTest.groovy @@ -200,6 +200,11 @@ class ArtifactTransformValuesInjectionIntegrationTest extends AbstractDependency @PathSensitive(PathSensitivity.ABSOLUTE) @InputFiles ConfigurableFileCollection getAbsolutePathSensitivity() + + @Incremental + @Input + String getIncrementalNonFileInput() + void setIncrementalNonFileInput(String value) } void transform(TransformOutputs outputs) { @@ -215,17 +220,21 @@ class ArtifactTransformValuesInjectionIntegrationTest extends AbstractDependency failure.assertThatDescription(matchesRegexp('Cannot isolate parameters MakeGreen\\$Parameters\\$Inject@.* of artifact transform MakeGreen')) failure.assertHasCause('Some problems were found with the configuration of the artifact transform parameter MakeGreen.Parameters.') assertPropertyValidationErrors( + absolutePathSensitivity: 'is declared to be sensitive to absolute paths. This is not allowed for cacheable transforms', extension: 'is not annotated with an input annotation', - outputDir: 'is annotated with unsupported annotation @OutputDirectory', - missingInput: 'does not have a value specified', fileInput: [ + 'does not have a value specified', 'has @Input annotation used on property of type java.io.File', - 'does not have a value specified' ], - absolutePathSensitivity: 'is declared to be sensitive to absolute paths. This is not allowed for cacheable transforms', + incrementalNonFileInput: [ + 'does not have a value specified', + 'has @Incremental annotation used on an @Input property', + ], + missingInput: 'does not have a value specified', noPathSensitivity: 'is declared without path sensitivity. Properties of cacheable transforms must declare their path sensitivity', noPathSensitivityDir: 'is declared without path sensitivity. Properties of cacheable transforms must declare their path sensitivity', - noPathSensitivityFile: 'is declared without path sensitivity. Properties of cacheable transforms must declare their path sensitivity' + noPathSensitivityFile: 'is declared without path sensitivity. Properties of cacheable transforms must declare their path sensitivity', + outputDir: 'is annotated with unsupported annotation @OutputDirectory', ) } diff --git a/subprojects/dependency-management/src/main/java/org/gradle/api/internal/artifacts/transform/DefaultTransformationRegistrationFactory.java b/subprojects/dependency-management/src/main/java/org/gradle/api/internal/artifacts/transform/DefaultTransformationRegistrationFactory.java index bd3e24abf790b..000d3728b5da1 100644 --- a/subprojects/dependency-management/src/main/java/org/gradle/api/internal/artifacts/transform/DefaultTransformationRegistrationFactory.java +++ b/subprojects/dependency-management/src/main/java/org/gradle/api/internal/artifacts/transform/DefaultTransformationRegistrationFactory.java @@ -117,7 +117,7 @@ public ArtifactTransformRegistration create(ImmutableAttributes from, ImmutableA if (!validationMessages.isEmpty()) { throw new DefaultMultiCauseException( String.format(validationMessages.size() == 1 ? "A problem was found with the configuration of %s." : "Some problems were found with the configuration of %s.", ModelType.of(implementation).getDisplayName()), - validationMessages.stream().map(InvalidUserDataException::new).collect(Collectors.toList())); + validationMessages.stream().sorted().map(InvalidUserDataException::new).collect(Collectors.toList())); } Transformer transformer = new DefaultTransformer( implementation, diff --git a/subprojects/dependency-management/src/main/java/org/gradle/api/internal/artifacts/transform/DefaultTransformer.java b/subprojects/dependency-management/src/main/java/org/gradle/api/internal/artifacts/transform/DefaultTransformer.java index 167a60597e8e6..a83ff326c70ce 100644 --- a/subprojects/dependency-management/src/main/java/org/gradle/api/internal/artifacts/transform/DefaultTransformer.java +++ b/subprojects/dependency-management/src/main/java/org/gradle/api/internal/artifacts/transform/DefaultTransformer.java @@ -263,7 +263,7 @@ public void visitInputFileProperty(String propertyName, boolean optional, boolea if (!validationMessages.isEmpty()) { throw new DefaultMultiCauseException( String.format(validationMessages.size() == 1 ? "A problem was found with the configuration of the artifact transform parameter %s." : "Some problems were found with the configuration of the artifact transform parameter %s.", getParameterObjectDisplayName(parameterObject)), - validationMessages.stream().map(InvalidUserDataException::new).collect(Collectors.toList()) + validationMessages.stream().sorted().map(InvalidUserDataException::new).collect(Collectors.toList()) ); } diff --git a/subprojects/distributions/src/integTest/groovy/org/gradle/DistributionIntegritySpec.groovy b/subprojects/distributions/src/integTest/groovy/org/gradle/DistributionIntegritySpec.groovy new file mode 100644 index 0000000000000..3b9a61da7c5a9 --- /dev/null +++ b/subprojects/distributions/src/integTest/groovy/org/gradle/DistributionIntegritySpec.groovy @@ -0,0 +1,211 @@ +/* + * Copyright 2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle + +import org.gradle.test.fixtures.file.TestFile + +class DistributionIntegritySpec extends DistributionIntegrationSpec { + + /* + * Integration test to verify the integrity of the dependencies. The goal is to be able to check the dependencies + * even we assume that the Gradle binaries are compromised. Ultimately this test should run outside of the Gradle. + */ + + @Override + String getDistributionLabel() { + 'bin' + } + + def "verify 3rd-party dependencies jar hashes"() { + setup: + // dependencies produced by Gradle and cannot be verified by this test + def excluded = ['fastutil-8.2.1-min.jar', 'kotlin-compiler-embeddable-1.3.21-patched-for-gradle-5.4.jar'] + + def expectedHashes = [ + 'annotations-13.0.jar' : 'ace2a10dc8e2d5fd34925ecac03e4988b2c0f851650c94b8cef49ba1bd111478', + 'ant-1.9.13.jar' : '2bec7304216081cfc6b6e6cb04422f1626c08ba70259cc4c62dca19dbd2b330a', + 'ant-launcher-1.9.13.jar' : '080a84963a44901bc8f920037c56de349010388da2c5545077fdd74ae731a40b', + 'asm-7.0.jar' : 'b88ef66468b3c978ad0c97fd6e90979e56155b4ac69089ba7a44e9aa7ffe9acf', + 'asm-analysis-7.0.jar' : 'e981f8f650c4d900bb033650b18e122fa6b161eadd5f88978d08751f72ee8474', + 'asm-commons-7.0.jar' : 'fed348ef05958e3e846a3ac074a12af5f7936ef3d21ce44a62c4fa08a771927d', + 'asm-tree-7.0.jar' : 'cfd7a0874f9de36a999c127feeadfbfe6e04d4a71ee954d7af3d853f0be48a6c', + 'commons-compress-1.18.jar' : '5f2df1e467825e4cac5996d44890c4201c000b43c0b23cffc0782d28a0beb9b0', + 'commons-io-2.6.jar' : 'f877d304660ac2a142f3865badfc971dec7ed73c747c7f8d5d2f5139ca736513', + 'commons-lang-2.6.jar' : '50f11b09f877c294d56f24463f47d28f929cf5044f648661c0f0cfbae9a2f49c', + 'groovy-all-1.0-2.5.4.jar' : '704d3307616c57234871c4db3a355c3e81ea975db8dac8ee6c9264b91c74d2b7', + 'guava-26.0-android.jar' : '1d044ebb866ef08b7d04e998b4260c9b52fab6e6d6b68d207859486bb3686cd5', + 'jansi-1.17.1.jar' : 'b2234bfb0d8f245562d64ed9325df6b907093f4daa702c9082d4796db2a2d894', + 'javax.inject-1.jar' : '91c77044a50c481636c32d916fd89c9118a72195390452c81065080f957de7ff', + 'jcl-over-slf4j-1.7.25.jar' : '5e938457e79efcbfb3ab64bc29c43ec6c3b95fffcda3c155f4a86cc320c11e14', + 'jsr305-3.0.2.jar' : '766ad2a0783f2687962c8ad74ceecc38a28b9f72a2d085ee438b7813e928d0c7', + 'jul-to-slf4j-1.7.25.jar' : '416c5a0c145ad19526e108d44b6bf77b75412d47982cce6ce8d43abdbdbb0fac', + 'kotlin-reflect-1.3.21.jar' : 'a3065c822633191e0a3e3ee12a29bec234fc4b2864a6bb87ef48cce3e9e0c26a', + 'kotlin-sam-with-receiver-compiler-plugin-1.3.21.jar' : '5f1d43096c36516f614206e77d088c5c47a060155c2531defef38e9d87cc15fa', + 'kotlin-script-runtime-1.3.21.jar' : '2e25babc8dcd224b9c479e2c16ce7b4c50407d25f18d60d1fd262f78c2b474cb', + 'kotlin-stdlib-1.3.21.jar' : '38ba2370d9f06f50433e06b2ca775b94473c2e2785f410926079ab793c72b034', + 'kotlin-stdlib-common-1.3.21.jar' : 'cea61f7b611895e64f58569a9757fc0ab0d582f107211e1930e0ce2a0add52a7', + 'kotlin-stdlib-jdk7-1.3.21.jar' : 'a87875604fd42140da6938ae4d35ee61081f4482536efc6d2615b8b626a198af', + 'kotlin-stdlib-jdk8-1.3.21.jar' : '5823ed66ac122a1c55442ebca5a209a843ccd87f562edc31a787f3d2e47f74d4', + 'kotlinx-metadata-jvm-0.0.5.jar' : 'e49454af130e066a4e1c31255c5fd9a23f31105324f48e98406325b051638908', + 'kryo-2.24.0.jar' : '7e56b32c635058f9aa2820f88919ab702d029cbcd15285da9992e36cc0ae52f2', + 'log4j-over-slf4j-1.7.25.jar' : 'c84c5ce4bbb661369ccd4c7b99682027598a0fb2e3d63a84259dbe5c0bf1f949', + 'minlog-1.2.jar' : 'a678cb1aa8f5d03d901c992c75741841d98a9bc3d55dad02e84d65315c4e60f2', + 'native-platform-0.17.jar' : '38d67a2ef50dbd9c587c01a9cc63c00b1328290b2aadd9c49597f0757274a64a', + 'native-platform-freebsd-amd64-libcpp-0.17.jar' : '9f1f89b5a61930f124d2753a0e9177b31a98ddd8aad85e28075b503eeafef50a', + 'native-platform-freebsd-amd64-libstdcpp-0.17.jar' : 'f086f1512fd180a8d26918ae3489202b2f7b37b52722ce37ecc71ff2ccb42a8a', + 'native-platform-freebsd-i386-libcpp-0.17.jar' : 'd0d321c55bc6087fa16d670967e9dd43c47941f96b19f2614efa564d3d7bce8d', + 'native-platform-freebsd-i386-libstdcpp-0.17.jar' : 'd52319783a154156feff52f5ba7df2fdc6860b13af1e8c580bceec7053880808', + 'native-platform-linux-amd64-0.17.jar' : 'da8eae2338e8dbc25bb88678d247f2ba948870b42e8ce63198b6f714eb3452b3', + 'native-platform-linux-amd64-ncurses5-0.17.jar' : 'd85e190ac044d96ec10058e9546dcb17033ebd68d4db059ab78a538c4838c9e5', + 'native-platform-linux-amd64-ncurses6-0.17.jar' : 'dbedcb909e3968e3e83cf219493fcdf7c0a40f944d9da6e852841303fbb98ce1', + 'native-platform-linux-i386-0.17.jar' : '1eaa1b0bb02d2042b96a8dea941e8cd892766af571d1302b0d30328fccc9b2ed', + 'native-platform-linux-i386-ncurses5-0.17.jar' : '01bf87847a6cae5356dc6d36af517f1bf63e380d960b31713f1629b8b77af4de', + 'native-platform-linux-i386-ncurses6-0.17.jar' : 'bbb344ce1bf7f6ae4ff9acffc97865e45dfdf1980bb4c52a487b1368c3958d0e', + 'native-platform-osx-amd64-0.17.jar' : 'c8be647bd5ae084f91dde3545dede65e5abdac966f219881b1b33def007cb3ab', + 'native-platform-windows-amd64-0.17.jar' : '56573ba9a1f14293135aeb80b7bb891ce316eb1d2485766049dc75cf25c04373', + 'native-platform-windows-amd64-min-0.17.jar' : '40351288397b7688f8472ee94d9588fd90ea545db88dcfd82c288663f486dae0', + 'native-platform-windows-i386-0.17.jar' : '1af6bc3dabc85f27195a477ccb6ce05f631354c8ab2d3e213bce9996d3d97992', + 'native-platform-windows-i386-min-0.17.jar' : '5ad72f4ea8990bcd9c0ca3503e0a70cc13ce9c7872556429d2372986ed2a1d69', + 'objenesis-2.6.jar' : '5e168368fbc250af3c79aa5fef0c3467a2d64e5a7bd74005f25d8399aeb0708d', + 'plugins/aether-api-1.13.1.jar' : 'ae8dc80232771f8913febfa410c5719e9ba8ded81fb99788e214fd676dbbe13f', + 'plugins/aether-connector-wagon-1.13.1.jar' : 'df54e8505104228ee7e3fbdead7a7a9cb753b04ca6c9cf60a6b19aee0737f1ec', + 'plugins/aether-impl-1.13.1.jar' : '865511994805827e88f327944a089142bb7f3d88cde271ba3dceb732cb137a93', + 'plugins/aether-spi-1.13.1.jar' : 'd5de4e299be5a79feb1dbe8ff3814034c6e44314b4c00b92ffa8d97576ded5b3', + 'plugins/aether-util-1.13.1.jar' : '687799a0ce988bee9e8eb9ae0ba870300adc0114248ad4a4327bdb625d27e010', + 'plugins/apiguardian-api-1.0.0.jar' : '1f58b77470d8d147a0538d515347dd322f49a83b9e884b8970051160464b65b3', + 'plugins/asm-util-7.0.jar' : '75fbbca440ef463f41c2b0ab1a80abe67e910ac486da60a7863cbcb5bae7e145', + 'plugins/aws-java-sdk-core-1.11.407.jar' : '91db6485e6b13fffbaafdf127c1dd89bbf127556d4f2ce3c958516c99356dca9', + 'plugins/aws-java-sdk-kms-1.11.407.jar' : 'ffd62931c14e7c27180c93e26808f2dcb8e5aaf9647c16f33c01009028091ae3', + 'plugins/aws-java-sdk-s3-1.11.407.jar' : '15255fde9a9acbe226109c6767bc37d7415beeae2cca959bccf12e939da53280', + 'plugins/bcpg-jdk15on-1.61.jar' : 'd31561762756bdc8b70be5c1c72d9e972914e5549eaffe25e684b73aa15d1f63', + 'plugins/bcprov-jdk15on-1.61.jar' : 'dba6e408f205215ad1a89b70b37353d3cdae4ec61037e1feee885704e2413458', + 'plugins/biz.aQute.bndlib-4.0.0.jar' : 'd1a328c8f63aea4f7ce6028a49255137664a7138fadc4af9d25461192b71e098', + 'plugins/bsh-2.0b6.jar' : 'a17955976070c0573235ee662f2794a78082758b61accffce8d3f8aedcd91047', + 'plugins/commons-codec-1.11.jar' : 'e599d5318e97aa48f42136a2927e6dfa4e8881dff0e6c8e3109ddbbff51d7b7d', + 'plugins/dd-plist-1.21.jar' : '019c61abd93ecf614e3d214e9fed942dcf47d9d2d9548fe59d70f0840ba32fb6', + 'plugins/google-api-client-1.25.0.jar' : '24e1a69d6c04e6e72e3e16757d46d32daa7dd43cb32c3895f832f25358be1402', + 'plugins/google-api-services-storage-v1-rev136-1.25.0.jar' : 'c517a94e5ff2670470fc8c3ae690e7d0d28d210276e6f2228aaafead994c59d1', + 'plugins/google-http-client-1.25.0.jar' : 'fb7d80a515da4618e2b402e1fef96999e07621b381a5889ef091482c5a3e961d', + 'plugins/google-http-client-jackson2-1.25.0.jar' : 'f9e7e0d318860a2092d70b56331976280c4e9348a065ede3b99c92aa032fd853', + 'plugins/google-oauth-client-1.25.0.jar' : '7e2929133d4231e702b5956a7e5dc8347a352acc1e97082b40c3585b81cd3501', + 'plugins/gson-2.8.5.jar' : '233a0149fc365c9f6edbd683cfe266b19bdc773be98eabdaf6b3c924b48e7d81', + 'plugins/hamcrest-core-1.3.jar' : '66fdef91e9739348df7a096aa384a5685f4e875584cce89386a7a47251c4d8e9', + 'plugins/httpclient-4.5.6.jar' : 'c03f813195e7a80e3608d0ddd8da80b21696a4c92a6a2298865bf149071551c7', + 'plugins/httpcore-4.4.10.jar' : '78ba1096561957db1b55200a159b648876430342d15d461277e62360da19f6fd', + 'plugins/ion-java-1.0.2.jar' : '0d127b205a1fce0abc2a3757a041748651bc66c15cf4c059bac5833b27d471a5', + 'plugins/ivy-2.3.0.jar' : 'ff3543305c62f23d1a4cafc66fab9c9f55ea169ccf2b6c040d3fa23254b86b18', + 'plugins/jackson-annotations-2.9.8.jar' : 'fdca896161766ca4a2c3e06f02f6a5ede22a5b3a55606541cd2838eace08ca23', + 'plugins/jackson-core-2.9.8.jar' : 'd934dab0bd48994eeea2c1b493cb547158a338a80b58c4fbc8e85fb0905e105f', + 'plugins/jackson-databind-2.9.8.jar' : '2351c3eba73a545db9079f5d6d768347ad72666537362c8220fe3e950a55a864', + 'plugins/jatl-0.2.3.jar' : '93ee3810f7275244f5f6311d50c587d8fe43ab5047dfa3291aa96fe50587501c', + 'plugins/jaxb-impl-2.3.1.jar' : 'e6c9e0f1830fd5f7c30c25ecf5e2046c5668b06d304add89d2f027d5072297d0', + 'plugins/jcifs-1.3.17.jar' : '3b077938f676934bc20bde821d1bdea2cd6d55d96151218b40fd159532f45061', + 'plugins/jcommander-1.72.jar' : 'e0de160b129b2414087e01fe845609cd55caec6820cfd4d0c90fabcc7bdb8c1e', + 'plugins/jmespath-java-1.11.407.jar' : '0048fd27f16c465011b76443c4daa636fa0fbccf1e48fae3f8d8e0dc7f2f7cf2', + 'plugins/joda-time-2.10.jar' : 'c4d50dae4d58c3031475d64ae5eafade50f1861ca1553252aa7fd176d56e4eec', + 'plugins/jsch-0.1.54.jar' : '92eb273a3316762478fdd4fe03a0ce1842c56f496c9c12fe1235db80450e1fdb', + 'plugins/junit-4.12.jar' : '59721f0805e223d84b90677887d9ff567dc534d7c502ca903c0c2b17f05c116a', + 'plugins/junit-platform-commons-1.3.1.jar' : '457d8e1c0c80d1e320a792ec35e7c180694ba05182d7ecf7dabdb4e5a8a12fe2', + 'plugins/junit-platform-engine-1.3.1.jar' : '303d0546c3e950cc3beaca00dfcbf2632d4eca530e4e446391bf193cbc2a71a3', + 'plugins/junit-platform-launcher-1.3.1.jar' : '6f698076c33cf27d2b80de11506031b625733aab7f18e2d4c5d15803f27231dd', + 'plugins/jzlib-1.1.3.jar' : '89b1360f407381bf61fde411019d8cbd009ebb10cff715f3669017a031027560', + 'plugins/maven-aether-provider-3.0.4.jar' : '33ff4aabbd0d02e4dd8279cda8f366c69915302bc4bb97bc01814a985f5c0643', + 'plugins/maven-artifact-3.0.4.jar' : '3c199a96af9550872724f41c053d7839dfcc6512e7704fa16c675363c4146796', + 'plugins/maven-compat-3.0.4.jar' : 'a2d02378d413d9e87833780820163902c5be4b0f3c44b65de7608f47cd94599f', + 'plugins/maven-core-3.0.4.jar' : '3dd795c0ad9742a0be65a2a5ec22428d59dd2a891a7565ae94f64661e3740528', + 'plugins/maven-model-3.0.4.jar' : '26b6825ea73ac4d7b1a6f5e62ac1c11b0fc272504da6dde9ba8f894cd847e1c1', + 'plugins/maven-model-builder-3.0.4.jar' : 'b4f1d3ae53c290e1ae45694c5ce2d17bf8d577ff5ece0f9aa0cffe151a6ef4e7', + 'plugins/maven-plugin-api-3.0.4.jar' : '4e5ee7f7ab7e43f691788489e59f2da4a322e3e35f2a2d8b714ad929f624eead', + 'plugins/maven-repository-metadata-3.0.4.jar' : 'a25c4db27cffda9e9229db168b1190d6a3e5439f3f67d6afec3df9470e0752d5', + 'plugins/maven-settings-3.0.4.jar' : '3e3df17f5df5e4ce1e7b7f2011c57d61d328e65678542ade2048f0d0fa295f09', + 'plugins/maven-settings-builder-3.0.4.jar' : 'a38a54ec1e69a30ddfc14434e0aec2764fc268668abcc0e132d86692a5dce3e4', + 'plugins/nekohtml-1.9.22.jar' : '452978e8b6667c7b8357fd3f0a2f2f405e4560a7148143a69181735da5d19045', + 'plugins/opentest4j-1.1.1.jar' : 'f106351abd941110226745ed103c85863b3f04e9fa82ddea1084639ae0c5336c', + 'plugins/org.eclipse.jgit-5.0.3.201809091024-r.jar' : '5b3a2dacf8619884bf2ca998c0d7a9980aeaf24ace664e9c2b1adbee8e913e19', + 'plugins/plexus-cipher-1.7.jar' : '114859861ff10f987b880d6f34e3215274af3cc92b3a73831c84d596e37c6511', + 'plugins/plexus-classworlds-2.5.1.jar' : 'de9ce33b29088c2db7c3f55ddc061c2a7a72f9c93c28faad62cc15aee26b6888', + 'plugins/plexus-component-annotations-1.5.5.jar' : '4df7a6a7be64b35bbccf60b5c115697f9ea3421d22674ae67135dde375fcca1f', + 'plugins/plexus-container-default-1.7.1.jar' : 'f3f61952d63675ef61b42fa4256c1635749a5bc17668b4529fccde0a29d8ee19', + 'plugins/plexus-interpolation-1.14.jar' : '7fc63378d3e84663619b9bedace9f9fe78b276c2be3c62ca2245449294c84176', + 'plugins/plexus-sec-dispatcher-1.3.jar' : '3b0559bb8432f28937efe6ca193ef54a8506d0075d73fd7406b9b116c6a11063', + 'plugins/plexus-utils-3.1.0.jar' : '0ffa0ad084ebff5712540a7b7ea0abda487c53d3a18f78c98d1a3675dab9bf61', + 'plugins/pmaven-common-0.8-20100325.jar' : '129306abcdb337cd53e710aadafaa226f017997e6bc81c2cb50deb00916ca8d8', + 'plugins/pmaven-groovy-0.8-20100325.jar' : '87891a373d079fd370e859b1f5bd0579d8b4a68e515fa8bbae91301c28f48d57', + 'plugins/rhino-1.7.10.jar' : '38eb3000cf56b8c7559ee558866a768eebcbf254174522d6404b7f078f75c2d4', + 'plugins/simple-4.1.21.jar' : '8e6439fcc1f2fe87b5dfc20eb13289acba8047e9cfadf45ad3dc5c57a9bcd054', + 'plugins/snakeyaml-1.17.jar' : '5666b36f9db46f06dd5a19d73bbff3b588d5969c0f4b8848fde0f5ec849430a5', + 'plugins/testng-6.3.1.jar' : '57ed8e83e357c3838daad81b789a2753227fee8cfb86aa31a61b765c4093d6ad', + 'plugins/wagon-file-3.0.0.jar' : '63324036899559f94154e6f845e62453a1f202c1b21b80060f2d88a05a05a272', + 'plugins/wagon-http-3.0.0.jar' : '9f68fed6684c2245a62d5d3c8b4954b882562797e96b15ce0f18514c543fb999', + 'plugins/wagon-http-shared-3.0.0.jar' : '40c51265b3ed90b6919c08dcdf3620dc614894ef60bacdf4c34bdbe295b44c49', + 'plugins/wagon-provider-api-3.0.0.jar' : '04de4d2f39178998ef3ce5f6d91a358363ad3f5270e897d5547321ea69fa2992', + 'plugins/xbean-reflect-3.7.jar' : '104e5e9bb5a669f86722f32281960700f7ec8e3209ef51b23eb9b6d23d1629cb', + 'plugins/xercesImpl-2.12.0.jar' : 'b50d3a4ca502faa4d1c838acb8aa9480446953421f7327e338c5dda3da5e76d0', + 'slf4j-api-1.7.25.jar' : '18c4a0095d5c1da6b817592e767bb23d29dd2f560ad74df75ff3961dbde25b79', + 'trove4j-1.0.20181211.jar' : 'affb7c85a3c87bdcf69ff1dbb84de11f63dc931293934bc08cd7ab18de083601', + 'xml-apis-1.4.01.jar' : 'a840968176645684bb01aed376e067ab39614885f9eee44abe35a5f20ebe7fad', + ] + + def libDir = unpackDistribution().file('lib') + def jars = collectJars(libDir) + Map depJars = jars.collectEntries { [(libDir.relativePath(it)): it] }.findAll { String k, File v -> !k.startsWith('gradle-') && !k.startsWith("plugins/gradle-") && !excluded.contains(k) } + + def added = depJars.keySet() - expectedHashes.keySet() + def removed = expectedHashes.keySet() - depJars.keySet() + + expect: + if (!(added + removed).isEmpty()) { + System.err.println "Dependencies changed: added=$added, removed=$removed" + printScript(depJars) + assert (added + removed).isEmpty() + } + + def errors = [] + depJars.each { String jarPath, TestFile jar -> + def expected = expectedHashes[jarPath] + def actual = jar.sha256Hash + if (expected != actual) { + errors.add([path: jarPath, expectedHash: expected, actualHash: actual]) + } + } + + !errors.findAll { error -> + System.err.println "Sha-256 hash does not match for ${error.path}: expected=${error.expectedHash}, actual=${error.actualHash}" + true + } + } + + private static def collectJars(TestFile file, Collection acc = []) { + if (file.name.endsWith('.jar')) { + acc.add(file) + } + if (file.isDirectory()) { + file.listFiles().each { f -> collectJars(f, acc) } + } + acc + } + + private static void printScript(depJars) { + System.err.println "Use the following script to regenerate the expected hashes" + System.err.println "(note: install the jq package: `brew install jq`)\n" + + System.err.println '#!/bin/bash' + depJars.each { String jarName, File jar -> + System.err.println """echo -n "'"; echo -n $jarName; echo -n "' : "; wget -qO - `curl -s -H "X-Artifactory-Override-Base-Url: https://dev12.gradle.org/artifactory" https://dev12.gradle.org/artifactory/api/search/artifact?name=$jar.name | jq '.results[0].uri' | tr -d '\"'` | jq '.checksums.sha256' | tr -d '"' | sed -e "s/\\(.*\\)/'\\1',/" """ + } + } +} diff --git a/subprojects/docs/docs.gradle b/subprojects/docs/docs.gradle index 7d434336354ee..8e894ce060f45 100755 --- a/subprojects/docs/docs.gradle +++ b/subprojects/docs/docs.gradle @@ -309,7 +309,7 @@ def javadocAll = tasks.register("javadocAll", Javadoc) { options.addStringOption "stylesheetfile", stylesheetFile.absolutePath options.addStringOption "source", "8" source ProjectGroups.INSTANCE.getPublicJavaProjects(project).collect { project -> project.sourceSets.main.allJava } - destinationDir = new File(docsDir, 'javadoc') + destinationDir = new File(docsDir, 'javadoc') classpath = configurations.gradleApiRuntime PublicApi.includes.each { @@ -333,7 +333,10 @@ def javadocAll = tasks.register("javadocAll", Javadoc) { // Commit http://hg.openjdk.java.net/jdk/jdk/rev/89dc31d7572b broke use of JSZip (https://bugs.openjdk.java.net/browse/JDK-8214856) fixed in Java 12 by http://hg.openjdk.java.net/jdk/jdk/rev/b4982a22926b // TODO: Remove this script.js workaround when we distribute Gradle using JDK 12 or higher - new File(destinationDir, 'script.js').text = new File(srcDocsDir, 'js/javadoc/script.js').text + project.copy { + from(new File(srcDocsDir, "js/javadoc")) + into(destinationDir) + } } } } diff --git a/subprojects/docs/src/docs/css/javadoc.css b/subprojects/docs/src/docs/css/javadoc.css index abe463ecc3383..600f74cc957ba 100644 --- a/subprojects/docs/src/docs/css/javadoc.css +++ b/subprojects/docs/src/docs/css/javadoc.css @@ -1,585 +1,687 @@ -/* This file is a copy of the default stylesheet generated by Java 11 javadoc styles with minor tweaks (fonts and colors). */ -/* - * Javadoc style sheet - */ +/* This file is a copy of the default stylesheet generated by Java 9 javadoc styles with minor tweaks (fonts and colors). */ -@import url('resources/fonts/dejavu.css'); +/* Lato (normal, regular) */ +@font-face { + font-family: Lato; + font-weight: 400; + font-style: normal; + src: url("https://assets.gradle.com/lato/fonts/lato-normal/lato-normal.woff2") format("woff2"), + url("https://assets.gradle.com/lato/fonts/lato-normal/lato-normal.woff") format("woff"); +} +/* Lato (normal, italic) */ +@font-face { + font-display: swap; + font-family: Lato; + font-weight: 400; + font-style: italic; + src: url("https://assets.gradle.com/lato/fonts/lato-normal-italic/lato-normal-italic.woff2") format("woff2"), + url("https://assets.gradle.com/lato/fonts/lato-normal-italic/lato-normal-italic.woff") format("woff"); +} +/* Lato (bold, regular) */ +@font-face { + font-display: swap; + font-family: Lato; + font-weight: 500; + font-style: normal; + src: url("https://assets.gradle.com/lato/fonts/lato-semibold/lato-semibold.woff2") format("woff2"), + url("https://assets.gradle.com/lato/fonts/lato-semibold/lato-semibold.woff") format("woff"); +} +/* Lato (bold, regular) */ +@font-face { + font-display: swap; + font-family: Lato; + font-weight: 800; + font-style: normal; + src: url("https://assets.gradle.com/lato/fonts/lato-heavy/lato-heavy.woff2") format("woff2"), + url("https://assets.gradle.com/lato/fonts/lato-heavy/lato-heavy.woff") format("woff"); +} +/* Javadoc style sheet */ /* - * Styles for individual HTML elements. - * - * These are styles that are specific to individual HTML elements. Changing them affects the style of a particular - * HTML element throughout the page. - */ - +Overall document style +*/ body { - background-color:#ffffff; - color:#353833; - font-family:'DejaVu Sans', Arial, Helvetica, sans-serif; - font-size:14px; - margin:0; - padding:0; - height:100%; - width:100%; + background-color: #ffffff; + color: #353833; + font-family: 'DejaVu Sans', Arial, Helvetica, sans-serif; + font-size: 14px; + margin: 0; + padding: 0; + height: 100%; + width: 100%; } + iframe { - margin:0; - padding:0; - height:100%; - width:100%; - overflow-y:scroll; - border:none; + margin: 0; + padding: 0; + height: 100%; + width: 100%; + overflow-y: scroll; + border: none; } + a:link, a:visited { - text-decoration:none; - color:#4A6782; + text-decoration: none; + color: #4A6782; } + a[href]:hover, a[href]:focus { - text-decoration:none; - color:#bb7a2a; + text-decoration: none; + color: #bb7a2a; } + a[name] { - color:#353833; + color: #353833; } + a[name]:before, a[name]:target, a[id]:before, a[id]:target { - content:""; - display:inline-block; - position:relative; - padding-top:129px; - margin-top:-129px; + content: ""; + display: inline-block; + position: relative; + padding-top: 129px; + margin-top: -129px; +} + +.searchTagResult:before, .searchTagResult:target { + color: red; } + pre { - font-family:'DejaVu Sans Mono', monospace; - font-size:14px; + font-family: 'DejaVu Sans Mono', monospace; + font-size: 14px; } + h1 { - font-size:20px; + font-size: 20px; } + h2 { - font-size:18px; + font-size: 18px; } + h3 { - font-size:16px; - font-style:italic; + font-size: 16px; + font-style: italic; } + h4 { - font-size:13px; + font-size: 13px; } + h5 { - font-size:12px; + font-size: 12px; } + h6 { - font-size:11px; + font-size: 11px; } + ul { - list-style-type:disc; + list-style-type: disc; } + code, tt { - font-family:'DejaVu Sans Mono', monospace; - font-size:14px; - padding-top:4px; - margin-top:8px; - line-height:1.4em; + font-family: 'DejaVu Sans Mono', monospace; + font-size: 14px; + padding-top: 4px; + margin-top: 8px; + line-height: 1.4em; } + dt code { - font-family:'DejaVu Sans Mono', monospace; - font-size:14px; - padding-top:4px; + font-family: 'DejaVu Sans Mono', monospace; + font-size: 14px; + padding-top: 4px; } + table tr td dt code { - font-family:'DejaVu Sans Mono', monospace; - font-size:14px; - vertical-align:top; - padding-top:4px; + font-family: 'DejaVu Sans Mono', monospace; + font-size: 14px; + vertical-align: top; + padding-top: 4px; } + sup { - font-size:8px; + font-size: 8px; } /* - * Styles for HTML generated by javadoc. - * - * These are style classes that are used by the standard doclet to generate HTML documentation. - */ - -/* - * Styles for document title and copyright. - */ +Document title and Copyright styles +*/ .clear { - clear:both; - height:0px; - overflow:hidden; + clear: both; + height: 0px; + overflow: hidden; } + .aboutLanguage { - float:right; - padding:0px 21px; - font-size:11px; - z-index:200; - margin-top:-9px; + float: right; + padding: 0px 21px; + font-size: 11px; + z-index: 200; + margin-top: -9px; } + .legalCopy { - margin-left:.5em; + margin-left: .5em; } + .bar a, .bar a:link, .bar a:visited, .bar a:active { - color:#FFFFFF; - text-decoration:none; + color: #FFFFFF; + text-decoration: none; } + .bar a:hover, .bar a:focus { - color:#bb7a2a; + color: #bb7a2a; } + .tab { - background-color:#0066FF; - color:#ffffff; - padding:8px; - width:5em; - font-weight:bold; + background-color: #0066FF; + color: #ffffff; + padding: 8px; + width: 5em; + font-weight: bold; } + /* - * Styles for navigation bar. - */ +Navigation bar styles +*/ .bar { - background-color:#4D7A97; - color:#FFFFFF; - padding:.8em .5em .4em .8em; - height:auto;/*height:1.8em;*/ - font-size:11px; - margin:0; + background-color: #DDDDDD; + color: #02303A; + padding: .8em .5em .4em .8em; + height: auto; /*height:1.8em;*/ + font-size: 11px; + margin: 0; } + .navPadding { padding-top: 107px; } -.fixedNav { - position:fixed; - width:100%; - z-index:999; - background-color:#ffffff; -} + .topNav { - background-color:#4D7A97; - color:#FFFFFF; - float:left; - padding:0; - width:100%; - clear:right; - height:2.8em; - padding-top:10px; - overflow:hidden; - font-size:12px; + background-color: #DDDDDD; + color: #02303A; + float: left; + padding: 0; + width: 100%; + clear: right; + height: 2.8em; + padding-top: 10px; + overflow: hidden; + font-size: 12px; } + .bottomNav { - margin-top:10px; - background-color:#4D7A97; - color:#FFFFFF; - float:left; - padding:0; - width:100%; - clear:right; - height:2.8em; - padding-top:10px; - overflow:hidden; - font-size:12px; + margin-top: 10px; + background-color: #DDDDDD; + color: #02303A; + float: left; + padding: 0; + width: 100%; + clear: right; + height: 2.8em; + padding-top: 10px; + overflow: hidden; + font-size: 12px; } + .subNav { - background-color:#dee3e9; - float:left; - width:100%; - overflow:hidden; - font-size:12px; + background-color: #dee3e9; + float: left; + width: 100%; + overflow: hidden; + font-size: 12px; } + .subNav div { - clear:left; - float:left; - padding:0 0 5px 6px; - text-transform:uppercase; + clear: left; + float: left; + padding: 0 0 5px 6px; + text-transform: uppercase; } + ul.navList, ul.subNavList { - float:left; - margin:0 25px 0 0; - padding:0; + float: left; + margin: 0 25px 0 0; + padding: 0; } -ul.navList li{ - list-style:none; - float:left; + +ul.navList li { + list-style: none; + float: left; padding: 5px 6px; - text-transform:uppercase; + text-transform: uppercase; } + ul.navListSearch { - float:right; - margin:0 0 0 0; - padding:0; + float: right; + margin: 0 0 0 0; + padding: 0; } + ul.navListSearch li { - list-style:none; - float:right; + list-style: none; + float: right; padding: 5px 6px; - text-transform:uppercase; + text-transform: uppercase; } -ul.navListSearch li label { - position:relative; - right:-16px; + +ul.navListSearch li span { + position: relative; + right: -16px; } + ul.subNavList li { - list-style:none; - float:left; + list-style: none; + float: left; } + .topNav a:link, .topNav a:active, .topNav a:visited, .bottomNav a:link, .bottomNav a:active, .bottomNav a:visited { - color:#FFFFFF; - text-decoration:none; - text-transform:uppercase; + color: #FFFFFF; + text-decoration: none; + text-transform: uppercase; } + .topNav a:hover, .bottomNav a:hover { - text-decoration:none; - color:#bb7a2a; - text-transform:uppercase; + text-decoration: none; + color: #bb7a2a; + text-transform: uppercase; } + .navBarCell1Rev { - background-color:#F8981D; - color:#253441; + background-color: #1BA8CB; + color: #FFFFFF; margin: auto 5px; } + .skipNav { - position:absolute; - top:auto; - left:-9999px; - overflow:hidden; + position: absolute; + top: auto; + left: -9999px; + overflow: hidden; } + /* - * Styles for page header and footer. - */ +Page header and footer styles +*/ .header, .footer { - clear:both; - margin:0 20px; - padding:5px 0 0 0; + clear: both; + margin: 0 20px; + padding: 5px 0 0 0; } + .indexNav { - position:relative; - font-size:12px; - background-color:#dee3e9; + position: relative; + font-size: 12px; + background-color: #dee3e9; } + .indexNav ul { - margin-top:0; - padding:5px; + margin-top: 0; + padding: 5px; } + .indexNav ul li { - display:inline; - list-style-type:none; - padding-right:10px; - text-transform:uppercase; + display: inline; + list-style-type: none; + padding-right: 10px; + text-transform: uppercase; } + .indexNav h1 { - font-size:13px; + font-size: 13px; } + .title { - color:#2c4557; - margin:10px 0; + color: #2c4557; + margin: 10px 0; } + .subTitle { - margin:5px 0 0 0; + margin: 5px 0 0 0; } + .header ul { - margin:0 0 15px 0; - padding:0; + margin: 0 0 15px 0; + padding: 0; } + .footer ul { - margin:20px 0 5px 0; + margin: 20px 0 5px 0; } + .header ul li, .footer ul li { - list-style:none; - font-size:13px; + list-style: none; + font-size: 13px; } + /* - * Styles for headings. - */ +Heading styles +*/ div.details ul.blockList ul.blockList ul.blockList li.blockList h4, div.details ul.blockList ul.blockList ul.blockListLast li.blockList h4 { - background-color:#dee3e9; - border:1px solid #d0d9e0; - margin:0 0 6px -8px; - padding:7px 5px; + background-color: #dee3e9; + border: 1px solid #d0d9e0; + margin: 0 0 6px -8px; + padding: 7px 5px; } + ul.blockList ul.blockList ul.blockList li.blockList h3 { - background-color:#dee3e9; - border:1px solid #d0d9e0; - margin:0 0 6px -8px; - padding:7px 5px; + background-color: #dee3e9; + border: 1px solid #d0d9e0; + margin: 0 0 6px -8px; + padding: 7px 5px; } + ul.blockList ul.blockList li.blockList h3 { - padding:0; - margin:15px 0; + padding: 0; + margin: 15px 0; } + ul.blockList li.blockList h2 { - padding:0px 0 20px 0; + padding: 0px 0 20px 0; } + /* - * Styles for page layout containers. - */ -.contentContainer, .sourceContainer, .classUseContainer, .serializedFormContainer, .constantValuesContainer, -.allClassesContainer, .allPackagesContainer { - clear:both; - padding:10px 20px; - position:relative; +Page layout container styles +*/ +.contentContainer, .sourceContainer, .classUseContainer, .serializedFormContainer, .constantValuesContainer { + clear: both; + padding: 10px 20px; + position: relative; } + .indexContainer { - margin:10px; - position:relative; - font-size:12px; + margin: 10px; + position: relative; + font-size: 12px; } + .indexContainer h2 { - font-size:13px; - padding:0 0 3px 0; + font-size: 13px; + padding: 0 0 3px 0; } + .indexContainer ul { - margin:0; - padding:0; + margin: 0; + padding: 0; } + .indexContainer ul li { - list-style:none; - padding-top:2px; + list-style: none; + padding-top: 2px; } + .contentContainer .description dl dt, .contentContainer .details dl dt, .serializedFormContainer dl dt { - font-size:12px; - font-weight:bold; - margin:10px 0 0 0; - color:#4E4E4E; + font-size: 12px; + font-weight: bold; + margin: 10px 0 0 0; + color: #4E4E4E; } + .contentContainer .description dl dd, .contentContainer .details dl dd, .serializedFormContainer dl dd { - margin:5px 0 10px 0px; - font-size:14px; - font-family:'DejaVu Serif', Georgia, "Times New Roman", Times, serif; + margin: 5px 0 10px 0px; + font-size: 14px; + font-family: 'DejaVu Serif', Georgia, "Times New Roman", Times, serif; } + .serializedFormContainer dl.nameValue dt { - margin-left:1px; - font-size:1.1em; - display:inline; - font-weight:bold; + margin-left: 1px; + font-size: 1.1em; + display: inline; + font-weight: bold; } + .serializedFormContainer dl.nameValue dd { - margin:0 0 0 1px; - font-size:1.1em; - display:inline; + margin: 0 0 0 1px; + font-size: 1.1em; + display: inline; } + /* - * Styles for lists. - */ +List styles +*/ li.circle { - list-style:circle; + list-style: circle; } + ul.horizontal li { - display:inline; - font-size:0.9em; + display: inline; + font-size: 0.9em; } + ul.inheritance { - margin:0; - padding:0; + margin: 0; + padding: 0; } + ul.inheritance li { - display:inline; - list-style:none; + display: inline; + list-style: none; } + ul.inheritance li ul.inheritance { - margin-left:15px; - padding-left:15px; - padding-top:1px; + margin-left: 15px; + padding-left: 15px; + padding-top: 1px; } + ul.blockList, ul.blockListLast { - margin:10px 0 10px 0; - padding:0; + margin: 10px 0 10px 0; + padding: 0; } + ul.blockList li.blockList, ul.blockListLast li.blockList { - list-style:none; - margin-bottom:15px; - line-height:1.4; + list-style: none; + margin-bottom: 15px; + line-height: 1.4; } + ul.blockList ul.blockList li.blockList, ul.blockList ul.blockListLast li.blockList { - padding:0px 20px 5px 10px; - border:1px solid #ededed; - background-color:#f8f8f8; + padding: 0px 20px 5px 10px; + border: 1px solid #ededed; + background-color: #f8f8f8; } + ul.blockList ul.blockList ul.blockList li.blockList, ul.blockList ul.blockList ul.blockListLast li.blockList { - padding:0 0 5px 8px; - background-color:#ffffff; - border:none; + padding: 0 0 5px 8px; + background-color: #ffffff; + border: none; } + ul.blockList ul.blockList ul.blockList ul.blockList li.blockList { - margin-left:0; - padding-left:0; - padding-bottom:15px; - border:none; + margin-left: 0; + padding-left: 0; + padding-bottom: 15px; + border: none; } + ul.blockList ul.blockList ul.blockList ul.blockList li.blockListLast { - list-style:none; - border-bottom:none; - padding-bottom:0; + list-style: none; + border-bottom: none; + padding-bottom: 0; } + table tr td dl, table tr td dl dt, table tr td dl dd { - margin-top:0; - margin-bottom:1px; + margin-top: 0; + margin-bottom: 1px; } + /* - * Styles for tables. - */ +Table styles +*/ .overviewSummary, .memberSummary, .typeSummary, .useSummary, .constantsSummary, .deprecatedSummary, .requiresSummary, .packagesSummary, .providesSummary, .usesSummary { - width:100%; - border-spacing:0; - border-left:1px solid #EEE; - border-right:1px solid #EEE; - border-bottom:1px solid #EEE; + width: 100%; + border-spacing: 0; + border-left: 1px solid #EEE; + border-right: 1px solid #EEE; + border-bottom: 1px solid #EEE; } -.overviewSummary, .memberSummary, .requiresSummary, .packagesSummary, .providesSummary, .usesSummary { - padding:0px; + +.overviewSummary, .memberSummary, .requiresSummary, .packagesSummary, .providesSummary, .usesSummary { + padding: 0px; } + .overviewSummary caption, .memberSummary caption, .typeSummary caption, .useSummary caption, .constantsSummary caption, .deprecatedSummary caption, .requiresSummary caption, .packagesSummary caption, .providesSummary caption, .usesSummary caption { - position:relative; - text-align:left; - background-repeat:no-repeat; - color:#253441; - font-weight:bold; - clear:none; - overflow:hidden; - padding:0px; - padding-top:10px; - padding-left:1px; - margin:0px; - white-space:pre; + position: relative; + text-align: left; + background-repeat: no-repeat; + color: #FFFFFF; + font-weight: bold; + clear: none; + overflow: hidden; + padding: 0px; + padding-top: 10px; + padding-left: 1px; + margin: 0px; + white-space: pre; } + .overviewSummary caption a:link, .memberSummary caption a:link, .typeSummary caption a:link, -.constantsSummary caption a:link, .deprecatedSummary caption a:link, -.requiresSummary caption a:link, .packagesSummary caption a:link, .providesSummary caption a:link, +.useSummary caption a:link, .constantsSummary caption a:link, .deprecatedSummary caption a:link, +.requiresSummary caption a:link, .packagesSummary caption a:link, providesSummary caption a:link, .usesSummary caption a:link, .overviewSummary caption a:hover, .memberSummary caption a:hover, .typeSummary caption a:hover, -.constantsSummary caption a:hover, .deprecatedSummary caption a:hover, -.requiresSummary caption a:hover, .packagesSummary caption a:hover, .providesSummary caption a:hover, +.useSummary caption a:hover, .constantsSummary caption a:hover, .deprecatedSummary caption a:hover, +.requiresSummary caption a:hover, .packagesSummary caption a:hover, providesSummary caption a:hover, .usesSummary caption a:hover, .overviewSummary caption a:active, .memberSummary caption a:active, .typeSummary caption a:active, -.constantsSummary caption a:active, .deprecatedSummary caption a:active, -.requiresSummary caption a:active, .packagesSummary caption a:active, .providesSummary caption a:active, +.useSummary caption a:active, .constantsSummary caption a:active, .deprecatedSummary caption a:active, +.requiresSummary caption a:active, .packagesSummary caption a:active, providesSummary caption a:active, .usesSummary caption a:active, .overviewSummary caption a:visited, .memberSummary caption a:visited, .typeSummary caption a:visited, -.constantsSummary caption a:visited, .deprecatedSummary caption a:visited, -.requiresSummary caption a:visited, .packagesSummary caption a:visited, .providesSummary caption a:visited, +.useSummary caption a:visited, .constantsSummary caption a:visited, .deprecatedSummary caption a:visited +.requiresSummary caption a:visited, .packagesSummary caption a:visited, providesSummary caption a:visited, .usesSummary caption a:visited { - color:#FFFFFF; -} -.useSummary caption a:link, .useSummary caption a:hover, .useSummary caption a:active, -.useSummary caption a:visited { - color:#1f389c; + color: #FFFFFF; } + .overviewSummary caption span, .memberSummary caption span, .typeSummary caption span, .useSummary caption span, .constantsSummary caption span, .deprecatedSummary caption span, .requiresSummary caption span, .packagesSummary caption span, .providesSummary caption span, .usesSummary caption span { - white-space:nowrap; - padding-top:5px; - padding-left:12px; - padding-right:12px; - padding-bottom:7px; - display:inline-block; - float:left; - background-color:#F8981D; + white-space: nowrap; + padding-top: 5px; + padding-left: 12px; + padding-right: 12px; + padding-bottom: 7px; + display: inline-block; + float: left; + background-color: #1BA8CB; border: none; - height:16px; -} -.memberSummary caption span.activeTableTab span, .packagesSummary caption span.activeTableTab span, -.overviewSummary caption span.activeTableTab span, .typeSummary caption span.activeTableTab span { - white-space:nowrap; - padding-top:5px; - padding-left:12px; - padding-right:12px; - margin-right:3px; - display:inline-block; - float:left; - background-color:#F8981D; - height:16px; -} -.memberSummary caption span.tableTab span, .packagesSummary caption span.tableTab span, -.overviewSummary caption span.tableTab span, .typeSummary caption span.tableTab span { - white-space:nowrap; - padding-top:5px; - padding-left:12px; - padding-right:12px; - margin-right:3px; - display:inline-block; - float:left; - background-color:#4D7A97; - height:16px; + height: 16px; } + +.memberSummary caption span.activeTableTab span, .packagesSummary caption span.activeTableTab span { + white-space: nowrap; + padding-top: 5px; + padding-left: 12px; + padding-right: 12px; + margin-right: 3px; + display: inline-block; + float: left; + background-color: #1BA8CB; + height: 16px; +} + +.memberSummary caption span.tableTab span, .packagesSummary caption span.tableTab span { + white-space: nowrap; + padding-top: 5px; + padding-left: 12px; + padding-right: 12px; + margin-right: 3px; + display: inline-block; + float: left; + background-color: #DDDDDD; + height: 16px; +} + .memberSummary caption span.tableTab, .memberSummary caption span.activeTableTab, -.packagesSummary caption span.tableTab, .packagesSummary caption span.activeTableTab, -.overviewSummary caption span.tableTab, .overviewSummary caption span.activeTableTab, -.typeSummary caption span.tableTab, .typeSummary caption span.activeTableTab { - padding-top:0px; - padding-left:0px; - padding-right:0px; - background-image:none; - float:none; - display:inline; +.packagesSummary caption span.tableTab, .packagesSummary caption span.activeTableTab { + padding-top: 0px; + padding-left: 0px; + padding-right: 0px; + background-image: none; + float: none; + display: inline; } + .overviewSummary .tabEnd, .memberSummary .tabEnd, .typeSummary .tabEnd, .useSummary .tabEnd, .constantsSummary .tabEnd, .deprecatedSummary .tabEnd, .requiresSummary .tabEnd, .packagesSummary .tabEnd, .providesSummary .tabEnd, .usesSummary .tabEnd { - display:none; - width:5px; - position:relative; - float:left; - background-color:#F8981D; -} -.memberSummary .activeTableTab .tabEnd, .packagesSummary .activeTableTab .tabEnd, -.overviewSummary .activeTableTab .tabEnd, .typeSummary .activeTableTab .tabEnd { - display:none; - width:5px; - margin-right:3px; - position:relative; - float:left; - background-color:#F8981D; -} -.memberSummary .tableTab .tabEnd, .packagesSummary .tableTab .tabEnd, -.overviewSummary .tableTab .tabEnd, .typeSummary .tableTab .tabEnd { - display:none; - width:5px; - margin-right:3px; - position:relative; - background-color:#4D7A97; - float:left; + display: none; + width: 5px; + position: relative; + float: left; + background-color: #1BA8CB; +} + +.memberSummary .activeTableTab .tabEnd, .packagesSummary .activeTableTab .tabEnd { + display: none; + width: 5px; + margin-right: 3px; + position: relative; + float: left; + background-color: #1BA8CB; } + +.memberSummary .tableTab .tabEnd, .packagesSummary .tableTab .tabEnd { + display: none; + width: 5px; + margin-right: 3px; + position: relative; + background-color: #DDDDDD; + float: left; + +} + .rowColor th, .altColor th { - font-weight:normal; + font-weight: normal; } + .overviewSummary td, .memberSummary td, .typeSummary td, .useSummary td, .constantsSummary td, .deprecatedSummary td, .requiresSummary td, .packagesSummary td, .providesSummary td, .usesSummary td { - text-align:left; - padding:0px 0px 12px 10px; -} -th.colFirst, th.colSecond, th.colLast, th.colConstructorName, th.colDeprecatedItemName, .useSummary th, -.constantsSummary th, .packagesSummary th, td.colFirst, td.colSecond, td.colLast, .useSummary td, -.constantsSummary td { - vertical-align:top; - padding-right:0px; - padding-top:8px; - padding-bottom:3px; -} -th.colFirst, th.colSecond, th.colLast, th.colConstructorName, th.colDeprecatedItemName, .constantsSummary th, -.packagesSummary th { - background:#dee3e9; - text-align:left; - padding:8px 3px 3px 7px; + text-align: left; + padding: 0px 0px 12px 10px; +} + +th.colFirst, th.colSecond, th.colLast, th.colConstructorName, .useSummary th, .constantsSummary th, .packagesSummary th, +td.colFirst, td.colSecond, td.colLast, .useSummary td, .constantsSummary td { + vertical-align: top; + padding-right: 0px; + padding-top: 8px; + padding-bottom: 3px; +} + +th.colFirst, th.colSecond, th.colLast, th.colConstructorName, .constantsSummary th, .packagesSummary th { + background: #dee3e9; + text-align: left; + padding: 8px 3px 3px 7px; } + td.colFirst, th.colFirst { - font-size:13px; + white-space: nowrap; + font-size: 13px; } -td.colSecond, th.colSecond, td.colLast, th.colConstructorName, th.colDeprecatedItemName, th.colLast { - font-size:13px; + +td.colSecond, th.colSecond, td.colLast, th.colConstructorName, th.colLast { + font-size: 13px; } + .constantsSummary th, .packagesSummary th { - font-size:13px; + font-size: 13px; } + .providesSummary th.colFirst, .providesSummary th.colLast, .providesSummary td.colFirst, .providesSummary td.colLast { - white-space:normal; - font-size:13px; + white-space: normal; + font-size: 13px; } + .overviewSummary td.colFirst, .overviewSummary th.colFirst, .requiresSummary td.colFirst, .requiresSummary th.colFirst, .packagesSummary td.colFirst, .packagesSummary td.colSecond, .packagesSummary th.colFirst, .packagesSummary th, @@ -587,245 +689,260 @@ td.colSecond, th.colSecond, td.colLast, th.colConstructorName, th.colDeprecatedI .providesSummary td.colFirst, .providesSummary th.colFirst, .memberSummary td.colFirst, .memberSummary th.colFirst, .memberSummary td.colSecond, .memberSummary th.colSecond, .memberSummary th.colConstructorName, -.typeSummary td.colFirst, .typeSummary th.colFirst { - vertical-align:top; +.typeSummary td.colFirst { + vertical-align: top; } + .packagesSummary th.colLast, .packagesSummary td.colLast { - white-space:normal; + white-space: normal; } + td.colFirst a:link, td.colFirst a:visited, td.colSecond a:link, td.colSecond a:visited, th.colFirst a:link, th.colFirst a:visited, th.colSecond a:link, th.colSecond a:visited, th.colConstructorName a:link, th.colConstructorName a:visited, -th.colDeprecatedItemName a:link, th.colDeprecatedItemName a:visited, -.constantValuesContainer td a:link, .constantValuesContainer td a:visited, -.allClassesContainer td a:link, .allClassesContainer td a:visited, -.allPackagesContainer td a:link, .allPackagesContainer td a:visited { - font-weight:bold; +td.colLast a:link, td.colLast a:visited, +.constantValuesContainer td a:link, .constantValuesContainer td a:visited { + font-weight: bold; } + .tableSubHeadingColor { - background-color:#EEEEFF; + background-color: #EEEEFF; } + .altColor, .altColor th { - background-color:#FFFFFF; + background-color: #FFFFFF; } + .rowColor, .rowColor th { - background-color:#EEEEEF; + background-color: #EEEEEF; } + /* - * Styles for contents. - */ +Content styles +*/ .description pre { - margin-top:0; + margin-top: 0; } + .deprecatedContent { - margin:0; - padding:10px 0; + margin: 0; + padding: 10px 0; } + .docSummary { - padding:0; + padding: 0; } + ul.blockList ul.blockList ul.blockList li.blockList h3 { - font-style:normal; + font-style: normal; } + div.block { - font-size:14px; - font-family:'DejaVu Serif', Georgia, "Times New Roman", Times, serif; + font-size: 14px; + font-family: 'DejaVu Serif', Georgia, "Times New Roman", Times, serif; } + td.colLast div { - padding-top:0px; + padding-top: 0px; } + td.colLast a { - padding-bottom:3px; + padding-bottom: 3px; } + /* - * Styles for formatting effect. - */ +Formatting effect styles +*/ .sourceLineNo { - color:green; - padding:0 30px 0 0; + color: green; + padding: 0 30px 0 0; } + h1.hidden { - visibility:hidden; - overflow:hidden; - font-size:10px; + visibility: hidden; + overflow: hidden; + font-size: 10px; } + .block { - display:block; - margin:3px 10px 2px 0px; - color:#474747; + display: block; + margin: 3px 10px 2px 0px; + color: #474747; } + .deprecatedLabel, .descfrmTypeLabel, .implementationLabel, .memberNameLabel, .memberNameLink, .moduleLabelInPackage, .moduleLabelInType, .overrideSpecifyLabel, .packageLabelInType, .packageHierarchyLabel, .paramLabel, .returnLabel, .seeLabel, .simpleTagLabel, .throwsLabel, .typeNameLabel, .typeNameLink, .searchTagLink { - font-weight:bold; + font-weight: bold; } + .deprecationComment, .emphasizedPhrase, .interfaceName { - font-style:italic; -} -.deprecationBlock { - font-size:14px; - font-family:'DejaVu Serif', Georgia, "Times New Roman", Times, serif; - border-style:solid; - border-width:thin; - border-radius:10px; - padding:10px; - margin-bottom:10px; - margin-right:10px; - display:inline-block; -} -div.block div.deprecationComment, div.block div.block span.emphasizedPhrase, + font-style: italic; +} + +div.block div.block span.deprecationComment, div.block div.block span.emphasizedPhrase, div.block div.block span.interfaceName { - font-style:normal; + font-style: normal; } + div.contentContainer ul.blockList li.blockList h2 { - padding-bottom:0px; + padding-bottom: 0px; } + /* - * Styles for IFRAME. - */ +IFRAME specific styles +*/ .mainContainer { - margin:0 auto; - padding:0; - height:100%; - width:100%; - position:fixed; - top:0; - left:0; + margin: 0 auto; + padding: 0; + height: 100%; + width: 100%; + position: fixed; + top: 0; + left: 0; } + .leftContainer { - height:100%; - position:fixed; - width:320px; + height: 100%; + position: fixed; + width: 320px; } + .leftTop { - position:relative; - float:left; - width:315px; - top:0; - left:0; - height:30%; - border-right:6px solid #ccc; - border-bottom:6px solid #ccc; + position: relative; + float: left; + width: 315px; + top: 0; + left: 0; + height: 30%; + border-right: 6px solid #ccc; + border-bottom: 6px solid #ccc; } + .leftBottom { - position:relative; - float:left; - width:315px; - bottom:0; - left:0; - height:70%; - border-right:6px solid #ccc; - border-top:1px solid #000; + position: relative; + float: left; + width: 315px; + bottom: 0; + left: 0; + height: 70%; + border-right: 6px solid #ccc; + border-top: 1px solid #000; } + .rightContainer { - position:absolute; - left:320px; - top:0; - bottom:0; - height:100%; - right:0; - border-left:1px solid #000; + position: absolute; + left: 320px; + top: 0; + bottom: 0; + height: 100%; + right: 0; + border-left: 1px solid #000; } + .rightIframe { - margin:0; - padding:0; - height:100%; - right:30px; - width:100%; - overflow:visible; - margin-bottom:30px; + margin: 0; + padding: 0; + height: 100%; + right: 30px; + width: 100%; + overflow: visible; + margin-bottom: 30px; } + /* - * Styles specific to HTML5 elements. - */ +HTML5 specific styles +*/ main, nav, header, footer, section { - display:block; + display: block; } -/* - * Styles for javadoc search. - */ + .ui-autocomplete-category { - font-weight:bold; - font-size:15px; - padding:7px 0 7px 3px; - background-color:#4D7A97; - color:#FFFFFF; + font-weight: bold; + font-size: 15px; + padding: 7px 0 7px 3px; + background-color: #DDDDDD; + color: #02303A; } + .resultItem { - font-size:13px; + font-size: 13px; } + .ui-autocomplete { - max-height:85%; - max-width:65%; - overflow-y:scroll; - overflow-x:scroll; - white-space:nowrap; - box-shadow: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23); + max-height: 85%; + max-width: 65%; + overflow-y: scroll; + overflow-x: scroll; + white-space: nowrap; + box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23); } + ul.ui-autocomplete { - position:fixed; - z-index:999999; + position: fixed; + z-index: 999999; } -ul.ui-autocomplete li { - float:left; - clear:both; - width:100%; + +ul.ui-autocomplete li { + float: left; + clear: both; + width: 100%; } + .resultHighlight { - font-weight:bold; + font-weight: bold; } + #search { - background-image:url('resources/glass.png'); - background-size:13px; - background-repeat:no-repeat; - background-position:2px 3px; - padding-left:20px; - position:relative; - right:-18px; + background-image: url('resources/glass.png'); + background-size: 13px; + background-repeat: no-repeat; + background-position: 2px 3px; + padding-left: 20px; + position: relative; + right: -18px; } + #reset { - background-color: rgb(255,255,255); - background-image:url('resources/x.png'); - background-position:center; - background-repeat:no-repeat; - background-size:12px; - border:0 none; - width:16px; - height:17px; - position:relative; - left:-4px; - top:-4px; - font-size:0px; + background-color: rgb(255, 255, 255); + border: 0 none; + width: 16px; + height: 17px; + position: relative; + left: -2px; + background-image: url('resources/x.png'); + background-repeat: no-repeat; + background-size: 12px; + background-position: center; } + .watermark { - color:#545454; + color: #888; } + .searchTagDescResult { - font-style:italic; - font-size:11px; + font-style: italic; + font-size: 11px; } + .searchTagHolderResult { - font-style:italic; - font-size:12px; -} -.searchTagResult:before, .searchTagResult:target { - color:red; + font-style: italic; + font-size: 12px; } + .moduleGraph span { - display:none; - position:absolute; + display: none; + position: absolute; } + .moduleGraph:hover span { - display:block; + display: block; margin: -100px 0 0 100px; z-index: 1; } -.methodSignature { - white-space:normal; -} /* * Styles for user-provided tables. @@ -852,167 +969,69 @@ table.striped { margin-top: 10px; margin-bottom: 10px; } + table.borderless > caption, table.plain > caption, table.striped > caption { font-weight: bold; font-size: smaller; } + table.borderless th, table.borderless td, table.plain th, table.plain td, table.striped th, table.striped td { padding: 2px 5px; } + table.borderless, table.borderless > thead > tr > th, table.borderless > tbody > tr > th, table.borderless > tr > th, table.borderless > thead > tr > td, table.borderless > tbody > tr > td, table.borderless > tr > td { border: none; } + table.borderless > thead > tr, table.borderless > tbody > tr, table.borderless > tr { background-color: transparent; } + table.plain { border-collapse: collapse; border: 1px solid black; } + table.plain > thead > tr, table.plain > tbody tr, table.plain > tr { background-color: transparent; } + table.plain > thead > tr > th, table.plain > tbody > tr > th, table.plain > tr > th, table.plain > thead > tr > td, table.plain > tbody > tr > td, table.plain > tr > td { border: 1px solid black; } + table.striped { border-collapse: collapse; border: 1px solid black; } + table.striped > thead { - background-color: #E3E3E3; -} -table.striped > thead > tr > th, table.striped > thead > tr > td { + background-color: #DDD; border: 1px solid black; } + table.striped > tbody > tr:nth-child(even) { background-color: #EEE } + table.striped > tbody > tr:nth-child(odd) { background-color: #FFF } -table.striped > tbody > tr > th, table.striped > tbody > tr > td { + +table.striped > thead > tr > th, table.striped > tbody > tr > th, +table.striped > tbody > tr > td, table.striped > tbody > tr > td { border-left: 1px solid black; border-right: 1px solid black; } -table.striped > tbody > tr > th { - font-weight: normal; -} -/* SECTION 2 - Gradle style overrides */ -/*Overwriting colors */ -.bar { - background-color:#DDDDDD; - color:#02303A; -} -.fixedNav { - background-color:#DDDDDD; -} -.topNav { - background-color:#DDDDDD; - color:#02303A; -} -.bottomNav { - background-color:#DDDDDD; - color:#02303A; -} -.navBarCell1Rev { - background-color:#1BA8CB; - color:#FFFFFF; -} -.overviewSummary caption, .memberSummary caption, .typeSummary caption, -.useSummary caption, .constantsSummary caption, .deprecatedSummary caption, -.requiresSummary caption, .packagesSummary caption, .providesSummary caption, .usesSummary caption { - color:#FFFFFF; -} -.useSummary caption a:link, .useSummary caption a:hover, .useSummary caption a:active, -.useSummary caption a:visited { - color:#FFFFFF; -} -.overviewSummary caption span, .memberSummary caption span, .typeSummary caption span, -.useSummary caption span, .constantsSummary caption span, .deprecatedSummary caption span, -.requiresSummary caption span, .packagesSummary caption span, .providesSummary caption span, -.usesSummary caption span { - background-color:#1BA8CB; -} -.memberSummary caption span.activeTableTab span, .packagesSummary caption span.activeTableTab span, -.overviewSummary caption span.activeTableTab span, .typeSummary caption span.activeTableTab span { - background-color:#1BA8CB; -} -.memberSummary caption span.tableTab span, .packagesSummary caption span.tableTab span, -.overviewSummary caption span.tableTab span, .typeSummary caption span.tableTab span { - background-color:#DDDDDD; -} -.overviewSummary .tabEnd, .memberSummary .tabEnd, .typeSummary .tabEnd, -.useSummary .tabEnd, .constantsSummary .tabEnd, .deprecatedSummary .tabEnd, -.requiresSummary .tabEnd, .packagesSummary .tabEnd, .providesSummary .tabEnd, .usesSummary .tabEnd { - background-color:#1BA8CB; -} -.memberSummary .activeTableTab .tabEnd, .packagesSummary .activeTableTab .tabEnd, -.overviewSummary .activeTableTab .tabEnd, .typeSummary .activeTableTab .tabEnd { - background-color:#1BA8CB; -} -.memberSummary .tableTab .tabEnd, .packagesSummary .tableTab .tabEnd, -.overviewSummary .tableTab .tabEnd, .typeSummary .tableTab .tabEnd { - background-color:#DDDDDD; -} -.ui-autocomplete-category { - background-color:#DDDDDD; - color:#02303A; -} -.watermark { - color:#888; -} -table.striped > thead { - background-color: #DDD; -} - -td.colFirst, th.colFirst { - white-space: nowrap; -} - -/* Lato (normal, regular) */ -@font-face { - font-family: Lato; - font-weight: 400; - font-style: normal; - src: url("https://assets.gradle.com/lato/fonts/lato-normal/lato-normal.woff2") format("woff2"), - url("https://assets.gradle.com/lato/fonts/lato-normal/lato-normal.woff") format("woff"); -} -/* Lato (normal, italic) */ -@font-face { - font-display: swap; - font-family: Lato; - font-weight: 400; - font-style: italic; - src: url("https://assets.gradle.com/lato/fonts/lato-normal-italic/lato-normal-italic.woff2") format("woff2"), - url("https://assets.gradle.com/lato/fonts/lato-normal-italic/lato-normal-italic.woff") format("woff"); -} -/* Lato (bold, regular) */ -@font-face { - font-display: swap; - font-family: Lato; - font-weight: 500; - font-style: normal; - src: url("https://assets.gradle.com/lato/fonts/lato-semibold/lato-semibold.woff2") format("woff2"), - url("https://assets.gradle.com/lato/fonts/lato-semibold/lato-semibold.woff") format("woff"); -} -/* Lato (bold, regular) */ -@font-face { - font-display: swap; - font-family: Lato; - font-weight: 800; - font-style: normal; - src: url("https://assets.gradle.com/lato/fonts/lato-heavy/lato-heavy.woff2") format("woff2"), - url("https://assets.gradle.com/lato/fonts/lato-heavy/lato-heavy.woff") format("woff"); -} +/* SECTION 2 - Gradle style overrides */ body, body.center { background-image: none; color: #02303A; @@ -1155,9 +1174,6 @@ table a:hover, table a:link:active { } /* end anchors color change */ -.fixedNav { - background-color: white; -} .topNav, .bottomNav { margin: 55px 0 0 0; background-color: white; @@ -1208,15 +1224,3 @@ table a:hover, table a:link:active { position: absolute; width: 1px; } -/* Ensure the anchors line up properly */ -div.details a[name] { - padding-top: 187px; - margin-top: -187px; -} -/* Ensure the search reset button is correctly aligned */ -#reset { - background-size:10px; - width:13px; - height:13px; - top:-5px; -} \ No newline at end of file diff --git a/subprojects/docs/src/docs/design/gradle-module-metadata-1.0-specification.md b/subprojects/docs/src/docs/design/gradle-module-metadata-1.0-specification.md index 2908c522c1e35..618b18fe4f6df 100644 --- a/subprojects/docs/src/docs/design/gradle-module-metadata-1.0-specification.md +++ b/subprojects/docs/src/docs/design/gradle-module-metadata-1.0-specification.md @@ -101,7 +101,7 @@ This value must contain an array of 0 or more capabilities. Each capability is a This value must contain an object with the following values: -- `url`: The location of the metadata file that describes the variant. A string. In version 0.4, this must be a path relative to the module. +- `url`: The location of the metadata file that describes the variant. A string. In version 1.0, this must be a path relative to the module. - `group`: The group of the module. A string - `module`: The name of the module. A string - `version`: The version of the module. A string @@ -151,8 +151,8 @@ This value must contain an array with zero or more elements. Each element must b This value must contain an array with zero or more elements. Each element must be an object with the following values: -- `name`: The name of the file. A string. This will be used to calculate the name of the file in the cache. -- `url`: The location of the file. A string. In version 0.4, this must be a path relative to the module. +- `name`: The name of the file. A string. This will be used to calculate the identity of the file in the cache, which means it must be unique across variants for different files. +- `url`: The location of the file. A string. In version 1.0, this must be a path relative to the module. - `size`: The size of the file in bytes. A number. - `sha1`: The SHA1 hash of the file content. A hex string. - `md5`: The MD5 hash of the file content. A hex string. diff --git a/subprojects/docs/src/docs/dsl/org.gradle.api.Task.xml b/subprojects/docs/src/docs/dsl/org.gradle.api.Task.xml index 7c4fb42cd1d61..d4848c6a11e88 100644 --- a/subprojects/docs/src/docs/dsl/org.gradle.api.Task.xml +++ b/subprojects/docs/src/docs/dsl/org.gradle.api.Task.xml @@ -34,6 +34,9 @@ outputs + + localState + destroyables diff --git a/subprojects/docs/src/docs/js/javadoc/search.js b/subprojects/docs/src/docs/js/javadoc/search.js new file mode 100644 index 0000000000000..ad3d35b0162e3 --- /dev/null +++ b/subprojects/docs/src/docs/js/javadoc/search.js @@ -0,0 +1,329 @@ +/* + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +var noResult = {l: "No results found"}; +var catModules = "Modules"; +var catPackages = "Packages"; +var catTypes = "Types"; +var catMembers = "Members"; +var catSearchTags = "SearchTags"; +var highlight = "$&"; +var camelCaseRegexp = ""; +var secondaryMatcher = ""; +function getHighlightedText(item) { + var ccMatcher = new RegExp(camelCaseRegexp); + var label = item.replace(ccMatcher, highlight); + if (label === item) { + label = item.replace(secondaryMatcher, highlight); + } + return label; +} +function getURLPrefix(ui) { + var urlPrefix=""; + if (useModuleDirectories) { + var slash = "/"; + if (ui.item.category === catModules) { + return ui.item.l + slash; + } else if (ui.item.category === catPackages && ui.item.m) { + return ui.item.m + slash; + } else if ((ui.item.category === catTypes && ui.item.p) || ui.item.category === catMembers) { + $.each(packageSearchIndex, function(index, item) { + if (ui.item.p == item.l) { + urlPrefix = item.m + slash; + } + }); + return urlPrefix; + } else { + return urlPrefix; + } + } + return urlPrefix; +} +var watermark = 'Search'; +$(function() { + $("#search").val(''); + $("#search").prop("disabled", false); + $("#reset").prop("disabled", false); + $("#search").val(watermark).addClass('watermark'); + $("#search").blur(function() { + if ($(this).val().length == 0) { + $(this).val(watermark).addClass('watermark'); + } + }); + $("#search").on('click keydown', function() { + if ($(this).val() == watermark) { + $(this).val('').removeClass('watermark'); + } + }); + $("#reset").click(function() { + $("#search").val(''); + $("#search").focus(); + }); + // $("#search").focus(); + $("#search")[0].setSelectionRange(0, 0); +}); +$.widget("custom.catcomplete", $.ui.autocomplete, { + _create: function() { + this._super(); + this.widget().menu("option", "items", "> :not(.ui-autocomplete-category)"); + }, + _renderMenu: function(ul, items) { + var rMenu = this, + currentCategory = ""; + $.each(items, function(index, item) { + var li; + if (item.l !== noResult.l && item.category !== currentCategory) { + ul.append("
  • " + item.category + "
  • "); + currentCategory = item.category; + } + li = rMenu._renderItemData(ul, item); + if (item.category) { + li.attr("aria-label", item.category + " : " + item.l); + li.attr("class", "resultItem"); + } else { + li.attr("aria-label", item.l); + li.attr("class", "resultItem"); + } + }); + }, + _renderItem: function(ul, item) { + var label = ""; + if (item.category === catModules) { + label = getHighlightedText(item.l); + } else if (item.category === catPackages) { + label = (item.m) + ? getHighlightedText(item.m + "/" + item.l) + : getHighlightedText(item.l); + } else if (item.category === catTypes) { + label = (item.p) + ? getHighlightedText(item.p + "." + item.l) + : getHighlightedText(item.l); + } else if (item.category === catMembers) { + label = getHighlightedText(item.p + "." + (item.c + "." + item.l)); + } else if (item.category === catSearchTags) { + label = getHighlightedText(item.l); + } else { + label = item.l; + } + $li = $("
  • ").appendTo(ul); + if (item.category === catSearchTags) { + if (item.d) { + $("").attr("href", "#") + .html(label + " (" + item.h + ")
    " + + item.d + "
    ") + .appendTo($li); + } else { + $("
    ").attr("href", "#") + .html(label + " (" + item.h + ")") + .appendTo($li); + } + } else { + $("").attr("href", "#") + .html(label) + .appendTo($li); + } + return $li; + } +}); +$(function() { + $("#search").catcomplete({ + minLength: 1, + delay: 100, + source: function(request, response) { + var result = new Array(); + var presult = new Array(); + var tresult = new Array(); + var mresult = new Array(); + var tgresult = new Array(); + var secondaryresult = new Array(); + var displayCount = 0; + var exactMatcher = new RegExp("^" + $.ui.autocomplete.escapeRegex(request.term) + "$", "i"); + camelCaseRegexp = ($.ui.autocomplete.escapeRegex(request.term)).split(/(?=[A-Z])/).join("([a-z0-9_$]*?)"); + var camelCaseMatcher = new RegExp("^" + camelCaseRegexp); + secondaryMatcher = new RegExp($.ui.autocomplete.escapeRegex(request.term), "i"); + + // Return the nested innermost name from the specified object + function nestedName(e) { + return e.l.substring(e.l.lastIndexOf(".") + 1); + } + + function concatResults(a1, a2) { + a1 = a1.concat(a2); + a2.length = 0; + return a1; + } + + if (moduleSearchIndex) { + var mdleCount = 0; + $.each(moduleSearchIndex, function(index, item) { + item.category = catModules; + if (exactMatcher.test(item.l)) { + result.push(item); + mdleCount++; + } else if (camelCaseMatcher.test(item.l)) { + result.push(item); + } else if (secondaryMatcher.test(item.l)) { + secondaryresult.push(item); + } + }); + displayCount = mdleCount; + result = concatResults(result, secondaryresult); + } + if (packageSearchIndex) { + var pCount = 0; + var pkg = ""; + $.each(packageSearchIndex, function(index, item) { + item.category = catPackages; + pkg = (item.m) + ? (item.m + "/" + item.l) + : item.l; + if (exactMatcher.test(item.l)) { + presult.push(item); + pCount++; + } else if (camelCaseMatcher.test(pkg)) { + presult.push(item); + } else if (secondaryMatcher.test(pkg)) { + secondaryresult.push(item); + } + }); + result = result.concat(concatResults(presult, secondaryresult)); + displayCount = (pCount > displayCount) ? pCount : displayCount; + } + if (typeSearchIndex) { + var tCount = 0; + $.each(typeSearchIndex, function(index, item) { + item.category = catTypes; + var s = nestedName(item); + if (exactMatcher.test(s)) { + tresult.push(item); + tCount++; + } else if (camelCaseMatcher.test(s)) { + tresult.push(item); + } else if (secondaryMatcher.test(item.p + "." + item.l)) { + secondaryresult.push(item); + } + }); + result = result.concat(concatResults(tresult, secondaryresult)); + displayCount = (tCount > displayCount) ? tCount : displayCount; + } + if (memberSearchIndex) { + var mCount = 0; + $.each(memberSearchIndex, function(index, item) { + item.category = catMembers; + var s = nestedName(item); + if (exactMatcher.test(s)) { + mresult.push(item); + mCount++; + } else if (camelCaseMatcher.test(s)) { + mresult.push(item); + } else if (secondaryMatcher.test(item.c + "." + item.l)) { + secondaryresult.push(item); + } + }); + result = result.concat(concatResults(mresult, secondaryresult)); + displayCount = (mCount > displayCount) ? mCount : displayCount; + } + if (tagSearchIndex) { + var tgCount = 0; + $.each(tagSearchIndex, function(index, item) { + item.category = catSearchTags; + if (exactMatcher.test(item.l)) { + tgresult.push(item); + tgCount++; + } else if (secondaryMatcher.test(item.l)) { + secondaryresult.push(item); + } + }); + result = result.concat(concatResults(tgresult, secondaryresult)); + displayCount = (tgCount > displayCount) ? tgCount : displayCount; + } + displayCount = (displayCount > 500) ? displayCount : 500; + var counter = function() { + var count = {Modules: 0, Packages: 0, Types: 0, Members: 0, SearchTags: 0}; + var f = function(item) { + count[item.category] += 1; + return (count[item.category] <= displayCount); + }; + return f; + }(); + response(result.filter(counter)); + }, + response: function(event, ui) { + if (!ui.content.length) { + ui.content.push(noResult); + } else { + $("#search").empty(); + } + }, + autoFocus: true, + position: { + collision: "flip" + }, + select: function(event, ui) { + if (ui.item.l !== noResult.l) { + var url = getURLPrefix(ui); + if (ui.item.category === catModules) { + if (useModuleDirectories) { + url += "module-summary.html"; + } else { + url = ui.item.l + "-summary.html"; + } + } else if (ui.item.category === catPackages) { + if (ui.item.url) { + url = ui.item.url; + } else { + url += ui.item.l.replace(/\./g, '/') + "/package-summary.html"; + } + } else if (ui.item.category === catTypes) { + if (ui.item.url) { + url = ui.item.url; + } else if (ui.item.p === "") { + url += ui.item.l + ".html"; + } else { + url += ui.item.p.replace(/\./g, '/') + "/" + ui.item.l + ".html"; + } + } else if (ui.item.category === catMembers) { + if (ui.item.p === "") { + url += ui.item.c + ".html" + "#"; + } else { + url += ui.item.p.replace(/\./g, '/') + "/" + ui.item.c + ".html" + "#"; + } + if (ui.item.url) { + url += ui.item.url; + } else { + url += ui.item.l; + } + } else if (ui.item.category === catSearchTags) { + url += ui.item.u; + } + if (top !== window) { + parent.classFrame.location = pathtoroot + url; + } else { + window.location.href = pathtoroot + url; + } + } + } + }); +}); diff --git a/subprojects/docs/src/docs/userguide/custom_tasks.adoc b/subprojects/docs/src/docs/userguide/custom_tasks.adoc index 90e05cdee2f39..78304b2745383 100644 --- a/subprojects/docs/src/docs/userguide/custom_tasks.adoc +++ b/subprojects/docs/src/docs/userguide/custom_tasks.adoc @@ -150,23 +150,30 @@ If you need to use the old API, have a look at the documentation in the link:htt === Implementing an incremental task For a task to process inputs incrementally, that task must contain an _incremental task action_. -This is a task action method that contains a single link:{groovyDslPath}/org.gradle.work.InputChanges.html[InputChanges] parameter, which indicates to Gradle that the action will process the changed inputs only. -Moreover, the task needs to declare at least one incremental file input property, by using either `@link:{javadocPath}/org/gradle/work/Incremental.html[Incremental]` or `@link:{javadocPath}/org/gradle/api/tasks/SkipWhenEmpty.html[SkipWhenEmpty]`. +This is a task action method that has a single link:{groovyDslPath}/org.gradle.work.InputChanges.html[InputChanges] parameter. +That parameter tells Gradle that the action only wants to process the changed inputs. +In addition, the task needs to declare at least one incremental file input property by using either `@link:{javadocPath}/org/gradle/work/Incremental.html[Incremental]` or `@link:{javadocPath}/org/gradle/api/tasks/SkipWhenEmpty.html[SkipWhenEmpty]`. [IMPORTANT] ==== -To query incremental changes for an input file property, the getter of that property always needs to return the same instance. -The easiest way to accomplish this is to use `link:{javadocPath}/org/gradle/api/file/RegularFileProperty.html[RegularFileProperty]`, `link:{javadocPath}/org/gradle/api/file/DirectoryProperty.html[DirectoryProperty]` or `link:{javadocPath}/org/gradle/api/file/ConfigurableFileCollection.html[ConfigurableFileCollection]` as type of the property. -See also the chapter on <>, especially the sections about <> and <>. +To query incremental changes for an input file property, that property always needs to return the same instance. +The easiest way to accomplish this is to use one of the following types for such properties: `link:{javadocPath}/org/gradle/api/file/RegularFileProperty.html[RegularFileProperty]`, `link:{javadocPath}/org/gradle/api/file/DirectoryProperty.html[DirectoryProperty]` or `link:{javadocPath}/org/gradle/api/file/ConfigurableFileCollection.html[ConfigurableFileCollection]`. + +You can learn more about `RegularFileProperty` and `DirectoryProperty` in the <> chapter, especially the sections on <> and <>. ==== -The incremental task action can then query for file changes for an input file parameter via `link:{groovyDslPath}/org.gradle.work.InputChanges.html#org.gradle.work.InputChanges:getFileChanges(org.gradle.api.file.FileCollection)[InputChanges.getFileChanges]`. -The method returns an `Iterable` of `link:{javadocPath}/org/gradle/work/FileChange.html[FileChanges]`, which in turn can be queried for +The incremental task action can use `link:{groovyDslPath}/org.gradle.work.InputChanges.html#org.gradle.work.InputChanges:getFileChanges(org.gradle.api.file.FileCollection)[InputChanges.getFileChanges()]` to find out what files have changed for a given file-based input property, be it of type `RegularFileProperty`, `DirectoryProperty` or `ConfigurableFileCollection`. +The method returns an `Iterable` of type `link:{javadocPath}/org/gradle/work/FileChange.html[FileChanges]`, which in turn can be queried for the following: + +* the link:{javadocPath}/org/gradle/work/FileChange.html#getFile--[affected file] +* the link:{javadocPath}/org/gradle/work/FileChange.html#getChangeType--[change type] (`ADDED`, `REMOVED` or `MODIFIED`) +* the link:{javadocPath}/org/gradle/work/FileChange.html#getNormalizedPath--[normalized path] of the changed file +* the link:{javadocPath}/org/gradle/work/FileChange.html#getFileType--[file type] of the changed file -* the link:{javadocPath}/org/gradle/work/FileChange.html#getFile--[affected file], -* the link:{javadocPath}/org/gradle/work/FileChange.html#getChangeType--[change type] (`ADDED`, `REMOVED` or `MODIFIED`), -* the link:{javadocPath}/org/gradle/work/FileChange.html#getNormalizedPath--[normalized path] of the changed file, -* the link:{javadocPath}/org/gradle/work/FileChange.html#getFileType--[file type] of the changed file. +The following example demonstrates an incremental task that has a directory input. +It assumes that the directory contains a collection of text files and copies them to an output directory, reversing the text within each file. +The key things to note are the type of the `inputDir` property, its annotations, and how the action (`execute()`) uses `getFileChanges()` to process the subset of files that have actually changed since the last build. +You can also see how the action deletes a target file if the corresponding input file has been removed: [[taskDefinition]] .Defining an incremental task action @@ -177,48 +184,49 @@ include::sample[dir="userguide/tasks/incrementalTask/kotlin",files="build.gradle NOTE: The code for this example can be found at **`samples/userguide/tasks/incrementalTask`** in the ‘-all’ distribution of Gradle. -If for some reason the task is executed non-incrementally, e.g. by running with `--rerun-tasks`, all files are reported as `ADDED`, no matter of the previous state. -Gradle automatically removes the previous outputs, so the incremental task only needs to process the given files. +If for some reason the task is executed non-incrementally, for example by running with `--rerun-tasks`, all files are reported as `ADDED`, irrespective of the previous state. +In this case, Gradle automatically removes the previous outputs, so the incremental task only needs to process the given files. -For a simple transformer task like this, the task action simply needs to generate output files for any out-of-date inputs, and delete output files for any removed inputs. +For a simple transformer task like the above exmaple, the task action simply needs to generate output files for any out-of-date inputs and delete output files for any removed inputs. +[IMPORTANT] +==== A task may only contain a single incremental task action. +==== [[sec:which_inputs_are_considered_out_of_date]] === Which inputs are considered out of date? When there is a previous execution of the task, and the only changes since that execution are to incremental input file properties, then Gradle is able to determine which input files need to be processed (incremental execution). -In this case, the link:{groovyDslPath}/org.gradle.work.InputChanges.html#org.gradle.work.InputChanges:getFileChanges(org.gradle.api.file.FileCollection)[InputChanges.getFileChanges] method returns details for all input files for the given property that were _added_, _modified_ or _removed_. +In this case, the link:{groovyDslPath}/org.gradle.work.InputChanges.html#org.gradle.work.InputChanges:getFileChanges(org.gradle.api.file.FileCollection)[InputChanges.getFileChanges()] method returns details for all input files for the given property that were _added_, _modified_ or _removed_. However, there are many cases where Gradle is unable to determine which input files need to be processed (non-incremental execution). Examples include: * There is no history available from a previous execution. * You are building with a different version of Gradle. Currently, Gradle does not use task history from a different version. -* An `upToDateWhen` criteria added to the task returns `false`. +* An link:{javadocApi}/org/gradle/api/tasks/TaskOutputs.html#upToDateWhen-groovy.lang.Closure-[`upToDateWhen`] criterion added to the task returns `false`. * An input property has changed since the previous execution. * A non-incremental input file property has changed since the previous execution. * One or more output files have changed since the previous execution. -In any of these cases, Gradle will report all input files as `ADDED`. -The link:{groovyDslPath}/org.gradle.work.InputChanges.html#org.gradle.work.InputChanges:getFileChanges(org.gradle.api.file.FileCollection)[InputChanges.getFileChanges] method will return details for all files for the given input property. +In all of these cases, Gradle will report all input files as `ADDED` and the `getFileChanges()` method will return details for all the files that comprise the given input property. -You can check if Gradle was able to determine the incremental changes to input files with link:{groovyDslPath}/org.gradle.work.InputChanges.html#org.gradle.work.InputChanges.html##org.gradle.work.InputChanges:incremental[InputChanges.isIncremental()]. +You can check if the task execution is incremental or not with the link:{groovyDslPath}/org.gradle.work.InputChanges.html#org.gradle.work.InputChanges.html##org.gradle.work.InputChanges:incremental[InputChanges.isIncremental()] method. [[sec:an_incremental_task_in_action]] === An incremental task in action -Given the incremental task implementation <<#taskDefinition,above>>, we can explore the various change scenarios by example. -Note that the various mutation tasks ('updateInputs', 'removeInput', etc) are only present for demonstration purposes: these would not normally be part of your build script. +Given the example incremental task implementation <<#taskDefinition,above>>, let's walk through some scenarios based on it. -First, consider the `IncrementalReverseTask` executed against a set of inputs for the first time. -In this case, all inputs will be considered added: +First, consider an instance of `IncrementalReverseTask` that is executed against a set of inputs for the first time. +In this case, all inputs will be considered added, as shown here: +[[ex:incremental_task_definition]] .Running the incremental task for the first time ==== include::sample[dir="userguide/tasks/incrementalTask/groovy",files="build.gradle[tags=reverse]"] include::sample[dir="userguide/tasks/incrementalTask/kotlin",files="build.gradle.kts[tags=reverse]"] -==== .Build layout ---- @@ -235,70 +243,82 @@ include::sample[dir="userguide/tasks/incrementalTask/kotlin",files="build.gradle > gradle -q incrementalReverse include::{samplesPath}/userguide/tasks/incrementalTask/incrementalTaskFirstRun.out[] ---- +==== -Naturally when the task is executed again with no changes, then the entire task is up to date and no files are reported to the task action: - -=== Example: Running the incremental task with unchanged inputs +Naturally when the task is executed again with no changes, then the entire task is up to date and no files are reported to the task action (which is why there is no output): -.Output of **`gradle -q incrementalReverse`** +.Running the incremental task with unchanged inputs +==== +.Output of `gradle -q incrementalReverse` ---- > gradle -q incrementalReverse include::{samplesPath}/userguide/tasks/incrementalTask/incrementalTaskNoChange.out[] ---- +==== -When an input file is modified in some way or a new input file is added, then re-executing the task results in those files being returned by link:{groovyDslPath}/org.gradle.work.InputChanges.html#org.gradle.work.InputChanges:getFileChanges(org.gradle.api.file.FileCollection)[InputChanges.getFileChanges]: +When an input file is modified in some way or a new input file is added, then re-executing the task results in those files being returned by link:{groovyDslPath}/org.gradle.work.InputChanges.html#org.gradle.work.InputChanges:getFileChanges(org.gradle.api.file.FileCollection)[InputChanges.getFileChanges()]. +The following example modifies the content of one file and adds another before running the incremental task: .Running the incremental task with updated input files ==== include::sample[dir="userguide/tasks/incrementalTask/groovy",files="build.gradle[tags=updated-inputs]"] include::sample[dir="userguide/tasks/incrementalTask/kotlin",files="build.gradle.kts[tags=updated-inputs]"] -==== -.Output of **`gradle -q updateInputs incrementalReverse`** +.Output of `gradle -q updateInputs incrementalReverse` ---- > gradle -q updateInputs incrementalReverse include::{samplesPath}/userguide/tasks/incrementalTask/incrementalTaskUpdatedInputs.out[] ---- +==== + +NOTE: The various mutation tasks (`updateInputs`, `removeInput`, etc) are only present to demonstrate the behavior of incremental tasks. +They should not be viewed as the kinds of tasks or task implementations you should have in your own build scripts. -When an existing input file is removed, then re-executing the task results in that file being returned by link:{groovyDslPath}/org.gradle.work.InputChanges.html#org.gradle.work.InputChanges:getFileChanges(org.gradle.api.file.FileCollection)[InputChanges.getFileChanges] as `REMOVED`: +When an existing input file is removed, then re-executing the task results in that file being returned by link:{groovyDslPath}/org.gradle.work.InputChanges.html#org.gradle.work.InputChanges:getFileChanges(org.gradle.api.file.FileCollection)[InputChanges.getFileChanges()] as `REMOVED`. +The following example removes one of the existing files before executing the incremental task: .Running the incremental task with an input file removed ==== include::sample[dir="userguide/tasks/incrementalTask/groovy",files="build.gradle[tags=removed-input]"] include::sample[dir="userguide/tasks/incrementalTask/kotlin",files="build.gradle.kts[tags=removed-input]"] -==== -.Output of **`gradle -q removeInput incrementalReverse`** +.Output of `gradle -q removeInput incrementalReverse` ---- > gradle -q removeInput incrementalReverse include::{samplesPath}/userguide/tasks/incrementalTask/incrementalTaskRemovedInput.out[] ---- +==== -When an output file is deleted (or modified), then Gradle is unable to determine which input files are out of date. -In this case, details for _all_ input files for the given property are returned by link:{groovyDslPath}/org.gradle.work.InputChanges.html#org.gradle.work.InputChanges:getFileChanges(org.gradle.api.file.FileCollection)[InputChanges.getFileChanges]: +When an _output_ file is deleted (or modified), then Gradle is unable to determine which input files are out of date. +In this case, details for _all_ the input files for the given property are returned by link:{groovyDslPath}/org.gradle.work.InputChanges.html#org.gradle.work.InputChanges:getFileChanges(org.gradle.api.file.FileCollection)[InputChanges.getFileChanges()]. +The following example removes just one of the output files from the build directory, but notice how all the input files are considered to be `ADDED`: .Running the incremental task with an output file removed ==== include::sample[dir="userguide/tasks/incrementalTask/groovy",files="build.gradle[tags=removed-output]"] include::sample[dir="userguide/tasks/incrementalTask/kotlin",files="build.gradle.kts[tags=removed-output]"] -==== -.Output of **`gradle -q removeOutput incrementalReverse`** +.Output of `gradle -q removeOutput incrementalReverse` ---- > gradle -q removeOutput incrementalReverse include::{samplesPath}/userguide/tasks/incrementalTask/incrementalTaskRemovedOutput.out[] ---- +==== -When a task input property is modified, Gradle is unable to determine how this property impacted the task outputs, so the task is executed non-incrementally. -So similar to the changed output file example, details for _all_ input files for the given property are returned by link:{groovyDslPath}/org.gradle.work.InputChanges.html#org.gradle.work.InputChanges:getFileChanges(org.gradle.api.file.FileCollection)[InputChanges.getFileChanges]: - -=== Example: Running the incremental task with an input property changed +The last scenario we want to cover concerns what happens when a non-file-based input property is modified. +In such cases, Gradle is unable to determine how the property impacts the task outputs, so the task is executed non-incrementally. +This means that _all_ input files for the given property are returned by link:{groovyDslPath}/org.gradle.work.InputChanges.html#org.gradle.work.InputChanges:getFileChanges(org.gradle.api.file.FileCollection)[InputChanges.getFileChanges()] and they are all treated as `ADDED`. +The following example sets the project property `taskInputProperty` to a new value when running the `incrementalReverse` task and that project property is used to initialize the task's `inputProperty` property, as you can see in the <>. +Here's the output you can expect in this case: -.Output of **`gradle -q -PtaskInputProperty=changed incrementalReverse`** +.Running the incremental task with an input property changed +==== +.Output of `gradle -q -PtaskInputProperty=changed incrementalReverse` ---- > gradle -q -PtaskInputProperty=changed incrementalReverse include::{samplesPath}/userguide/tasks/incrementalTask/incrementalTaskChangedProperty.out[] ---- +==== [[sec:storing_incremental_task_state]] === Storing incremental state for cached tasks @@ -310,8 +330,8 @@ If such state files are <> of | [#skip-when-empty]`@link:{javadocPath}/org/gradle/api/tasks/SkipWhenEmpty.html[SkipWhenEmpty]` | `File`+++*+++ -| Used with `@InputFiles` or `@InputDirectory` to tell Gradle to skip the task if the corresponding files or directory are empty, along with all other input files declared with this annotation. Tasks that have been skipped due to all of their input files that were declared with this annotation being empty will result in a distinct “no source” outcome. For example, `NO-SOURCE` will be emitted in the console output. +| Used with `@InputFiles` or `@InputDirectory` to tell Gradle to skip the task if the corresponding files or directory are empty, along with all other input files declared with this annotation. Tasks that have been skipped due to all of their input files that were declared with this annotation being empty will result in a distinct “no source” outcome. For example, `NO-SOURCE` will be emitted in the console output. Implies `<<#incremental,@Incremental>>`. + +| [#incremental]`@link:{javadocPath}/org/gradle/work/Incremental.html[Incremental]` +| `Provider` or `FileCollection` +| Used with `@InputFiles` or `@InputDirectory` to instruct Gradle to track changes to the annotated file property, so the changes can be queried via `@link:{groovyDslPath}/org.gradle.work.InputChanges.html[InputChanges.getFileChanges()]`. Required for <>. | `@link:{javadocPath}/org/gradle/api/tasks/Optional.html[Optional]` | Any type diff --git a/subprojects/docs/src/docs/userguide/publishing_ivy.adoc b/subprojects/docs/src/docs/userguide/publishing_ivy.adoc index 6f31324f935c8..246510554e9fb 100644 --- a/subprojects/docs/src/docs/userguide/publishing_ivy.adoc +++ b/subprojects/docs/src/docs/userguide/publishing_ivy.adoc @@ -108,6 +108,31 @@ You can also add arbitrary XML to the descriptor file via link:{groovyDslPath}/o CAUTION: It is possible to modify the descriptor in such a way that it is no longer a valid Ivy module descriptor, so care must be taken when using this feature. +[[publishing_ivy:resolved_dependencies]] +=== Customizing dependencies versions + +By default, the set of dependencies and constraints that are added to the Ivy file will contain the versions _declared_ in the build file. +Sometimes it is desirable to publish the _resolved_ version instead. + +Example use cases: + +* A project uses dynamic versions for dependencies but prefers exposing the resolved version for a given release to its consumers. +* In combination with <>, you want to publish the locked versions. +* A project leverages the rich versions constraints of Gradle, which have a lossy conversion to Ivy. +Instead of relying on the conversion, it publishes the resolved versions. + +This is done by using the `versionMapping` DSL method which allows to configure the link:{javadocPath}/org/gradle/api/publish/VersionMappingStrategy.html[VersionMappingStrategy]: + +.Using resolved versions +==== +include::sample[dir="ivy-publish/descriptor-customization/groovy",files="build.gradle[tags=versions-resolved]"] +include::sample[dir="ivy-publish/descriptor-customization/kotlin",files="build.gradle.kts[tags=versions-resolved]"] +==== + +In the example above, Gradle will use the versions resolved on the `runtimeClasspath` for dependencies declared in `api`, which are mapped to the `compile` configuration of Ivy. +Gradle will also use the versions resolved on the `runtimeClasspath` for dependencies declared in `implementation`, which are mapped to the `runtime` configuration of Ivy. +`fromResolutionResult()` indicates that Gradle should use the default classpath of a variant and `runtimeClasspath` is the default classpath of `java-runtime`. + [[publishing_ivy:repositories]] == Repositories diff --git a/subprojects/docs/src/docs/userguide/publishing_overview.adoc b/subprojects/docs/src/docs/userguide/publishing_overview.adoc index bdbb87abff561..269a22be0e14f 100644 --- a/subprojects/docs/src/docs/userguide/publishing_overview.adoc +++ b/subprojects/docs/src/docs/userguide/publishing_overview.adoc @@ -43,7 +43,7 @@ Exactly what a publication contains depends on the type of repository it's being For example, a publication destined for a Maven repository includes one or more artifacts — typically built by the project — plus a POM file describing the primary artifact and its dependencies. The primary artifact is typically the project's production JAR and secondary artifacts might consist of "-sources" and "-javadoc" JARs. + -In addition, Maven publication supports <> of dependencies instead of _declared_ ones. +In addition, <> and <> publications support publishing _resolved_ versions of dependencies instead of _declared_ ones. [[publishing_overview:where]] Where to publish:: diff --git a/subprojects/docs/src/samples/ivy-publish/descriptor-customization/groovy/build.gradle b/subprojects/docs/src/samples/ivy-publish/descriptor-customization/groovy/build.gradle index cec0a51ae5760..f0caae05778bd 100644 --- a/subprojects/docs/src/samples/ivy-publish/descriptor-customization/groovy/build.gradle +++ b/subprojects/docs/src/samples/ivy-publish/descriptor-customization/groovy/build.gradle @@ -7,8 +7,10 @@ version = '1.0' publishing { // tag::customize-descriptor[] +// tag::versions-resolved[] publications { ivyCustom(IvyPublication) { +// end::versions-resolved[] descriptor { license { name = 'The Apache License, Version 2.0' @@ -23,8 +25,18 @@ publishing { homepage = 'http://www.example.com/library' } } +// tag::versions-resolved[] + versionMapping { + usage('java-api') { + fromResolutionOf('runtimeClasspath') + } + usage('java-runtime') { + fromResolutionResult() + } + } } } +// end::versions-resolved[] // end::customize-descriptor[] repositories { ivy { diff --git a/subprojects/docs/src/samples/ivy-publish/descriptor-customization/kotlin/build.gradle.kts b/subprojects/docs/src/samples/ivy-publish/descriptor-customization/kotlin/build.gradle.kts index 15d89eb57ebdf..ec5acc7b24c7b 100644 --- a/subprojects/docs/src/samples/ivy-publish/descriptor-customization/kotlin/build.gradle.kts +++ b/subprojects/docs/src/samples/ivy-publish/descriptor-customization/kotlin/build.gradle.kts @@ -6,9 +6,11 @@ group = "org.gradle.sample" version = "1.0" publishing { - // tag::customize-descriptor[] +// tag::customize-descriptor[] +// tag::versions-resolved[] publications { create("ivyCustom") { + // end::versions-resolved[] descriptor { license { name.set("The Apache License, Version 2.0") @@ -23,8 +25,18 @@ publishing { homepage.set("http://www.example.com/library") } } +// tag::versions-resolved[] + versionMapping { + usage("java-api") { + fromResolutionOf("runtimeClasspath") + } + usage("java-runtime") { + fromResolutionResult() + } + } } } +// end::versions-resolved[] // end::customize-descriptor[] repositories { ivy { diff --git a/subprojects/docs/src/samples/userguide/tasks/incrementalTask/incrementalTaskNoChange.out b/subprojects/docs/src/samples/userguide/tasks/incrementalTask/incrementalTaskNoChange.out index e69de29bb2d1d..ae2686bcf6baa 100644 --- a/subprojects/docs/src/samples/userguide/tasks/incrementalTask/incrementalTaskNoChange.out +++ b/subprojects/docs/src/samples/userguide/tasks/incrementalTask/incrementalTaskNoChange.out @@ -0,0 +1,4 @@ +> Task :incrementalReverse UP-TO-DATE + +BUILD SUCCESSFUL in 0s +1 actionable task: 1 up-to-date diff --git a/subprojects/docs/src/samples/userguide/tasks/incrementalTask/incrementalTaskNoChange.sample.conf b/subprojects/docs/src/samples/userguide/tasks/incrementalTask/incrementalTaskNoChange.sample.conf index f28267a74a7bf..b7e4513b7944a 100644 --- a/subprojects/docs/src/samples/userguide/tasks/incrementalTask/incrementalTaskNoChange.sample.conf +++ b/subprojects/docs/src/samples/userguide/tasks/incrementalTask/incrementalTaskNoChange.sample.conf @@ -11,7 +11,6 @@ commands: [{ execution-subdirectory: groovy executable: gradle args: incrementalReverse - flags: --quiet expected-output-file: incrementalTaskNoChange.out }, { execution-subdirectory: kotlin @@ -22,6 +21,5 @@ commands: [{ execution-subdirectory: kotlin executable: gradle args: incrementalReverse - flags: --quiet expected-output-file: incrementalTaskNoChange.out }] diff --git a/subprojects/internal-integ-testing/src/test/groovy/org/gradle/integtests/fixtures/timeout/JavaProcessStackTracesMonitorSpec.groovy b/subprojects/internal-integ-testing/src/test/groovy/org/gradle/integtests/fixtures/timeout/JavaProcessStackTracesMonitorSpec.groovy index e807efccf39ef..90e342c702c0e 100644 --- a/subprojects/internal-integ-testing/src/test/groovy/org/gradle/integtests/fixtures/timeout/JavaProcessStackTracesMonitorSpec.groovy +++ b/subprojects/internal-integ-testing/src/test/groovy/org/gradle/integtests/fixtures/timeout/JavaProcessStackTracesMonitorSpec.groovy @@ -35,7 +35,7 @@ class JavaProcessStackTracesMonitorSpec extends Specification { 2215 ? Sl 473:09 /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java -ea -Xmx384m -Dteamcity_logs=../logs/ -Dlog4j.configuration=file:../conf/teamcity-agent-log4j.xml -classpath /home/tcagent1/agent/lib/idea-settings.jar:/home/tcagent1/agent/lib/coverage-agent-common.jar:/home/tcagent1/agent/lib/coverage-report.jar:/home/tcagent1/agent/lib/log4j-1.2.12.jar:/home/tcagent1/agent/lib/commons-httpclient-3.1.jar:/home/tcagent1/agent/lib/log4j-1.2.12-json-layout-1.0.9.jar:/home/tcagent1/agent/lib/freemarker.jar:/home/tcagent1/agent/lib/launcher-api.jar:/home/tcagent1/agent/lib/commons-io-1.3.2.jar:/home/tcagent1/agent/lib/agent-openapi.jar:/home/tcagent1/agent/lib/slf4j-api-1.7.5.jar:/home/tcagent1/agent/lib/trove-3.0.3.jar:/home/tcagent1/agent/lib/processesTerminator.jar:/home/tcagent1/agent/lib/slf4j-log4j12-1.7.5.jar:/home/tcagent1/agent/lib/trove4j.jar:/home/tcagent1/agent/lib/common-impl.jar:/home/tcagent1/agent/lib/ehcache-1.6.0-patch.jar:/home/tcagent1/agent/lib/buildAgent-updates-applying.jar:/home/tcagent1/agent/lib/agent-upgrade.jar:/home/tcagent1/agent/lib/commons-beanutils-core.jar:/home/tcagent1/agent/lib/app-wrapper.jar:/home/tcagent1/agent/lib/ehcache-1.7.2.jar:/home/tcagent1/agent/lib/jdom.jar:/home/tcagent1/agent/lib/spring-scripting/spring-scripting-jruby.jar:/home/tcagent1/agent/lib/spring-scripting/spring-scripting-bsh.jar:/home/tcagent1/agent/lib/spring-scripting/spring-scripting-groovy.jar:/home/tcagent1/agent/lib/xstream-1.4.10-custom.jar:/home/tcagent1/agent/lib/common-runtime.jar:/home/tcagent1/agent/lib/gson.jar:/home/tcagent1/agent/lib/xmlrpc-2.0.1.jar:/home/tcagent1/agent/lib/jaxen-1.1.1.jar:/home/tcagent1/agent/lib/duplicator-util.jar:/home/tcagent1/agent/lib/nuget-utils.jar:/home/tcagent1/agent/lib/annotations.jar:/home/tcagent1/agent/lib/serviceMessages.jar:/home/tcagent1/agent/lib/util.jar:/home/tcagent1/agent/lib/patches-impl.jar:/home/tcagent1/agent/lib/xml-rpc-wrapper.jar:/home/tcagent1/agent/lib/inspections-util.jar:/home/tcagent1/agent/lib/common.jar:/home/tcagent1/agent/lib/messages.jar:/home/tcagent1/agent/lib/commons-logging.jar:/home/tcagent1/agent/lib/commons-collections-3.2.2.jar:/home/tcagent1/agent/lib/openapi.jar:/home/tcagent1/agent/lib/launcher.jar:/home/tcagent1/agent/lib/agent-launcher.jar:/home/tcagent1/agent/lib/xercesImpl.jar:/home/tcagent1/agent/lib/jdk-searcher.jar:/home/tcagent1/agent/lib/resources_en.jar:/home/tcagent1/agent/lib/agent-installer-ui.jar:/home/tcagent1/agent/lib/agent.jar:/home/tcagent1/agent/lib/xpp3-1.1.4c.jar:/home/tcagent1/agent/lib/runtime-util.jar:/home/tcagent1/agent/lib/server-logging.jar:/home/tcagent1/agent/lib/commons-compress-1.9.jar:/home/tcagent1/agent/lib/commons-codec.jar:/home/tcagent1/agent/lib/joda-time.jar:/home/tcagent1/agent/lib/spring.jar:/home/tcagent1/agent/lib/xz-1.5.jar:/home/tcagent1/agent/lib/patches.jar:/home/tcagent1/agent/lib/agent-configurator.jar:/home/tcagent1/agent/lib/cloud-shared.jar jetbrains.buildServer.agent.AgentMain -file ../conf/buildAgent.properties -launcher.version 51228 2477 ? Sl 2:12 /opt/files/jdk-linux/jdk-8u161-linux-x64.tar.gz/bin/java -Djava.security.manager=worker.org.gradle.process.internal.worker.child.BootstrapSecurityManager -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant -cp /home/tcagent1/.gradle/caches/4.9-20180607113442+0000/workerMain/gradle-worker.jar worker.org.gradle.process.internal.worker.GradleWorkerMain 'Gradle Worker Daemon 199\' 7367 pts/0 R+ 0:00 ps x -15818 ? Sl 2:15 /opt/jdk/oracle-jdk-8/bin/java -DintegTest.gradleHomeDir=/home/tcagent1/agent/work/668602365d1521fc/subprojects/test-kit/build/integ test -DintegTest.gradleUserHomeDir=/home/tcagent1/agent/work/668602365d1521fc/intTestHomeDir -DintegTest.toolingApiShadedJarDir=/home/tcagent1/agent/work/668602365d1521fc/subprojects/tooling-api/build/shaded-jar -Djava.security.manager=worker.org.gradle.process.internal.worker.child.BootstrapSecurityManager -Dorg.gradle.ci.agentCount=2 -Dorg.gradle.ci.agentNum=1 -Dorg.gradle.integtest.daemon.registry=/home/tcagent1/agent/work/668602365d1521fc/build/daemon -Dorg.gradle.integtest.executer=embedded -Dorg.gradle.integtest.mirrors.google=http://dev12.gradle.org:8081/artifactory/google -Dorg.gradle.integtest.mirrors.gradle=http://dev12.gradle.org:8081/artifactory/gradle-repo/ -Dorg.gradle.integtest.mirrors.jboss=http://dev12.gradle.org:8081/artifactory/jboss/ -Dorg.gradle.integtest.mirrors.jcenter=http://dev12.gradle.org:8081/artifactory/jcenter -Dorg.gradle.integtest.mirrors.lightbendmaven=http://dev12.gradle.org:8081/artifactory/typesafe-maven-releases -Dorg.gradle.integtest.mirrors.ligthbendivy -Dorg.gradle.integtest.mirrors.mavencentral=http://dev12.gradle.org:8081/artifactory/repo1 -Dorg.gradle.integtest.mirrors.restlet=http://dev12.gradle.org:8081/artifactory/restlet/ -Dorg.gradle.integtest.mirrors.springreleases=http://dev12.gradle.org:8081/artifactory/spring-releases/ -Dorg.gradle.integtest.mirrors.springsnapshots=http://dev12.gradle.org:8081/artifactory/spring-snapshots/ -Dorg.gradle.integtest.multiversion=default -Dorg.gradle.integtest.native.toolChains=default -Dorg.gradle.integtest.versions=latest -Dorg.gradle.native=false -Dorg.gradle.test.maxParallelForks=4 -XX:+HeapDumpOnOutOfMemoryError -Xmx512m -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant -ea -cp /home/tcagent1/.gradle/caches/4.9-20180607113442+0000/workerMain/gradle-worker.jar worker.org.gradle.process.internal.worker.GradleWorkerMain 'Gradle Test Executor 61\' +15818 ? Sl 2:15 /opt/jdk/oracle-jdk-8/bin/java -DintegTest.gradleHomeDir=/home/tcagent1/agent/work/668602365d1521fc/subprojects/test-kit/build/integ test -DintegTest.gradleUserHomeDir=/home/tcagent1/agent/work/668602365d1521fc/intTestHomeDir -DintegTest.toolingApiShadedJarDir=/home/tcagent1/agent/work/668602365d1521fc/subprojects/tooling-api/build/shaded-jar -Djava.security.manager=worker.org.gradle.process.internal.worker.child.BootstrapSecurityManager -Dorg.gradle.ci.agentCount=2 -Dorg.gradle.ci.agentNum=1 -Dorg.gradle.integtest.daemon.registry=/home/tcagent1/agent/work/668602365d1521fc/build/daemon -Dorg.gradle.integtest.executer=embedded -Dorg.gradle.integtest.multiversion=default -Dorg.gradle.integtest.native.toolChains=default -Dorg.gradle.integtest.versions=latest -Dorg.gradle.native=false -Dorg.gradle.test.maxParallelForks=4 -XX:+HeapDumpOnOutOfMemoryError -Xmx512m -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant -ea -cp /home/tcagent1/.gradle/caches/4.9-20180607113442+0000/workerMain/gradle-worker.jar worker.org.gradle.process.internal.worker.GradleWorkerMain 'Gradle Test Executor 61\' 24438 ? Sl 3:46 /opt/files/jdk-linux/jdk-8u161-linux-x64.tar.gz/bin/java -Dorg.gradle.daemon.idletimeout=120000 -Dorg.gradle.daemon.registry.base=/home/tcagent1/agent/work/668602365d1521fc/build/daemon -Dorg.gradle.native.dir=/home/tcagent1/agent/work/668602365d1521fc/intTestHomeDir/worker-1/native -Dorg.gradle.deprecation.trace=true -Djava.io.tmpdir=/home/tcagent1/agent/work/668602365d1521fc/subprojects/test-kit/build/tmp -Dfile.encoding=UTF-8 -Dorg.gradle.classloaderscope.strict=true -Dgradle.internal.noSearchUpwards=true -Dorg.gradle.internal.launcher.welcomeMessageEnabled=false -ea -ea -Xmx2g -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/home/tcagent1/agent/work/668602365d1521fc/intTestHomeDir/worker-1 -Dorg.gradle.appname=gradle -classpath /home/tcagent1/agent/work/668602365d1521fc/subprojects/test-kit/build/integ test/lib/gradle-launcher-4.9.jar org.gradle.launcher.GradleMain --init-script /home/tcagent1/agent/work/668602365d1521fc/subprojects/test-kit/build/tmp/test files/GradleRunnerConsoleInputEndUserIntegrationTest/can_capture_user_in..._provided/xkpwb/testKitDirInit.gradle --no-daemon --stacktrace --gradle-user-home /home/tcagent1/agent/work/668602365d1521fc/intTestHomeDir/worker-1 --warning-mode=all build 27347 pts/0 S 0:00 bash 32167 ? Ssl 8:50 /opt/files/jdk-linux/jdk-8u161-linux-x64.tar.gz/bin/java -XX:MaxPermSize=256m -XX:+HeapDumpOnOutOfMemoryError -Xmx2500m -Dfile.encoding=UTF-8 -Djava.io.tmpdir=/home/tcagent1/agent/temp/buildTmp -Duser.country=US -Duser.language=en -Duser.variant -cp /home/tcagent1/.gradle/wrapper/dists/gradle-4.9-20180607113442+0000-bin/6o1ijseqszb59y1oe4hyx3o6o/gradle-4.9-20180607113442+0000/lib/gradle-launcher-4.9.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 4.9-20180607113442+0000 @@ -70,8 +70,8 @@ usr\\bin\\mintty.exe -o AppID=GitForWindows.Bash -o RelaunchCommand="C:\\Program \\??\\C:\\Windows\\system32\\conhost.exe "472490228-68470907838922115481214932-363220106-1296027029-1014590852-1678361664 7824 "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.14.26428\\bin\\HostX64\\x86\\VCTIP.EXE" 11880 "C:\\Program Files\\Java\\jdk1.8\\bin\\java.exe" -XX:MaxPermSize=256m -XX:+HeapDumpOnOutOfMemoryError -Xmx2500m -Dfile.encoding=UTF-8 -Djava.io.tmpdir=C:\\tcagent1\\temp\\buildTmp -Duser.country=US -Duser.language=en -Duser.variant -cp C:\\Users\\tcagent1\\.gradle\\wrapper\\dists\\gradle-4.9-20180624235932+0000-bin\\8osj55b0zpcwza9pdf19suxvr\\gradle-4.9-20180624235932+0000\\lib\\gradle-launcher-4.9.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 4.9-20180624235932+0000 1368 -cmd /c C:\\tcagent1\\work\\668602365d1521fc\\gradlew.bat --init-script C:\\tcagent1\\plugins\\gradle-runner\\scripts\\init.gradle -PmaxParallelForks=4 -s --daemon --continue -I C:\\tcagent1\\work\\668602365d1521fc/gradle/init-scripts/build-scan.init.gradle.kts "-Djava7Home=C:\\Program Files\\Java\\jdk1.7" "-Djava9Home=C:\\Program Files\\Java\\jdk1.9" -Dorg.gradle.internal.tasks.createops --build-cache -Dgradle.cache.remote.url="https://e.grdev.net/cache/" -Dgradle.cache.remote.username="gradle" -Dgradle.cache.remote.password="Pw2^8w2PHN6JUCOTo7R3" "-PtestJavaHome=C:\\Program Files\\Java\\jdk1.8" -Dscan.tag.FunctionalTest -Dscan.value.coverageOs=windows -Dscan.value.coverageJvmVendor=oracle -Dscan.value.coverageJvmVersion=java8 -PteamCityUsername=TeamcityRestBot -PteamCityPassword=DxQyNUvR2Yx6P5z6 -PteamCityBuildId=13871238 -Dscan.tag.Check -Dscan.tag.BranchBuildAccept -Dorg.gradle.daemon=false clean buildCacheHttp:platformTest 4100 -"C:\\Program Files\\Java\\jdk1.8/bin/java.exe" -Xmx128m -Dfile.encoding=UTF-8 -XX:MaxPermSize=512m "-Djava.io.tmpdir=C:\\tcagent1\\temp\\buildTmp" "-Dorg.gradle.appname=gradlew" -classpath "C:\\tcagent1\\work\\668602365d1521fc\\\\gradle\\wrapper\\gradle-wrapper.jar" org.gradle.wrapper.GradleWrapperMain --init-script C:\\tcagent1\\plugins\\gradle-runner\\scripts\\init.gradle -PmaxParallelForks=4 -s --daemon --continue -I C:\\tcagent1\\work\\668602365d1521fc/gradle/init-scripts/build-scan.init.gradle.kts "-Djava7Home=C:\\Program Files\\Java\\jdk1.7" "-Djava9Home=C:\\Program Files\\Java\\jdk1.9" -Dorg.gradle.internal.tasks.createops --build-cache -Dgradle.cache.remote.url="https://e.grdev.net/cache/" -Dgradle.cache.remote.username="gradle" -Dgradle.cache.remote.password="Pw2^8w2PHN6JUCOTo7R3" "-PtestJavaHome=C:\\Program Files\\Java\\jdk1.8" -Dscan.tag.FunctionalTest -Dscan.value.coverageOs=windows -Dscan.value.coverageJvmVendor=oracle -Dscan.value.coverageJvmVersion=java8 -PteamCityUsername=TeamcityRestBot -PteamCityPassword=DxQyNUvR2Yx6P5z6 -PteamCityBuildId=13871238 -Dscan.tag.Check -Dscan.tag.BranchBuildAccept -Dorg.gradle.daemon=false clean buildCacheHttp:platformTest 3908 +cmd /c C:\\tcagent1\\work\\668602365d1521fc\\gradlew.bat --init-script C:\\tcagent1\\plugins\\gradle-runner\\scripts\\init.gradle -PmaxParallelForks=4 -s --daemon --continue "-Djava7Home=C:\\Program Files\\Java\\jdk1.7" "-Djava9Home=C:\\Program Files\\Java\\jdk1.9" -Dorg.gradle.internal.tasks.createops "-PtestJavaHome=C:\\Program Files\\Java\\jdk1.8" -Dorg.gradle.daemon=false clean buildCacheHttp:platformTest 4100 +"C:\\Program Files\\Java\\jdk1.8/bin/java.exe" -Xmx128m -Dfile.encoding=UTF-8 -XX:MaxPermSize=512m "-Djava.io.tmpdir=C:\\tcagent1\\temp\\buildTmp" "-Dorg.gradle.appname=gradlew" -classpath "C:\\tcagent1\\work\\668602365d1521fc\\\\gradle\\wrapper\\gradle-wrapper.jar" org.gradle.wrapper.GradleWrapperMain --init-script C:\\tcagent1\\plugins\\gradle-runner\\scripts\\init.gradle -PmaxParallelForks=4 -s --daemon --continue "-Djava7Home=C:\\Program Files\\Java\\jdk1.7" "-Djava9Home=C:\\Program Files\\Java\\jdk1.9" -Dorg.gradle.internal.tasks.createops "-PtestJavaHome=C:\\Program Files\\Java\\jdk1.8" -Dorg.gradle.daemon=false clean buildCacheHttp:platformTest 3908 ''' when: def suspiciousDaemons = new JavaProcessStackTracesMonitor.StdoutAndPatterns(output).getSuspiciousDaemons() diff --git a/subprojects/internal-testing/src/main/groovy/org/gradle/test/fixtures/file/TestFile.java b/subprojects/internal-testing/src/main/groovy/org/gradle/test/fixtures/file/TestFile.java index 26d5b55fe2e27..fde1cc0563794 100644 --- a/subprojects/internal-testing/src/main/groovy/org/gradle/test/fixtures/file/TestFile.java +++ b/subprojects/internal-testing/src/main/groovy/org/gradle/test/fixtures/file/TestFile.java @@ -27,6 +27,7 @@ import org.gradle.internal.hash.HashCode; import org.gradle.internal.hash.Hashing; import org.gradle.internal.hash.HashingOutputStream; +import org.gradle.internal.io.NullOutputStream; import org.gradle.internal.nativeintegration.filesystem.FileSystem; import org.gradle.internal.nativeintegration.services.NativeServices; import org.gradle.testing.internal.util.RetryUtil; @@ -476,6 +477,18 @@ public static HashCode md5(File file) { return hashingStream.hash(); } + public String getSha256Hash() { + // Sha256 is not part of core-services (i.e. no Hashing.sha256() available), hence we use plain Guava classes here. + com.google.common.hash.HashingOutputStream hashingStream = + new com.google.common.hash.HashingOutputStream(com.google.common.hash.Hashing.sha256(), NullOutputStream.INSTANCE); + try { + Files.copy(this.toPath(), hashingStream); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + return hashingStream.hash().toString(); + } + public void createLink(File target) { createLink(target.getAbsolutePath()); } diff --git a/subprojects/model-core/src/main/java/org/gradle/internal/reflect/ParameterValidationContext.java b/subprojects/model-core/src/main/java/org/gradle/internal/reflect/ParameterValidationContext.java index 5459d1b04a65b..4369acf2b189a 100644 --- a/subprojects/model-core/src/main/java/org/gradle/internal/reflect/ParameterValidationContext.java +++ b/subprojects/model-core/src/main/java/org/gradle/internal/reflect/ParameterValidationContext.java @@ -28,6 +28,10 @@ public void visitError(@Nullable String ownerPath, String propertyName, String m public void visitError(String message) { } + @Override + public void visitErrorStrict(@Nullable String ownerPath, String propertyName, String message) { + } + @Override public void visitErrorStrict(String message) { } @@ -44,7 +48,14 @@ public void visitErrorStrict(String message) { void visitError(String message); /** - * Visits a strict validation error. Strict errors are not ignored for tasks, whereas for backwards compatibility other errors are ignored (at runtime) or treated as warnings (at plugin build time). + * Visits a strict validation error associated with the given property. + * Strict errors are not ignored for tasks, whereas for backwards compatibility other errors are ignored (at runtime) or treated as warnings (at plugin build time). + */ + void visitErrorStrict(@Nullable String ownerPath, String propertyName, String message); + + /** + * Visits a strict validation error. + * Strict errors are not ignored for tasks, whereas for backwards compatibility other errors are ignored (at runtime) or treated as warnings (at plugin build time). */ void visitErrorStrict(String message); } diff --git a/subprojects/plugin-development/src/integTest/groovy/org/gradle/plugin/devel/tasks/ValidateTaskPropertiesIntegrationTest.groovy b/subprojects/plugin-development/src/integTest/groovy/org/gradle/plugin/devel/tasks/ValidateTaskPropertiesIntegrationTest.groovy index 931cf4530d666..281bfa758a5bf 100644 --- a/subprojects/plugin-development/src/integTest/groovy/org/gradle/plugin/devel/tasks/ValidateTaskPropertiesIntegrationTest.groovy +++ b/subprojects/plugin-development/src/integTest/groovy/org/gradle/plugin/devel/tasks/ValidateTaskPropertiesIntegrationTest.groovy @@ -703,8 +703,10 @@ class ValidateTaskPropertiesIntegrationTest extends AbstractIntegrationSpec { def "can validate properties of an artifact transform parameters object"() { file("src/main/java/MyTransformParameters.java") << """ import org.gradle.api.*; + import org.gradle.api.file.*; import org.gradle.api.tasks.*; import org.gradle.api.artifacts.transform.*; + import org.gradle.work.*; import java.io.*; public interface MyTransformParameters extends TransformParameters { @@ -720,7 +722,23 @@ class ValidateTaskPropertiesIntegrationTest extends AbstractIntegrationSpec { // Valid because it is annotated @InputFile - File getGoodInput(); + File getGoodFileInput(); + + // Valid + @Incremental + @InputFiles + FileCollection getGoodIncrementalInput(); + + // Valid + @Input + String getGoodInput(); + void setGoodInput(String value); + + // Invalid because only file inputs can be incremental + @Incremental + @Input + String getIncrementalNonFileInput(); + void setIncrementalNonFileInput(String value); // Invalid because it has no annotation long getBadTime(); @@ -739,11 +757,13 @@ class ValidateTaskPropertiesIntegrationTest extends AbstractIntegrationSpec { fails "validateTaskProperties" failure.assertHasCause "Task property validation failed" failure.assertHasCause "Error: Type 'MyTransformParameters': property 'badTime' is not annotated with an input annotation." + failure.assertHasCause "Error: Type 'MyTransformParameters': property 'incrementalNonFileInput' has @Incremental annotation used on an @Input property." failure.assertHasCause "Error: Type 'MyTransformParameters': property 'inputFile' is annotated with unsupported annotation @InputArtifact." failure.assertHasCause "Error: Type 'MyTransformParameters': property 'oldThing' is not annotated with an input annotation." file("build/reports/task-properties/report.txt").text == """ Error: Type 'MyTransformParameters': property 'badTime' is not annotated with an input annotation. + Error: Type 'MyTransformParameters': property 'incrementalNonFileInput' has @Incremental annotation used on an @Input property. Error: Type 'MyTransformParameters': property 'inputFile' is annotated with unsupported annotation @InputArtifact. Error: Type 'MyTransformParameters': property 'oldThing' is not annotated with an input annotation. """.stripIndent().trim()