From 7fadcc969951c6fa733bf6a7c3a5d89afef41074 Mon Sep 17 00:00:00 2001 From: Cedric Champeau Date: Mon, 1 Apr 2019 16:04:11 +0200 Subject: [PATCH 01/30] Make sure we don't accidentally use http repositories --- build.gradle.kts | 1 + .../kotlin/gradlebuild/security.gradle.kts | 48 +++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 buildSrc/subprojects/plugins/src/main/kotlin/gradlebuild/security.gradle.kts 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..19f00403ae31b --- /dev/null +++ b/buildSrc/subprojects/plugins/src/main/kotlin/gradlebuild/security.gradle.kts @@ -0,0 +1,48 @@ +/* + * 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 + +val allowedSchemes = setOf("https") +val insecureRepos = mutableSetOf() + +allprojects { + configurations.all { + incoming.beforeResolve { + repositories.forEach { + if (it is MavenArtifactRepository) { + checkURLs(it, setOf(it.url)) + checkURLs(it, it.artifactUrls) + } else if (it is IvyArtifactRepository) { + checkURLs(it, setOf(it.url)) + } + } + } + } +} + +gradle.buildFinished { + if (!insecureRepos.isEmpty()) { + throw GradleException("This build used insecure repositories:\n" + insecureRepos.joinToString("\n") + "Make sure to use HTTPS") + } +} + +fun checkURLs(repository: ArtifactRepository, uris: Collection) = uris.forEach { + if (it.scheme.toLowerCase() !in allowedSchemes) { + insecureRepos.add(" Insecure repository '${repository.name}': $it") + } +} From 38beaf8437b7947610818bf549f55fc65b8115b3 Mon Sep 17 00:00:00 2001 From: Cedric Champeau Date: Mon, 1 Apr 2019 16:11:36 +0200 Subject: [PATCH 02/30] Also check publishing repositories --- .../kotlin/gradlebuild/security.gradle.kts | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/buildSrc/subprojects/plugins/src/main/kotlin/gradlebuild/security.gradle.kts b/buildSrc/subprojects/plugins/src/main/kotlin/gradlebuild/security.gradle.kts index 19f00403ae31b..ba982ef0014db 100644 --- a/buildSrc/subprojects/plugins/src/main/kotlin/gradlebuild/security.gradle.kts +++ b/buildSrc/subprojects/plugins/src/main/kotlin/gradlebuild/security.gradle.kts @@ -23,14 +23,12 @@ val insecureRepos = mutableSetOf() allprojects { configurations.all { incoming.beforeResolve { - repositories.forEach { - if (it is MavenArtifactRepository) { - checkURLs(it, setOf(it.url)) - checkURLs(it, it.artifactUrls) - } else if (it is IvyArtifactRepository) { - checkURLs(it, setOf(it.url)) - } - } + repositories.checkRepositories() + } + } + afterEvaluate { + extensions.findByType(PublishingExtension::class.java)?.run { + repositories.checkRepositories() } } } @@ -41,6 +39,15 @@ gradle.buildFinished { } } +fun RepositoryHandler.checkRepositories() = forEach { + if (it is MavenArtifactRepository) { + checkURLs(it, setOf(it.url)) + checkURLs(it, it.artifactUrls) + } else if (it is IvyArtifactRepository) { + checkURLs(it, setOf(it.url)) + } +} + fun checkURLs(repository: ArtifactRepository, uris: Collection) = uris.forEach { if (it.scheme.toLowerCase() !in allowedSchemes) { insecureRepos.add(" Insecure repository '${repository.name}': $it") From 317142aab7351ee69f84954a50b43cb9c0e68290 Mon Sep 17 00:00:00 2001 From: Cedric Champeau Date: Mon, 1 Apr 2019 16:53:09 +0200 Subject: [PATCH 03/30] Fix formatting --- .../plugins/src/main/kotlin/gradlebuild/security.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildSrc/subprojects/plugins/src/main/kotlin/gradlebuild/security.gradle.kts b/buildSrc/subprojects/plugins/src/main/kotlin/gradlebuild/security.gradle.kts index ba982ef0014db..0669c1938b837 100644 --- a/buildSrc/subprojects/plugins/src/main/kotlin/gradlebuild/security.gradle.kts +++ b/buildSrc/subprojects/plugins/src/main/kotlin/gradlebuild/security.gradle.kts @@ -35,7 +35,7 @@ allprojects { gradle.buildFinished { if (!insecureRepos.isEmpty()) { - throw GradleException("This build used insecure repositories:\n" + insecureRepos.joinToString("\n") + "Make sure to use HTTPS") + throw GradleException("This build used insecure repositories:\n" + insecureRepos.joinToString("\n") + "\nMake sure to use HTTPS") } } From c216f04b7c00c9a418d0e5b301449538e46e58c9 Mon Sep 17 00:00:00 2001 From: Cedric Champeau Date: Tue, 2 Apr 2019 15:04:18 +0200 Subject: [PATCH 04/30] Improve reporting of repository declaration --- .../kotlin/gradlebuild/security.gradle.kts | 52 +++++++++++++++---- 1 file changed, 42 insertions(+), 10 deletions(-) diff --git a/buildSrc/subprojects/plugins/src/main/kotlin/gradlebuild/security.gradle.kts b/buildSrc/subprojects/plugins/src/main/kotlin/gradlebuild/security.gradle.kts index 0669c1938b837..af469581165ba 100644 --- a/buildSrc/subprojects/plugins/src/main/kotlin/gradlebuild/security.gradle.kts +++ b/buildSrc/subprojects/plugins/src/main/kotlin/gradlebuild/security.gradle.kts @@ -18,38 +18,70 @@ package gradlebuild import java.net.URI val allowedSchemes = setOf("https") -val insecureRepos = 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() + repositories.checkRepositories(project) } } afterEvaluate { extensions.findByType(PublishingExtension::class.java)?.run { - repositories.checkRepositories() + repositories.checkRepositories(project) } } } gradle.buildFinished { if (!insecureRepos.isEmpty()) { - throw GradleException("This build used insecure repositories:\n" + insecureRepos.joinToString("\n") + "\nMake sure to use HTTPS") + 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() = forEach { +fun RepositoryHandler.checkRepositories(project: Project) = forEach { if (it is MavenArtifactRepository) { - checkURLs(it, setOf(it.url)) - checkURLs(it, it.artifactUrls) + checkURLs(project, it, setOf(it.url)) + checkURLs(project, it, it.artifactUrls) } else if (it is IvyArtifactRepository) { - checkURLs(it, setOf(it.url)) + checkURLs(project, it, setOf(it.url)) } } -fun checkURLs(repository: ArtifactRepository, uris: Collection) = uris.forEach { +fun checkURLs(project: Project, repository: ArtifactRepository, uris: Collection) = uris.forEach { if (it.scheme.toLowerCase() !in allowedSchemes) { - insecureRepos.add(" Insecure repository '${repository.name}': $it") + 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")) From 002cc873adc51538b75b25c99c10c53e0ffb4b56 Mon Sep 17 00:00:00 2001 From: Donat Csikos Date: Wed, 3 Apr 2019 16:30:38 +0200 Subject: [PATCH 05/30] Validate distribution jar files --- .../gradle/DistributionIntegritySpec.groovy | 220 ++++++++++++++++++ 1 file changed, 220 insertions(+) create mode 100644 subprojects/distributions/src/integTest/groovy/org/gradle/DistributionIntegritySpec.groovy 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..9c235ba5581e8 --- /dev/null +++ b/subprojects/distributions/src/integTest/groovy/org/gradle/DistributionIntegritySpec.groovy @@ -0,0 +1,220 @@ +/* + * 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 java.security.MessageDigest + +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 jar dependencies"() { + 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' : '919f0dfe192fb4e063e7dacadee7f8bb9a2672a9', + 'ant-1.9.13.jar' : '7aff87f91ffda6916751e39bb5688f0a53710ec4', + 'ant-launcher-1.9.13.jar' : '24cf1a899bb4b69373dc4cd000bb52a9f46c459d', + 'asm-7.0.jar' : 'd74d4ba0dee443f68fb2dcb7fcdb945a2cd89912', + 'asm-analysis-7.0.jar' : '4b310d20d6f1c6b7197a75f1b5d69f169bc8ac1f', + 'asm-commons-7.0.jar' : '478006d07b7c561ae3a92ddc1829bca81ae0cdd1', + 'asm-tree-7.0.jar' : '29bc62dcb85573af6e62e5b2d735ef65966c4180', + 'commons-compress-1.18.jar' : '1191f9f2bc0c47a8cce69193feb1ff0a8bcb37d5', + 'commons-io-2.6.jar' : '815893df5f31da2ece4040fe0a12fd44b577afaf', + 'commons-lang-2.6.jar' : '0ce1edb914c94ebc388f086c6827e8bdeec71ac2', + 'groovy-all-1.0-2.5.4.jar' : '11524aca7cdd69a736c22ca231a0eb7d7e4af7c6', + 'guava-26.0-android.jar' : 'ef69663836b339db335fde0df06fb3cd84e3742b', + 'jansi-1.17.1.jar' : 'e90caa31c9b8d748359450d7487f76b05549ae65', + 'javax.inject-1.jar' : '6975da39a7040257bd51d21a231b76c915872d38', + 'jcl-over-slf4j-1.7.25.jar' : 'f8c32b13ff142a513eeb5b6330b1588dcb2c0461', + 'jsr305-3.0.2.jar' : '25ea2e8b0c338a877313bd4672d3fe056ea78f0d', + 'jul-to-slf4j-1.7.25.jar' : '0af5364cd6679bfffb114f0dec8a157aaa283b76', + 'kotlin-reflect-1.3.21.jar' : 'd0d5ff2ac2ebd8a42697af41e20fc225a23c5d3b', + 'kotlin-sam-with-receiver-compiler-plugin-1.3.21.jar' : '8775cb948d1b3141b01522297f583c4938473fe8', + 'kotlin-script-runtime-1.3.21.jar' : '29363d474ee6fda354900636320a177c7286def9', + 'kotlin-stdlib-1.3.21.jar' : '4bcc2012b84840e19e1e28074284cac908be0295', + 'kotlin-stdlib-common-1.3.21.jar' : 'f30e4a9897913e53d778f564110bafa1fef46643', + 'kotlin-stdlib-jdk7-1.3.21.jar' : 'd207ce2c9bcf17dc8e51bab4dbfdac4d013e7138', + 'kotlin-stdlib-jdk8-1.3.21.jar' : 'd0634d54452abc421db494ad32dd215e6591c49f', + 'kotlinx-metadata-jvm-0.0.5.jar' : '314b06bf2b29d8205ac9a199da76fa627de1b0f5', + 'kryo-2.24.0.jar' : '0c6b206e80cfd97e66a1364003724491c757b92f', + 'log4j-over-slf4j-1.7.25.jar' : 'a87bb47468f47ee7aabbd54f93e133d4215769c3', + 'minlog-1.2.jar' : '59bfcd171d82f9981a5e242b9e840191f650e209', + 'native-platform-0.17.jar' : 'a36dcb015c813c7815315a4a0077d8c3d9cde117', + 'native-platform-freebsd-amd64-libcpp-0.17.jar' : '8ab2957d0b00ab9c93dc373e034f95a83bcf5496', + 'native-platform-freebsd-amd64-libstdcpp-0.17.jar' : '22610dd12007b9a58138e9da816744b492638322', + 'native-platform-freebsd-i386-libcpp-0.17.jar' : 'e0e555c98023ba2dba0c734ae1b2ab6eaffc9520', + 'native-platform-freebsd-i386-libstdcpp-0.17.jar' : '8cd139e8028941eec88afa846f3fdef777c2b4f3', + 'native-platform-linux-amd64-0.17.jar' : 'e7b11190423da33c2adf99f0af2108ff873a2857', + 'native-platform-linux-amd64-ncurses5-0.17.jar' : 'e045cb667f8bcd9eda334bd1894466635bf07d13', + 'native-platform-linux-amd64-ncurses6-0.17.jar' : '58ada06523b81864e64b5918ebed6178e2696ba5', + 'native-platform-linux-i386-0.17.jar' : 'b78e9c8ff6bb75df774511410fa2acdbb5272afa', + 'native-platform-linux-i386-ncurses5-0.17.jar' : '9bed7c6b8d341d15aaedf904851df1c9cb7f42d6', + 'native-platform-linux-i386-ncurses6-0.17.jar' : '4549a1b767711f5189e9e4bd88bed947b04f0868', + 'native-platform-osx-amd64-0.17.jar' : '0d5aff95ab809a893b4d4c17d37157cbd31e7c0c', + 'native-platform-windows-amd64-0.17.jar' : '0876c031ed6dba9f57e9aa75b58aa1331866babe', + 'native-platform-windows-amd64-min-0.17.jar' : 'e146903b7f5d82679b7e43783feacc2693cd29de', + 'native-platform-windows-i386-0.17.jar' : '4baf0469916f55af1d0a6ccb5cec6227dd0607bc', + 'native-platform-windows-i386-min-0.17.jar' : 'cd49c6a025d6cd452d97b57e92abdfa5fc938c81', + 'objenesis-2.6.jar' : '639033469776fd37c08358c6b92a4761feb2af4b', + 'plugins/aether-api-1.13.1.jar' : 'e48292eae5e14ec44978aa53debb1af7ddd6df93', + 'plugins/aether-connector-wagon-1.13.1.jar' : '4919bcf865d83a4529d92498d2079aee20bb2698', + 'plugins/aether-impl-1.13.1.jar' : 'ba2656934fa7c0f20c0c3882873dc705e16ae201', + 'plugins/aether-spi-1.13.1.jar' : 'c62b02d2a5a3939fded72039dd83e5b8ed42d45e', + 'plugins/aether-util-1.13.1.jar' : 'c8487ceb499b9ced96694731810acd1a70e13aca', + 'plugins/apiguardian-api-1.0.0.jar' : '3ef5276905e36f4d8055fe3cb0bdcc7503ffc85d', + 'plugins/asm-util-7.0.jar' : '18d4d07010c24405129a6dbb0e92057f8779fb9d', + 'plugins/aws-java-sdk-core-1.11.407.jar' : 'f4b641995bdfed7574d42973f18fc53f0b31748c', + 'plugins/aws-java-sdk-kms-1.11.407.jar' : '8781bc25d4957f915aaf8b041e2abf4a925dd5d8', + 'plugins/aws-java-sdk-s3-1.11.407.jar' : '9655501cf884d687fdecff6a0cf03955c6d7b59a', + 'plugins/bcpg-jdk15on-1.61.jar' : '422656435514ab8a28752b117d5d2646660a0ace', + 'plugins/bcprov-jdk15on-1.61.jar' : '00df4b474e71be02c1349c3292d98886f888d1f7', + 'plugins/biz.aQute.bndlib-4.0.0.jar' : '21e1d6fd1874d9bc201f2de1d0a48e84bff4149d', + 'plugins/bsh-2.0b6.jar' : 'fb418f9b33a0b951e9a2978b4b6ee93b2707e72f', + 'plugins/commons-codec-1.11.jar' : '3acb4705652e16236558f0f4f2192cc33c3bd189', + 'plugins/dd-plist-1.21.jar' : '4b8e4a6f35d39cd70b1c39d9c253233c4f0c7171', + 'plugins/google-api-client-1.25.0.jar' : 'e7ff725e89ff5dcbed107be1a24e8102ae2441ee', + 'plugins/google-api-services-storage-v1-rev136-1.25.0.jar' : '4fc59f4750f6fb96a77cdcd32a87c8f5fdbe7236', + 'plugins/google-http-client-1.25.0.jar' : '5fb16523c393bfe0210c29db44742bd308311841', + 'plugins/google-http-client-jackson2-1.25.0.jar' : '7c5c89bd4d0d34d9f1cb3396e8da6233e5074b5c', + 'plugins/google-oauth-client-1.25.0.jar' : 'c9ee14e8b095b4b301b28d57755cc482b8d6f39f', + 'plugins/gson-2.8.5.jar' : 'f645ed69d595b24d4cf8b3fbb64cc505bede8829', + 'plugins/hamcrest-core-1.3.jar' : '42a25dc3219429f0e5d060061f71acb49bf010a0', + 'plugins/httpclient-4.5.6.jar' : '1afe5621985efe90a92d0fbc9be86271efbe796f', + 'plugins/httpcore-4.4.10.jar' : 'acc54d9b28bdffe4bbde89ed2e4a1e86b5285e2b', + 'plugins/ion-java-1.0.2.jar' : 'ee9dacea7726e495f8352b81c12c23834ffbc564', + 'plugins/ivy-2.3.0.jar' : 'c5ebf1c253ad4959a29f4acfe696ee48cdd9f473', + 'plugins/jackson-annotations-2.9.8.jar' : 'ba7f0e6f8f1b28d251eeff2a5604bed34c53ff35', + 'plugins/jackson-core-2.9.8.jar' : '0f5a654e4675769c716e5b387830d19b501ca191', + 'plugins/jackson-databind-2.9.8.jar' : '11283f21cc480aa86c4df7a0a3243ec508372ed2', + 'plugins/jatl-0.2.3.jar' : '4074050ca38adc98920929362534e8d56b51ff7e', + 'plugins/jaxb-impl-2.3.1.jar' : 'a1a12b85ba1435b4189e065f7dafcc3fb9410d38', + 'plugins/jcifs-1.3.17.jar' : '1a2f0e28cc9497fb4927ea2422605fb8023969b6', + 'plugins/jcommander-1.72.jar' : '6375e521c1e11d6563d4f25a07ce124ccf8cd171', + 'plugins/jmespath-java-1.11.407.jar' : '9fb174ee5bb47dfd5cd34432e95630a06846f974', + 'plugins/joda-time-2.10.jar' : 'f66c8125d1057ffce6c4e29e624cac863e110e2b', + 'plugins/jsch-0.1.54.jar' : 'da3584329a263616e277e15462b387addd1b208d', + 'plugins/junit-4.12.jar' : '2973d150c0dc1fefe998f834810d68f278ea58ec', + 'plugins/junit-platform-commons-1.3.1.jar' : '67b7edddfac1935e6e6d9b58d7c7df6db59b1d39', + 'plugins/junit-platform-engine-1.3.1.jar' : '3ee68a06bbdab157dd260e2095c356481d6cd172', + 'plugins/junit-platform-launcher-1.3.1.jar' : '8a07cb776e5aeb320b051183dc8ff142650ddb4e', + 'plugins/jzlib-1.1.3.jar' : 'c01428efa717624f7aabf4df319939dda9646b2d', + 'plugins/maven-aether-provider-3.0.4.jar' : '80eaf6efa354082894adb29fb7db24313977c7f5', + 'plugins/maven-artifact-3.0.4.jar' : '990f82878d95fe79e99659f07ba5b472444fc72e', + 'plugins/maven-compat-3.0.4.jar' : '14d626e1e29a36f5f4629b689e964f8665707839', + 'plugins/maven-core-3.0.4.jar' : '4d60ad977827c011322928c4cedf021575fa39ec', + 'plugins/maven-model-3.0.4.jar' : '5e149cfe15daedebbb1e8970d6a5ff1bea61b94c', + 'plugins/maven-model-builder-3.0.4.jar' : '4f9c6ecf6d6de41933e82a122019117ea0741314', + 'plugins/maven-plugin-api-3.0.4.jar' : '1cd908e0aa67ad2d2b470c00c6db610db60b966b', + 'plugins/maven-repository-metadata-3.0.4.jar' : 'a5c737d02ab9365d272a1d0fc724420808ab4df8', + 'plugins/maven-settings-3.0.4.jar' : '09897b492f19f4a9a37c008c025691cd4a858cdc', + 'plugins/maven-settings-builder-3.0.4.jar' : '1c47e99b3cef4aed391f6c76aa073f3f7f25044b', + 'plugins/nekohtml-1.9.22.jar' : '4f54af68ecb345f2453fb6884672ad08414154e3', + 'plugins/opentest4j-1.1.1.jar' : 'efd9f971e91074491ea55b19f67b13470cf4fcdd', + 'plugins/org.eclipse.jgit-5.0.3.201809091024-r.jar' : '0afec2df3ff8835bc4d5c279d14fad0daae6dd93', + 'plugins/plexus-cipher-1.7.jar' : '51460409b6cdc2b828540c19c05691f89141edc2', + 'plugins/plexus-classworlds-2.5.1.jar' : '98fea8e8c3fb0e8670a69ad6ea445872c9972910', + 'plugins/plexus-component-annotations-1.5.5.jar' : 'c72f2660d0cbed24246ddb55d7fdc4f7374d2078', + 'plugins/plexus-container-default-1.7.1.jar' : 'c10eaacd916f4ae5f1741d04e5841e854d6f7a1e', + 'plugins/plexus-interpolation-1.14.jar' : 'c88dd864fe8b8256c25558ce7cd63be66ba07693', + 'plugins/plexus-sec-dispatcher-1.3.jar' : 'dedc02034fb8fcd7615d66593228cb71709134b4', + 'plugins/plexus-utils-3.1.0.jar' : '60eecb6f15abdb1c653ad80abaac6fe188b3feaa', + 'plugins/pmaven-common-0.8-20100325.jar' : 'f9b22bb94a326507a48fbe9a733882e972fbd31c', + 'plugins/pmaven-groovy-0.8-20100325.jar' : '23111ec4d6ba62882760d8a7c7c12bb3ffcd1f13', + 'plugins/rhino-1.7.10.jar' : '24650bd98b1041df2eb1be5cb64dd1ad5b2e7c55', + 'plugins/simple-4.1.21.jar' : '3464b9fb0221d1a2593894f93278b0129025b4ba', + 'plugins/snakeyaml-1.17.jar' : '7a27ea250c5130b2922b86dea63cbb1cc10a660c', + 'plugins/testng-6.3.1.jar' : '63749361a529df2ca9b1a90adc7cebeca9800e8c', + 'plugins/wagon-file-3.0.0.jar' : '8c2decb84fb1df443f3e21367ede355c90184749', + 'plugins/wagon-http-3.0.0.jar' : 'a4d96c5224b412b049cf8f99f88f5c1ccff8293e', + 'plugins/wagon-http-shared-3.0.0.jar' : 'b343bc92a74066bac02eb1d843b90e0943e6839d', + 'plugins/wagon-provider-api-3.0.0.jar' : 'f160b044ff0a4095170dc4dac75d69065b7c0a8d', + 'plugins/xbean-reflect-3.7.jar' : '6072a967ec936b3bb25b421d8eca07dd750219fd', + 'plugins/xercesImpl-2.12.0.jar' : 'f02c844149fd306601f20e0b34853a670bef7fa2', + 'slf4j-api-1.7.25.jar' : 'da76ca59f6a57ee3102f8f9bd9cee742973efa8a', + 'trove4j-1.0.20181211.jar' : '216c2e14b070f334479d800987affe4054cd563f', + 'xml-apis-1.4.01.jar' : '3789d9fada2d3d458c4ba2de349d48780f381ee3', + ] + + def libDir = unpackDistribution().file('lib') + def jars = collectJars(libDir) + def depJars = jars.collectEntries { [(libDir.relativePath(it)): it] }.findAll { String k, File v -> !k.startsWith('gradle-') && !k.startsWith("plugins/gradle-") && !excluded.contains(k) }.sort() + + 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 { jarPath, jar -> + def expected = expectedHashes[jarPath] + def actual = checksum(jar) + if (expected != actual) { + errors.add([jarPath, expected, actual]) + } + } + + !errors.findAll { error -> + System.err.println "Sha-1 mismatch for ${error[0]}: expected=${error[1]}, actual=${error[2]}" + true + } + } + + private def checksum(File file) { + // inline checksum implementation to stay independent from gradle/core + MessageDigest md = MessageDigest.getInstance("SHA-1") + file.eachByte 4096, { bytes, size -> + md.update(bytes, 0, size) + } + md.digest().collect { String.format "%02x", it }.join() + } + + private def collectJars(File file, Collection acc = []) { + if (file.name.endsWith('.jar')) { + acc.add(file) + } + if (file.isDirectory()) { + file.listFiles().each { f -> collectJars(f, acc) } + } + acc + } + + private def 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.sha1' | tr -d '"' | sed -e "s/\\(.*\\)/'\\1',/" """ + } + } +} From 8d48e3c6172a62a05bd60ad60eb7788b818a409c Mon Sep 17 00:00:00 2001 From: Daniel Lacasse Date: Thu, 4 Apr 2019 12:11:09 +0200 Subject: [PATCH 06/30] Update Gradle wrapper to include HTTPS changes --- gradle/wrapper/gradle-wrapper.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 5e8b9009c2c87..63f552106ad4c 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions-snapshots/gradle-5.4-20190329080509+0000-bin.zip +distributionUrl=https\://services.gradle.org/distributions-snapshots/gradle-5.4-20190404011421+0000-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From 94b853e4ef40750fc87e603a89428ecde9bb95bf Mon Sep 17 00:00:00 2001 From: Daniel Lacasse Date: Mon, 8 Apr 2019 10:02:22 +0200 Subject: [PATCH 07/30] Rebase Gradle build performance test --- subprojects/performance/templates.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subprojects/performance/templates.gradle b/subprojects/performance/templates.gradle index a84a4211b3793..8e4eb9b6c1b2f 100644 --- a/subprojects/performance/templates.gradle +++ b/subprojects/performance/templates.gradle @@ -27,7 +27,7 @@ tasks.register("gradleBuildBaseline", RemoteProject) { remoteUri = rootDir.absolutePath // Remember to update accordingly when rebasing/squashing // Do not use the "Rebase and merge" nor "Squash and merge" Github buttons when merging a PR that change the baseline - ref = 'c9913554c6032894bb4433789db2ee87a801123e' + ref = '8d48e3c6172a62a05bd60ad60eb7788b818a409c' } // === Java === From 3e8c0944ff7b4b230996aeedf3685694e60ef04e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=B3r=C3=A1nt=20Pint=C3=A9r?= Date: Wed, 3 Apr 2019 11:57:41 +0200 Subject: [PATCH 08/30] Sort validation errors --- .../java/org/gradle/api/internal/tasks/TaskPropertyUtils.java | 2 ++ .../api/internal/tasks/execution/ValidatingTaskExecuter.java | 2 ++ .../transform/DefaultTransformationRegistrationFactory.java | 2 +- .../api/internal/artifacts/transform/DefaultTransformer.java | 2 +- 4 files changed, 6 insertions(+), 2 deletions(-) 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..e39fd6736e02c 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() { 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/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()) ); } From f75f50b22c3841079a258811442284b1486f48bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=B3r=C3=A1nt=20Pint=C3=A9r?= Date: Wed, 3 Apr 2019 11:58:40 +0200 Subject: [PATCH 09/30] Remove unnecessary complexity --- .../tasks/properties/DefaultTypeMetadataStore.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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..d06885ed572fe 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) From e111a1411212cb84fb77624c776cd3631159019e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=B3r=C3=A1nt=20Pint=C3=A9r?= Date: Wed, 3 Apr 2019 11:59:54 +0200 Subject: [PATCH 10/30] Report @Incremental used on @Input properties --- .../api/internal/tasks/TaskPropertyUtils.java | 5 +++++ .../DefaultParameterValidationContext.java | 19 ++++++++++++---- .../properties/DefaultTypeMetadataStore.java | 10 +++++++++ .../properties/PropertyValidationAccess.java | 15 ++++++++++--- .../InputPropertyAnnotationHandler.java | 7 +++++- ...sformValuesInjectionIntegrationTest.groovy | 19 +++++++++++----- .../reflect/ParameterValidationContext.java | 13 ++++++++++- ...lidateTaskPropertiesIntegrationTest.groovy | 22 ++++++++++++++++++- 8 files changed, 95 insertions(+), 15 deletions(-) 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 e39fd6736e02c..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 @@ -113,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/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 d06885ed572fe..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 @@ -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/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() From df4ed676748deaad2cece904f1fc27a2a956f527 Mon Sep 17 00:00:00 2001 From: Cedric Champeau Date: Mon, 8 Apr 2019 10:11:19 +0200 Subject: [PATCH 11/30] Only check each repository once --- .../kotlin/gradlebuild/security.gradle.kts | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/buildSrc/subprojects/plugins/src/main/kotlin/gradlebuild/security.gradle.kts b/buildSrc/subprojects/plugins/src/main/kotlin/gradlebuild/security.gradle.kts index af469581165ba..45f653cafcfea 100644 --- a/buildSrc/subprojects/plugins/src/main/kotlin/gradlebuild/security.gradle.kts +++ b/buildSrc/subprojects/plugins/src/main/kotlin/gradlebuild/security.gradle.kts @@ -16,8 +16,12 @@ 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() @@ -68,11 +72,15 @@ gradle.buildFinished { } fun RepositoryHandler.checkRepositories(project: Project) = forEach { - 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)) + 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)) + } + } } } From 732111e1f549925530afb8993546cd4bb31f2d7a Mon Sep 17 00:00:00 2001 From: Cedric Champeau Date: Mon, 8 Apr 2019 10:56:04 +0200 Subject: [PATCH 12/30] Use the `StackWalker` API in order to avoid creation of an exception --- .../main/kotlin/gradlebuild/security.gradle.kts | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/buildSrc/subprojects/plugins/src/main/kotlin/gradlebuild/security.gradle.kts b/buildSrc/subprojects/plugins/src/main/kotlin/gradlebuild/security.gradle.kts index 45f653cafcfea..b9821f1df687a 100644 --- a/buildSrc/subprojects/plugins/src/main/kotlin/gradlebuild/security.gradle.kts +++ b/buildSrc/subprojects/plugins/src/main/kotlin/gradlebuild/security.gradle.kts @@ -20,16 +20,21 @@ import java.util.concurrent.locks.ReentrantLock import kotlin.concurrent.withLock val lock = ReentrantLock() +val stackWalker = StackWalker.getInstance()!! 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}") + // This check is just a sanity check since it is possible that we compile + // build scripts with Java 9+ and run the build with Java 8 in a performance test + if (JavaVersion.current().isJava9Compatible) { + repositories.whenObjectAdded { + stackWalker.walk { + it.filter { it.isBuildScript() }.findFirst().ifPresent { + repoToSource.put(this, "${it.fileName}:${it.lineNumber} in ${it.className}") + } } } } @@ -92,4 +97,4 @@ fun checkURLs(project: Project, repository: ArtifactRepository, uris: Collection 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")) +fun StackWalker.StackFrame.isBuildScript() = fileName != null && fileName != "security.gradle.kts" && (fileName.endsWith(".gradle") || fileName.endsWith(".gradle.kts")) From c8902b94e9d569c3b689551198251c8482b1828d Mon Sep 17 00:00:00 2001 From: Cedric Champeau Date: Mon, 8 Apr 2019 11:34:06 +0200 Subject: [PATCH 13/30] Revert "Use the `StackWalker` API in order to avoid creation of an exception" This reverts commit 732111e1f549925530afb8993546cd4bb31f2d7a. We have a weird setup where we need to execute Gradle on JDK 8, so we can't simply have scripts that depend on Java 9 APIs. --- .../main/kotlin/gradlebuild/security.gradle.kts | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/buildSrc/subprojects/plugins/src/main/kotlin/gradlebuild/security.gradle.kts b/buildSrc/subprojects/plugins/src/main/kotlin/gradlebuild/security.gradle.kts index b9821f1df687a..45f653cafcfea 100644 --- a/buildSrc/subprojects/plugins/src/main/kotlin/gradlebuild/security.gradle.kts +++ b/buildSrc/subprojects/plugins/src/main/kotlin/gradlebuild/security.gradle.kts @@ -20,21 +20,16 @@ import java.util.concurrent.locks.ReentrantLock import kotlin.concurrent.withLock val lock = ReentrantLock() -val stackWalker = StackWalker.getInstance()!! val allowedSchemes = setOf("https") val alreadyChecked = mutableSetOf() val insecureRepos = mutableSetOf() val repoToSource = mutableMapOf() allprojects { - // This check is just a sanity check since it is possible that we compile - // build scripts with Java 9+ and run the build with Java 8 in a performance test - if (JavaVersion.current().isJava9Compatible) { - repositories.whenObjectAdded { - stackWalker.walk { - it.filter { it.isBuildScript() }.findFirst().ifPresent { - repoToSource.put(this, "${it.fileName}:${it.lineNumber} in ${it.className}") - } + 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}") } } } @@ -97,4 +92,4 @@ fun checkURLs(project: Project, repository: ArtifactRepository, uris: Collection data class InsecureRepository(val projectPath: String, val repositoryName: String, val url: URI, val location: String?) -fun StackWalker.StackFrame.isBuildScript() = fileName != null && fileName != "security.gradle.kts" && (fileName.endsWith(".gradle") || fileName.endsWith(".gradle.kts")) +fun StackTraceElement.isBuildScript() = fileName != null && (fileName.endsWith(".gradle") || fileName.endsWith(".gradle.kts")) From 5738867000c3563163745c6f47be3f9895e7423b Mon Sep 17 00:00:00 2001 From: Daniel Lacasse Date: Mon, 8 Apr 2019 12:17:58 +0200 Subject: [PATCH 14/30] Move SHA1 hashing to `TestFile` and polish the test --- .../gradle/DistributionIntegritySpec.groovy | 27 +++++++------------ .../gradle/test/fixtures/file/TestFile.java | 15 +++++++++++ 2 files changed, 24 insertions(+), 18 deletions(-) diff --git a/subprojects/distributions/src/integTest/groovy/org/gradle/DistributionIntegritySpec.groovy b/subprojects/distributions/src/integTest/groovy/org/gradle/DistributionIntegritySpec.groovy index 9c235ba5581e8..3fa8fc964424a 100644 --- a/subprojects/distributions/src/integTest/groovy/org/gradle/DistributionIntegritySpec.groovy +++ b/subprojects/distributions/src/integTest/groovy/org/gradle/DistributionIntegritySpec.groovy @@ -16,7 +16,7 @@ package org.gradle -import java.security.MessageDigest +import org.gradle.test.fixtures.file.TestFile class DistributionIntegritySpec extends DistributionIntegrationSpec { @@ -30,7 +30,7 @@ class DistributionIntegritySpec extends DistributionIntegrationSpec { 'bin' } - def "Verify jar dependencies"() { + 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'] @@ -162,7 +162,7 @@ class DistributionIntegritySpec extends DistributionIntegrationSpec { def libDir = unpackDistribution().file('lib') def jars = collectJars(libDir) - def depJars = jars.collectEntries { [(libDir.relativePath(it)): it] }.findAll { String k, File v -> !k.startsWith('gradle-') && !k.startsWith("plugins/gradle-") && !excluded.contains(k) }.sort() + 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() @@ -175,30 +175,21 @@ class DistributionIntegritySpec extends DistributionIntegrationSpec { } def errors = [] - depJars.each { jarPath, jar -> + depJars.each { String jarPath, TestFile jar -> def expected = expectedHashes[jarPath] - def actual = checksum(jar) + def actual = jar.sha1Hash if (expected != actual) { - errors.add([jarPath, expected, actual]) + errors.add([path: jarPath, expectedHash: expected, actualHash: actual]) } } !errors.findAll { error -> - System.err.println "Sha-1 mismatch for ${error[0]}: expected=${error[1]}, actual=${error[2]}" + System.err.println "Sha-1 mismatch for ${error.path}: expected=${error.expectedHash}, actual=${error.actualHash}" true } } - private def checksum(File file) { - // inline checksum implementation to stay independent from gradle/core - MessageDigest md = MessageDigest.getInstance("SHA-1") - file.eachByte 4096, { bytes, size -> - md.update(bytes, 0, size) - } - md.digest().collect { String.format "%02x", it }.join() - } - - private def collectJars(File file, Collection acc = []) { + private static def collectJars(TestFile file, Collection acc = []) { if (file.name.endsWith('.jar')) { acc.add(file) } @@ -208,7 +199,7 @@ class DistributionIntegritySpec extends DistributionIntegrationSpec { acc } - private def printScript(depJars) { + 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" 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..fbd1155bc0d68 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,20 @@ public static HashCode md5(File file) { return hashingStream.hash(); } + public String getSha1Hash() { + return sha1(this).toString(); + } + + public static HashCode sha1(File file) { + HashingOutputStream hashingStream = new HashingOutputStream(Hashing.sha1(), NullOutputStream.INSTANCE); + try { + Files.copy(file.toPath(), hashingStream); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + return hashingStream.hash(); + } + public void createLink(File target) { createLink(target.getAbsolutePath()); } From 2ba34b41cfa769cd6ee024b5dd8ca8f1dd486d98 Mon Sep 17 00:00:00 2001 From: Louis Jacomet Date: Mon, 8 Apr 2019 10:26:46 +0200 Subject: [PATCH 15/30] Update publishing of resolved version doc This commit adds documentation for the Ivy part of publishing resolved version. Issue #8948 --- .../src/docs/userguide/publishing_ivy.adoc | 25 +++++++++++++++++++ .../docs/userguide/publishing_overview.adoc | 2 +- .../groovy/build.gradle | 12 +++++++++ .../kotlin/build.gradle.kts | 14 ++++++++++- 4 files changed, 51 insertions(+), 2 deletions(-) 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 { From ba3bb780270964fc832e12b725b6cc6861b5f8ee Mon Sep 17 00:00:00 2001 From: Louis Jacomet Date: Mon, 8 Apr 2019 10:38:28 +0200 Subject: [PATCH 16/30] Ivy publishing resolved versions Add mention in release notes. --- subprojects/docs/src/docs/release/notes.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/subprojects/docs/src/docs/release/notes.md b/subprojects/docs/src/docs/release/notes.md index 389d5505d2ce7..7521ded702fe4 100644 --- a/subprojects/docs/src/docs/release/notes.md +++ b/subprojects/docs/src/docs/release/notes.md @@ -13,7 +13,7 @@ Include only their name, impactful features should be called out separately belo [Ian Kerins](https://github.com/isker), [Roberto Perez Alcolea](https://github.com/rpalcolea), -[Rodolfo Forte](https://github.com/Tschis), +[Rodolfo Forte](https://github.com/Tschis) and [Stefan M.](https://github.com/StefMa). ## Upgrade Instructions @@ -68,6 +68,12 @@ Gradle now supports [Swift 5](https://swift.org/blog/swift-5-released/) official Specifying the source compatibility to Swift 5 instruct the compiler to expect Swift 5 compatible source files. Have a look at the [Swift samples](https://github.com/gradle/native-samples) to learn more about common use cases. + +## Ivy publication can expose resolved versions + +When using the [`ivy-publish` plugin](userguide/publishing_ivy.html), you can now opt-in to publish the _resolved_ dependency versions instead of the _declared_ ones. +For details, have a look at the [dedicated section](userguide/publishing_ivy.html#publishing_ivy:resolved_dependencies) in the plugin documentation. + ## Promoted features Promoted features are features that were incubating in previous versions of Gradle but are now supported and subject to backwards compatibility. See the User Manual section on the “[Feature Lifecycle](userguide/feature_lifecycle.html)” for more information. From 71b50a325ca159a049f7b983c8d428b70c24518c Mon Sep 17 00:00:00 2001 From: Peter Ledbrook Date: Mon, 8 Apr 2019 14:45:00 +0100 Subject: [PATCH 17/30] Clean up user manual section on incremental tasks --- .../docs/src/docs/userguide/custom_tasks.adoc | 110 +++++++++++------- 1 file changed, 65 insertions(+), 45 deletions(-) diff --git a/subprojects/docs/src/docs/userguide/custom_tasks.adoc b/subprojects/docs/src/docs/userguide/custom_tasks.adoc index 90e05cdee2f39..800836d7dec1c 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 < Date: Mon, 8 Apr 2019 17:48:19 +0200 Subject: [PATCH 18/30] Add output for up-to-date incremental build example --- .../tasks/incrementalTask/incrementalTaskNoChange.out | 4 ++++ .../tasks/incrementalTask/incrementalTaskNoChange.sample.conf | 2 -- 2 files changed, 4 insertions(+), 2 deletions(-) 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 }] From ca97588c42e96912fb5634f3a03c35cecd791c42 Mon Sep 17 00:00:00 2001 From: Stefan Wolf Date: Mon, 8 Apr 2019 18:29:15 +0200 Subject: [PATCH 19/30] Revert nullability changes to RelativePath The changes are breaking to users using the Kotlin DSL. This PR reverts the breaking changes from #8859. --- .../src/main/java/org/gradle/api/file/RelativePath.java | 2 -- 1 file changed, 2 deletions(-) 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: From 49f282ef1c18db7677adc2338fa3756c0305faa5 Mon Sep 17 00:00:00 2001 From: Stefan Wolf Date: Mon, 8 Apr 2019 19:15:45 +0200 Subject: [PATCH 20/30] Dissallow `@Incremental` on fields --- .../src/main/java/org/gradle/work/Incremental.java | 2 +- .../api/tasks/IncrementalInputsIntegrationTest.groovy | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/subprojects/core-api/src/main/java/org/gradle/work/Incremental.java b/subprojects/core-api/src/main/java/org/gradle/work/Incremental.java index c44b3688794cb..196c8da757da0 100644 --- a/subprojects/core-api/src/main/java/org/gradle/work/Incremental.java +++ b/subprojects/core-api/src/main/java/org/gradle/work/Incremental.java @@ -35,7 +35,7 @@ */ @Incubating @Retention(RetentionPolicy.RUNTIME) -@Target({ElementType.METHOD, ElementType.FIELD}) +@Target({ElementType.METHOD}) @Documented public @interface Incremental { } 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 From f1d9e6bb3ba784ac703d6ce049079697c7ecadcf Mon Sep 17 00:00:00 2001 From: Daniel Lacasse Date: Tue, 9 Apr 2019 09:12:55 +0200 Subject: [PATCH 21/30] Use HTTPS mirror in `JavaProcessStackTracesMonitorSpec` --- .../fixtures/timeout/JavaProcessStackTracesMonitorSpec.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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..365fbb1a5e539 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.mirrors.google=https://dev12.gradle.org:8081/artifactory/google -Dorg.gradle.integtest.mirrors.gradle=https://dev12.gradle.org:8081/artifactory/gradle-repo/ -Dorg.gradle.integtest.mirrors.jboss=https://dev12.gradle.org:8081/artifactory/jboss/ -Dorg.gradle.integtest.mirrors.jcenter=https://dev12.gradle.org:8081/artifactory/jcenter -Dorg.gradle.integtest.mirrors.lightbendmaven=https://dev12.gradle.org:8081/artifactory/typesafe-maven-releases -Dorg.gradle.integtest.mirrors.ligthbendivy -Dorg.gradle.integtest.mirrors.mavencentral=https://dev12.gradle.org:8081/artifactory/repo1 -Dorg.gradle.integtest.mirrors.restlet=https://dev12.gradle.org:8081/artifactory/restlet/ -Dorg.gradle.integtest.mirrors.springreleases=https://dev12.gradle.org:8081/artifactory/spring-releases/ -Dorg.gradle.integtest.mirrors.springsnapshots=https://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\' 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 From 70d5cec809419d7d877dc395d3d0dd8db987832c Mon Sep 17 00:00:00 2001 From: Daniel Lacasse Date: Tue, 9 Apr 2019 09:42:40 +0200 Subject: [PATCH 22/30] Remove repositories mirror and flags to avoid confusion --- .../timeout/JavaProcessStackTracesMonitorSpec.groovy | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 365fbb1a5e539..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=https://dev12.gradle.org:8081/artifactory/google -Dorg.gradle.integtest.mirrors.gradle=https://dev12.gradle.org:8081/artifactory/gradle-repo/ -Dorg.gradle.integtest.mirrors.jboss=https://dev12.gradle.org:8081/artifactory/jboss/ -Dorg.gradle.integtest.mirrors.jcenter=https://dev12.gradle.org:8081/artifactory/jcenter -Dorg.gradle.integtest.mirrors.lightbendmaven=https://dev12.gradle.org:8081/artifactory/typesafe-maven-releases -Dorg.gradle.integtest.mirrors.ligthbendivy -Dorg.gradle.integtest.mirrors.mavencentral=https://dev12.gradle.org:8081/artifactory/repo1 -Dorg.gradle.integtest.mirrors.restlet=https://dev12.gradle.org:8081/artifactory/restlet/ -Dorg.gradle.integtest.mirrors.springreleases=https://dev12.gradle.org:8081/artifactory/spring-releases/ -Dorg.gradle.integtest.mirrors.springsnapshots=https://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() From c73036a8e4d51aafae11e0af0fa2b950d557f8da Mon Sep 17 00:00:00 2001 From: Louis Jacomet Date: Thu, 21 Mar 2019 10:23:55 +0100 Subject: [PATCH 23/30] Correct version reference to use 1.0 --- .../docs/design/gradle-module-metadata-1.0-specification.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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..ccb2147926d69 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 @@ -152,7 +152,7 @@ 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. +- `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. From 8ac301a7d1caace0b34ed8964408c0afc86b79bc Mon Sep 17 00:00:00 2001 From: Louis Jacomet Date: Thu, 21 Mar 2019 10:41:10 +0100 Subject: [PATCH 24/30] Further specify variants.files.name --- .../src/docs/design/gradle-module-metadata-1.0-specification.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 ccb2147926d69..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 @@ -151,7 +151,7 @@ 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. +- `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. From 670039bc9aeba00bebc2937fb890fcfc2eabfd70 Mon Sep 17 00:00:00 2001 From: Stefan Wolf Date: Tue, 9 Apr 2019 11:41:00 +0200 Subject: [PATCH 25/30] More improvements for incremental task documentation - Add `@Incremental` in the input/output annotation table - Expose `localState` in the DSL docs - Add some links to local state in `custom_tasks.adoc` --- subprojects/docs/src/docs/dsl/org.gradle.api.Task.xml | 3 +++ subprojects/docs/src/docs/userguide/custom_tasks.adoc | 2 +- subprojects/docs/src/docs/userguide/more_about_tasks.adoc | 6 +++++- 3 files changed, 9 insertions(+), 2 deletions(-) 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/userguide/custom_tasks.adoc b/subprojects/docs/src/docs/userguide/custom_tasks.adoc index 800836d7dec1c..78304b2745383 100644 --- a/subprojects/docs/src/docs/userguide/custom_tasks.adoc +++ b/subprojects/docs/src/docs/userguide/custom_tasks.adoc @@ -331,7 +331,7 @@ This way when the task's results are loaded from cache, the next execution can a However, if the state files are non-relocatable, then they can't be shared via the build cache. Indeed, when the task is loaded from cache, any such state files must be cleaned up to prevent stale state from confusing the tool during the next execution. -Gradle can ensure such stale files are removed if they are declared via `task.localState.register()` or if a property is marked with the `@LocalState` annotation. +Gradle can ensure such stale files are removed if they are declared via `link:{javadocPath}/org/gradle/api/tasks/TaskLocalState.html#register-java.lang.Object++...++-[task.localState.register()]` or if a property is marked with the `@link:{javadocPath}/org/gradle/api/tasks/LocalState.html[LocalState]` annotation. [[sec:declaring_and_using_command_line_options]] == Declaring and Using Command Line Options diff --git a/subprojects/docs/src/docs/userguide/more_about_tasks.adoc b/subprojects/docs/src/docs/userguide/more_about_tasks.adoc index 2471cfd7fb5cd..f23aa2db1158f 100644 --- a/subprojects/docs/src/docs/userguide/more_about_tasks.adoc +++ b/subprojects/docs/src/docs/userguide/more_about_tasks.adoc @@ -649,7 +649,11 @@ Using a file tree turns <> 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 From 888690d0fcd3f9de6f5b181e25e547755d2e27f2 Mon Sep 17 00:00:00 2001 From: aalmiray Date: Tue, 9 Apr 2019 13:02:00 +0200 Subject: [PATCH 26/30] Update release features for 5.4 Signed-off-by: aalmiray --- subprojects/docs/src/docs/release/release-features.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/subprojects/docs/src/docs/release/release-features.txt b/subprojects/docs/src/docs/release/release-features.txt index fb463396b8d31..c8da2d76cb5f5 100644 --- a/subprojects/docs/src/docs/release/release-features.txt +++ b/subprojects/docs/src/docs/release/release-features.txt @@ -1 +1,3 @@ - - JDK12 support + - Run builds with JDK12 + - New API for Incremental Tasks + - Updates to native projects, including Swift 5 support From 7981bde26eca5d8ddc52a3a987dc3a97e6f0065a Mon Sep 17 00:00:00 2001 From: Donat Csikos Date: Tue, 9 Apr 2019 13:34:19 +0200 Subject: [PATCH 27/30] Use sha-256 hashing to validate distribution dependencies --- .../gradle/DistributionIntegritySpec.groovy | 250 +++++++++--------- .../gradle/test/fixtures/file/TestFile.java | 14 +- 2 files changed, 131 insertions(+), 133 deletions(-) diff --git a/subprojects/distributions/src/integTest/groovy/org/gradle/DistributionIntegritySpec.groovy b/subprojects/distributions/src/integTest/groovy/org/gradle/DistributionIntegritySpec.groovy index 3fa8fc964424a..3b9a61da7c5a9 100644 --- a/subprojects/distributions/src/integTest/groovy/org/gradle/DistributionIntegritySpec.groovy +++ b/subprojects/distributions/src/integTest/groovy/org/gradle/DistributionIntegritySpec.groovy @@ -36,128 +36,128 @@ class DistributionIntegritySpec extends DistributionIntegrationSpec { 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' : '919f0dfe192fb4e063e7dacadee7f8bb9a2672a9', - 'ant-1.9.13.jar' : '7aff87f91ffda6916751e39bb5688f0a53710ec4', - 'ant-launcher-1.9.13.jar' : '24cf1a899bb4b69373dc4cd000bb52a9f46c459d', - 'asm-7.0.jar' : 'd74d4ba0dee443f68fb2dcb7fcdb945a2cd89912', - 'asm-analysis-7.0.jar' : '4b310d20d6f1c6b7197a75f1b5d69f169bc8ac1f', - 'asm-commons-7.0.jar' : '478006d07b7c561ae3a92ddc1829bca81ae0cdd1', - 'asm-tree-7.0.jar' : '29bc62dcb85573af6e62e5b2d735ef65966c4180', - 'commons-compress-1.18.jar' : '1191f9f2bc0c47a8cce69193feb1ff0a8bcb37d5', - 'commons-io-2.6.jar' : '815893df5f31da2ece4040fe0a12fd44b577afaf', - 'commons-lang-2.6.jar' : '0ce1edb914c94ebc388f086c6827e8bdeec71ac2', - 'groovy-all-1.0-2.5.4.jar' : '11524aca7cdd69a736c22ca231a0eb7d7e4af7c6', - 'guava-26.0-android.jar' : 'ef69663836b339db335fde0df06fb3cd84e3742b', - 'jansi-1.17.1.jar' : 'e90caa31c9b8d748359450d7487f76b05549ae65', - 'javax.inject-1.jar' : '6975da39a7040257bd51d21a231b76c915872d38', - 'jcl-over-slf4j-1.7.25.jar' : 'f8c32b13ff142a513eeb5b6330b1588dcb2c0461', - 'jsr305-3.0.2.jar' : '25ea2e8b0c338a877313bd4672d3fe056ea78f0d', - 'jul-to-slf4j-1.7.25.jar' : '0af5364cd6679bfffb114f0dec8a157aaa283b76', - 'kotlin-reflect-1.3.21.jar' : 'd0d5ff2ac2ebd8a42697af41e20fc225a23c5d3b', - 'kotlin-sam-with-receiver-compiler-plugin-1.3.21.jar' : '8775cb948d1b3141b01522297f583c4938473fe8', - 'kotlin-script-runtime-1.3.21.jar' : '29363d474ee6fda354900636320a177c7286def9', - 'kotlin-stdlib-1.3.21.jar' : '4bcc2012b84840e19e1e28074284cac908be0295', - 'kotlin-stdlib-common-1.3.21.jar' : 'f30e4a9897913e53d778f564110bafa1fef46643', - 'kotlin-stdlib-jdk7-1.3.21.jar' : 'd207ce2c9bcf17dc8e51bab4dbfdac4d013e7138', - 'kotlin-stdlib-jdk8-1.3.21.jar' : 'd0634d54452abc421db494ad32dd215e6591c49f', - 'kotlinx-metadata-jvm-0.0.5.jar' : '314b06bf2b29d8205ac9a199da76fa627de1b0f5', - 'kryo-2.24.0.jar' : '0c6b206e80cfd97e66a1364003724491c757b92f', - 'log4j-over-slf4j-1.7.25.jar' : 'a87bb47468f47ee7aabbd54f93e133d4215769c3', - 'minlog-1.2.jar' : '59bfcd171d82f9981a5e242b9e840191f650e209', - 'native-platform-0.17.jar' : 'a36dcb015c813c7815315a4a0077d8c3d9cde117', - 'native-platform-freebsd-amd64-libcpp-0.17.jar' : '8ab2957d0b00ab9c93dc373e034f95a83bcf5496', - 'native-platform-freebsd-amd64-libstdcpp-0.17.jar' : '22610dd12007b9a58138e9da816744b492638322', - 'native-platform-freebsd-i386-libcpp-0.17.jar' : 'e0e555c98023ba2dba0c734ae1b2ab6eaffc9520', - 'native-platform-freebsd-i386-libstdcpp-0.17.jar' : '8cd139e8028941eec88afa846f3fdef777c2b4f3', - 'native-platform-linux-amd64-0.17.jar' : 'e7b11190423da33c2adf99f0af2108ff873a2857', - 'native-platform-linux-amd64-ncurses5-0.17.jar' : 'e045cb667f8bcd9eda334bd1894466635bf07d13', - 'native-platform-linux-amd64-ncurses6-0.17.jar' : '58ada06523b81864e64b5918ebed6178e2696ba5', - 'native-platform-linux-i386-0.17.jar' : 'b78e9c8ff6bb75df774511410fa2acdbb5272afa', - 'native-platform-linux-i386-ncurses5-0.17.jar' : '9bed7c6b8d341d15aaedf904851df1c9cb7f42d6', - 'native-platform-linux-i386-ncurses6-0.17.jar' : '4549a1b767711f5189e9e4bd88bed947b04f0868', - 'native-platform-osx-amd64-0.17.jar' : '0d5aff95ab809a893b4d4c17d37157cbd31e7c0c', - 'native-platform-windows-amd64-0.17.jar' : '0876c031ed6dba9f57e9aa75b58aa1331866babe', - 'native-platform-windows-amd64-min-0.17.jar' : 'e146903b7f5d82679b7e43783feacc2693cd29de', - 'native-platform-windows-i386-0.17.jar' : '4baf0469916f55af1d0a6ccb5cec6227dd0607bc', - 'native-platform-windows-i386-min-0.17.jar' : 'cd49c6a025d6cd452d97b57e92abdfa5fc938c81', - 'objenesis-2.6.jar' : '639033469776fd37c08358c6b92a4761feb2af4b', - 'plugins/aether-api-1.13.1.jar' : 'e48292eae5e14ec44978aa53debb1af7ddd6df93', - 'plugins/aether-connector-wagon-1.13.1.jar' : '4919bcf865d83a4529d92498d2079aee20bb2698', - 'plugins/aether-impl-1.13.1.jar' : 'ba2656934fa7c0f20c0c3882873dc705e16ae201', - 'plugins/aether-spi-1.13.1.jar' : 'c62b02d2a5a3939fded72039dd83e5b8ed42d45e', - 'plugins/aether-util-1.13.1.jar' : 'c8487ceb499b9ced96694731810acd1a70e13aca', - 'plugins/apiguardian-api-1.0.0.jar' : '3ef5276905e36f4d8055fe3cb0bdcc7503ffc85d', - 'plugins/asm-util-7.0.jar' : '18d4d07010c24405129a6dbb0e92057f8779fb9d', - 'plugins/aws-java-sdk-core-1.11.407.jar' : 'f4b641995bdfed7574d42973f18fc53f0b31748c', - 'plugins/aws-java-sdk-kms-1.11.407.jar' : '8781bc25d4957f915aaf8b041e2abf4a925dd5d8', - 'plugins/aws-java-sdk-s3-1.11.407.jar' : '9655501cf884d687fdecff6a0cf03955c6d7b59a', - 'plugins/bcpg-jdk15on-1.61.jar' : '422656435514ab8a28752b117d5d2646660a0ace', - 'plugins/bcprov-jdk15on-1.61.jar' : '00df4b474e71be02c1349c3292d98886f888d1f7', - 'plugins/biz.aQute.bndlib-4.0.0.jar' : '21e1d6fd1874d9bc201f2de1d0a48e84bff4149d', - 'plugins/bsh-2.0b6.jar' : 'fb418f9b33a0b951e9a2978b4b6ee93b2707e72f', - 'plugins/commons-codec-1.11.jar' : '3acb4705652e16236558f0f4f2192cc33c3bd189', - 'plugins/dd-plist-1.21.jar' : '4b8e4a6f35d39cd70b1c39d9c253233c4f0c7171', - 'plugins/google-api-client-1.25.0.jar' : 'e7ff725e89ff5dcbed107be1a24e8102ae2441ee', - 'plugins/google-api-services-storage-v1-rev136-1.25.0.jar' : '4fc59f4750f6fb96a77cdcd32a87c8f5fdbe7236', - 'plugins/google-http-client-1.25.0.jar' : '5fb16523c393bfe0210c29db44742bd308311841', - 'plugins/google-http-client-jackson2-1.25.0.jar' : '7c5c89bd4d0d34d9f1cb3396e8da6233e5074b5c', - 'plugins/google-oauth-client-1.25.0.jar' : 'c9ee14e8b095b4b301b28d57755cc482b8d6f39f', - 'plugins/gson-2.8.5.jar' : 'f645ed69d595b24d4cf8b3fbb64cc505bede8829', - 'plugins/hamcrest-core-1.3.jar' : '42a25dc3219429f0e5d060061f71acb49bf010a0', - 'plugins/httpclient-4.5.6.jar' : '1afe5621985efe90a92d0fbc9be86271efbe796f', - 'plugins/httpcore-4.4.10.jar' : 'acc54d9b28bdffe4bbde89ed2e4a1e86b5285e2b', - 'plugins/ion-java-1.0.2.jar' : 'ee9dacea7726e495f8352b81c12c23834ffbc564', - 'plugins/ivy-2.3.0.jar' : 'c5ebf1c253ad4959a29f4acfe696ee48cdd9f473', - 'plugins/jackson-annotations-2.9.8.jar' : 'ba7f0e6f8f1b28d251eeff2a5604bed34c53ff35', - 'plugins/jackson-core-2.9.8.jar' : '0f5a654e4675769c716e5b387830d19b501ca191', - 'plugins/jackson-databind-2.9.8.jar' : '11283f21cc480aa86c4df7a0a3243ec508372ed2', - 'plugins/jatl-0.2.3.jar' : '4074050ca38adc98920929362534e8d56b51ff7e', - 'plugins/jaxb-impl-2.3.1.jar' : 'a1a12b85ba1435b4189e065f7dafcc3fb9410d38', - 'plugins/jcifs-1.3.17.jar' : '1a2f0e28cc9497fb4927ea2422605fb8023969b6', - 'plugins/jcommander-1.72.jar' : '6375e521c1e11d6563d4f25a07ce124ccf8cd171', - 'plugins/jmespath-java-1.11.407.jar' : '9fb174ee5bb47dfd5cd34432e95630a06846f974', - 'plugins/joda-time-2.10.jar' : 'f66c8125d1057ffce6c4e29e624cac863e110e2b', - 'plugins/jsch-0.1.54.jar' : 'da3584329a263616e277e15462b387addd1b208d', - 'plugins/junit-4.12.jar' : '2973d150c0dc1fefe998f834810d68f278ea58ec', - 'plugins/junit-platform-commons-1.3.1.jar' : '67b7edddfac1935e6e6d9b58d7c7df6db59b1d39', - 'plugins/junit-platform-engine-1.3.1.jar' : '3ee68a06bbdab157dd260e2095c356481d6cd172', - 'plugins/junit-platform-launcher-1.3.1.jar' : '8a07cb776e5aeb320b051183dc8ff142650ddb4e', - 'plugins/jzlib-1.1.3.jar' : 'c01428efa717624f7aabf4df319939dda9646b2d', - 'plugins/maven-aether-provider-3.0.4.jar' : '80eaf6efa354082894adb29fb7db24313977c7f5', - 'plugins/maven-artifact-3.0.4.jar' : '990f82878d95fe79e99659f07ba5b472444fc72e', - 'plugins/maven-compat-3.0.4.jar' : '14d626e1e29a36f5f4629b689e964f8665707839', - 'plugins/maven-core-3.0.4.jar' : '4d60ad977827c011322928c4cedf021575fa39ec', - 'plugins/maven-model-3.0.4.jar' : '5e149cfe15daedebbb1e8970d6a5ff1bea61b94c', - 'plugins/maven-model-builder-3.0.4.jar' : '4f9c6ecf6d6de41933e82a122019117ea0741314', - 'plugins/maven-plugin-api-3.0.4.jar' : '1cd908e0aa67ad2d2b470c00c6db610db60b966b', - 'plugins/maven-repository-metadata-3.0.4.jar' : 'a5c737d02ab9365d272a1d0fc724420808ab4df8', - 'plugins/maven-settings-3.0.4.jar' : '09897b492f19f4a9a37c008c025691cd4a858cdc', - 'plugins/maven-settings-builder-3.0.4.jar' : '1c47e99b3cef4aed391f6c76aa073f3f7f25044b', - 'plugins/nekohtml-1.9.22.jar' : '4f54af68ecb345f2453fb6884672ad08414154e3', - 'plugins/opentest4j-1.1.1.jar' : 'efd9f971e91074491ea55b19f67b13470cf4fcdd', - 'plugins/org.eclipse.jgit-5.0.3.201809091024-r.jar' : '0afec2df3ff8835bc4d5c279d14fad0daae6dd93', - 'plugins/plexus-cipher-1.7.jar' : '51460409b6cdc2b828540c19c05691f89141edc2', - 'plugins/plexus-classworlds-2.5.1.jar' : '98fea8e8c3fb0e8670a69ad6ea445872c9972910', - 'plugins/plexus-component-annotations-1.5.5.jar' : 'c72f2660d0cbed24246ddb55d7fdc4f7374d2078', - 'plugins/plexus-container-default-1.7.1.jar' : 'c10eaacd916f4ae5f1741d04e5841e854d6f7a1e', - 'plugins/plexus-interpolation-1.14.jar' : 'c88dd864fe8b8256c25558ce7cd63be66ba07693', - 'plugins/plexus-sec-dispatcher-1.3.jar' : 'dedc02034fb8fcd7615d66593228cb71709134b4', - 'plugins/plexus-utils-3.1.0.jar' : '60eecb6f15abdb1c653ad80abaac6fe188b3feaa', - 'plugins/pmaven-common-0.8-20100325.jar' : 'f9b22bb94a326507a48fbe9a733882e972fbd31c', - 'plugins/pmaven-groovy-0.8-20100325.jar' : '23111ec4d6ba62882760d8a7c7c12bb3ffcd1f13', - 'plugins/rhino-1.7.10.jar' : '24650bd98b1041df2eb1be5cb64dd1ad5b2e7c55', - 'plugins/simple-4.1.21.jar' : '3464b9fb0221d1a2593894f93278b0129025b4ba', - 'plugins/snakeyaml-1.17.jar' : '7a27ea250c5130b2922b86dea63cbb1cc10a660c', - 'plugins/testng-6.3.1.jar' : '63749361a529df2ca9b1a90adc7cebeca9800e8c', - 'plugins/wagon-file-3.0.0.jar' : '8c2decb84fb1df443f3e21367ede355c90184749', - 'plugins/wagon-http-3.0.0.jar' : 'a4d96c5224b412b049cf8f99f88f5c1ccff8293e', - 'plugins/wagon-http-shared-3.0.0.jar' : 'b343bc92a74066bac02eb1d843b90e0943e6839d', - 'plugins/wagon-provider-api-3.0.0.jar' : 'f160b044ff0a4095170dc4dac75d69065b7c0a8d', - 'plugins/xbean-reflect-3.7.jar' : '6072a967ec936b3bb25b421d8eca07dd750219fd', - 'plugins/xercesImpl-2.12.0.jar' : 'f02c844149fd306601f20e0b34853a670bef7fa2', - 'slf4j-api-1.7.25.jar' : 'da76ca59f6a57ee3102f8f9bd9cee742973efa8a', - 'trove4j-1.0.20181211.jar' : '216c2e14b070f334479d800987affe4054cd563f', - 'xml-apis-1.4.01.jar' : '3789d9fada2d3d458c4ba2de349d48780f381ee3', + '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') @@ -177,14 +177,14 @@ class DistributionIntegritySpec extends DistributionIntegrationSpec { def errors = [] depJars.each { String jarPath, TestFile jar -> def expected = expectedHashes[jarPath] - def actual = jar.sha1Hash + def actual = jar.sha256Hash if (expected != actual) { errors.add([path: jarPath, expectedHash: expected, actualHash: actual]) } } !errors.findAll { error -> - System.err.println "Sha-1 mismatch for ${error.path}: expected=${error.expectedHash}, actual=${error.actualHash}" + System.err.println "Sha-256 hash does not match for ${error.path}: expected=${error.expectedHash}, actual=${error.actualHash}" true } } @@ -205,7 +205,7 @@ class DistributionIntegritySpec extends DistributionIntegrationSpec { 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.sha1' | tr -d '"' | sed -e "s/\\(.*\\)/'\\1',/" """ + 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/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 fbd1155bc0d68..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 @@ -477,18 +477,16 @@ public static HashCode md5(File file) { return hashingStream.hash(); } - public String getSha1Hash() { - return sha1(this).toString(); - } - - public static HashCode sha1(File file) { - HashingOutputStream hashingStream = new HashingOutputStream(Hashing.sha1(), NullOutputStream.INSTANCE); + 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(file.toPath(), hashingStream); + Files.copy(this.toPath(), hashingStream); } catch (IOException e) { throw new UncheckedIOException(e); } - return hashingStream.hash(); + return hashingStream.hash().toString(); } public void createLink(File target) { From 61bd4aee5bbebf84b4e94d462c82b5cb54e8b00f Mon Sep 17 00:00:00 2001 From: Stefan Wolf Date: Tue, 9 Apr 2019 15:41:02 +0200 Subject: [PATCH 28/30] Allow `@Incremental` on fields For consistency with the other input annotations. We should deprecate annotations on fields altogether. --- .../core-api/src/main/java/org/gradle/work/Incremental.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subprojects/core-api/src/main/java/org/gradle/work/Incremental.java b/subprojects/core-api/src/main/java/org/gradle/work/Incremental.java index 196c8da757da0..c44b3688794cb 100644 --- a/subprojects/core-api/src/main/java/org/gradle/work/Incremental.java +++ b/subprojects/core-api/src/main/java/org/gradle/work/Incremental.java @@ -35,7 +35,7 @@ */ @Incubating @Retention(RetentionPolicy.RUNTIME) -@Target({ElementType.METHOD}) +@Target({ElementType.METHOD, ElementType.FIELD}) @Documented public @interface Incremental { } From 4551f92ec9e5fb2bd9460e6b72c6e77b3f081fec Mon Sep 17 00:00:00 2001 From: Sterling Greene Date: Tue, 9 Apr 2019 15:37:28 -0400 Subject: [PATCH 29/30] Revert "Fix Javadoc anchors with new JDK 9 search bar" This reverts commit a126acd785bba67706ea4c9dcaa622f0c9fef351. --- subprojects/docs/src/docs/css/javadoc.css | 1314 +++++++++++---------- 1 file changed, 659 insertions(+), 655 deletions(-) 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 From efacce4b4916e5709f25141b61fc3ec594d3893d Mon Sep 17 00:00:00 2001 From: Sterling Greene Date: Tue, 9 Apr 2019 16:33:12 -0400 Subject: [PATCH 30/30] Fix javadoc search interfering with anchor links --- subprojects/docs/docs.gradle | 7 +- .../docs/src/docs/js/javadoc/search.js | 329 ++++++++++++++++++ 2 files changed, 334 insertions(+), 2 deletions(-) create mode 100644 subprojects/docs/src/docs/js/javadoc/search.js 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/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; + } + } + } + }); +});