mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-09-12 19:48:45 +01:00
Fix updateVerificationMetadata task to account for IDE tooling.
This commit is contained in:
committed by
Michelle Tang
parent
9e2be2796b
commit
c7ac7087f7
@@ -37,3 +37,49 @@ ktlint {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// The IDE's KotlinDslScriptsModel resolves the Groovy modules bundled with this Gradle distribution (via the
|
||||
// localGroovy() dependency that groovy-gradle-plugin adds) during sync. That resolution happens in the Tooling
|
||||
// API model-building phase, which no task graph -- and therefore no updateVerificationMetadata pass -- ever
|
||||
// reaches, so their checksums never get written and a fresh sync fails verification. This task resolves that
|
||||
// same module graph from a task so --write-verification-metadata can capture it.
|
||||
run {
|
||||
val syncGroovyTaskName = "syncGroovyVerification"
|
||||
|
||||
val syncTask = tasks.register(syncGroovyTaskName) {
|
||||
group = "Verification"
|
||||
description = "Resolves the Groovy modules bundled with this Gradle distribution so their checksums can be written to verification-metadata.xml. The IDE's KotlinDslScriptsModel resolves these (via localGroovy) during sync, but no task graph does, so the cross-platform/qa passes never capture them."
|
||||
}
|
||||
|
||||
// Only wire up the resolvable configuration when the task is actually requested. This build is included by the
|
||||
// root, so the requested task names live on the parent build's start parameters, not this one's.
|
||||
val requested = (gradle.parent ?: gradle).startParameter.taskNames.any { it.substringAfterLast(':') == syncGroovyTaskName }
|
||||
if (requested) {
|
||||
val groovyVersion = groovy.lang.GroovySystem.getVersion()
|
||||
val suffix = "-$groovyVersion.jar"
|
||||
// localGroovy() puts the whole bundled Groovy runtime on the classpath, not just the umbrella module. Derive the
|
||||
// module names from the jars it actually resolves to (rather than every groovy jar in the distribution) so the
|
||||
// set matches what the IDE resolves and adapts automatically across Gradle versions.
|
||||
val modules = configurations.detachedConfiguration(dependencies.localGroovy()).files
|
||||
.map { it.name }
|
||||
.filter { it.startsWith("groovy") && it.endsWith(suffix) }
|
||||
.map { it.removeSuffix(suffix) }
|
||||
.sorted()
|
||||
.ifEmpty { listOf("groovy") }
|
||||
|
||||
val configuration = configurations.create("groovyVerification") {
|
||||
isCanBeConsumed = false
|
||||
isCanBeResolved = true
|
||||
}
|
||||
modules.forEach { module ->
|
||||
dependencies.add(configuration.name, "org.apache.groovy:$module:$groovyVersion")
|
||||
}
|
||||
|
||||
syncTask.configure {
|
||||
inputs.files(configuration.incoming.files)
|
||||
doLast {
|
||||
println("Resolved Groovy $groovyVersion module graph for verification.")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,6 +63,9 @@ constructor(
|
||||
// nested builds, which resolve plugin dependencies (e.g. junit BOMs) that no configuration walk or qa build
|
||||
// ever sees. Forcing a refresh re-downloads them through the verifier so their checksums get written.
|
||||
runGradle("--write-verification-metadata", "sha256", ":build-logic:plugins:generatePrecompiledScriptPluginAccessors", "--rerun-tasks", "--no-build-cache", "--refresh-dependencies")
|
||||
// The IDE resolves the bundled Groovy module graph (via localGroovy) during sync's model-building phase, which
|
||||
// no task graph reaches, so resolve it explicitly to capture those checksums.
|
||||
runGradle("--write-verification-metadata", "sha256", ":build-logic:plugins:syncGroovyVerification", "--rerun-tasks", "--refresh-dependencies")
|
||||
runGradle("--write-verification-metadata", "sha256", "syncCrossPlatformVerification", "--rerun-tasks")
|
||||
} catch (failure: Throwable) {
|
||||
file.writeBytes(original)
|
||||
|
||||
@@ -4186,6 +4186,11 @@ https://docs.gradle.org/current/userguide/dependency_verification.html
|
||||
<sha256 value="657cea7ea9f382cbe68c7cef2c4efe07f3212105217be94073c9d72145b389d3" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="com.github.javaparser" name="javaparser-core" version="3.27.1">
|
||||
<artifact name="javaparser-core-3.27.1.jar">
|
||||
<sha256 value="7ae10d11c5388060a7bf93b721600b951f5585f3782778b6d0555160680d35f8" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="com.github.jknack" name="handlebars" version="4.0.7">
|
||||
<artifact name="handlebars-4.0.7.jar">
|
||||
<sha256 value="d9b155fe8c8ddb0f9b3e5b156b5909dcd4c89d93defb2f72d0961aa633ad838f" origin="Generated by Gradle"/>
|
||||
@@ -5365,6 +5370,11 @@ https://docs.gradle.org/current/userguide/dependency_verification.html
|
||||
<sha256 value="056f3a1e144409f21ed16afc26805f58e9a21f3fce1543c42d400719d250c511" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="com.thoughtworks.qdox" name="qdox" version="1.12.1">
|
||||
<artifact name="qdox-1.12.1.jar">
|
||||
<sha256 value="21fba22f830e9268f07cf4ab2d99e8181abbdcb0cb91ee0228eb3cb918dcdd1d" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="com.twitter.compose.rules" name="common" version="0.0.26">
|
||||
<artifact name="common-0.0.26.jar">
|
||||
<sha256 value="cc848a700ea12dc63da461e4284475417520a36d3f52186c89798559d5aa1e08" origin="Generated by Gradle"/>
|
||||
@@ -6134,6 +6144,26 @@ https://docs.gradle.org/current/userguide/dependency_verification.html
|
||||
<sha256 value="43516d19beae35909e04d06af6c0c58c17bc94e0070c85e8dc9929ca640dc91d" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="org.apache.ant" name="ant" version="1.10.15">
|
||||
<artifact name="ant-1.10.15.jar">
|
||||
<sha256 value="763acda4a69588c9ea8817a952851ff0c2fc4bffa1d081c2565dc407f29d5794" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="org.apache.ant" name="ant-antlr" version="1.10.15">
|
||||
<artifact name="ant-antlr-1.10.15.jar">
|
||||
<sha256 value="619e361609d446fe6ab67d1d45b8656e68644cbd7c45bbed5c2c8816408d8dd5" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="org.apache.ant" name="ant-junit" version="1.10.15">
|
||||
<artifact name="ant-junit-1.10.15.jar">
|
||||
<sha256 value="9a455eeb4bedc1d8bcd4b8099d4b1f18f1bf1bc977cd6e389a106fe0cf366711" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="org.apache.ant" name="ant-launcher" version="1.10.15">
|
||||
<artifact name="ant-launcher-1.10.15.jar">
|
||||
<sha256 value="5c8551990307a032336d98ddaed549a39a689f07d4d4c6b950601bf22b3d6a1b" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="org.apache.commons" name="commons-compress" version="1.27.1">
|
||||
<artifact name="commons-compress-1.27.1.jar">
|
||||
<sha256 value="293d80f54b536b74095dcd7ea3cf0a29bbfc3402519281332495f4420d370d16" origin="Generated by Gradle"/>
|
||||
@@ -6149,6 +6179,99 @@ https://docs.gradle.org/current/userguide/dependency_verification.html
|
||||
<sha256 value="08709dd74d602b705ce4017d26544210056a4ba583d5b20c09373406fe7a00f8" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="org.apache.groovy" name="groovy" version="4.0.29">
|
||||
<artifact name="groovy-4.0.29.jar">
|
||||
<sha256 value="16b1259f5404bc43bf066556e043769b1f7570b2ca23fdaf169f12499677e936" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
<artifact name="groovy-4.0.29.module">
|
||||
<sha256 value="e7af04464263212199236dd8f136a2ef56662654ff9125fe3573f1968b147738" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="org.apache.groovy" name="groovy-ant" version="4.0.29">
|
||||
<artifact name="groovy-ant-4.0.29.jar">
|
||||
<sha256 value="6a8314a84c624a13e3b1e4b9db79aeb679f6b30e2d97f4c8a04465a5df556d61" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
<artifact name="groovy-ant-4.0.29.module">
|
||||
<sha256 value="92665f78934afbc5214f8085bec1ad3e26f2dd95a9df8d2e40ea8921c500b0d9" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="org.apache.groovy" name="groovy-astbuilder" version="4.0.29">
|
||||
<artifact name="groovy-astbuilder-4.0.29.jar">
|
||||
<sha256 value="b0b7972ed68fd12f575594d13f8153ab4290a7e4ccda79e452e202261121df83" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
<artifact name="groovy-astbuilder-4.0.29.module">
|
||||
<sha256 value="ef9116453bb919264040acb4800173c1dfd247a8244c55f2cc99a3a10c7a0e84" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="org.apache.groovy" name="groovy-bom" version="4.0.29">
|
||||
<artifact name="groovy-bom-4.0.29.module">
|
||||
<sha256 value="2392853c20ff3b7474791d66f831909f25396cb397cf63bf15e1998a5c0b82fc" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="org.apache.groovy" name="groovy-datetime" version="4.0.29">
|
||||
<artifact name="groovy-datetime-4.0.29.jar">
|
||||
<sha256 value="1f84c8127115a0c01a2053bb73d6fe0f540bfa30fd64d73dbd4221d0971b971c" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
<artifact name="groovy-datetime-4.0.29.module">
|
||||
<sha256 value="6a62fbfc964c749115de2dad43ac356113d426ada3d67e9e5c4d5a5714dbc375" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="org.apache.groovy" name="groovy-dateutil" version="4.0.29">
|
||||
<artifact name="groovy-dateutil-4.0.29.jar">
|
||||
<sha256 value="22733846903c69c22961f61b25f16dddab43cf4ac58e38f859fe28ec4e24a935" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
<artifact name="groovy-dateutil-4.0.29.module">
|
||||
<sha256 value="9ca3cfb3ff7b8b9e368dd5f56d530a698b48144ad70849198b40cb0b20a7eb68" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="org.apache.groovy" name="groovy-docgenerator" version="4.0.29">
|
||||
<artifact name="groovy-docgenerator-4.0.29.jar">
|
||||
<sha256 value="7d68cf213d6ab60acbd6d9b4f0a4863ed5b313bea9cb595e7ab5e045a786a87e" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
<artifact name="groovy-docgenerator-4.0.29.module">
|
||||
<sha256 value="2e990d636265373beadc22c3e4e3624a3089ed144bcc8503d79909afd048c588" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="org.apache.groovy" name="groovy-groovydoc" version="4.0.29">
|
||||
<artifact name="groovy-groovydoc-4.0.29.jar">
|
||||
<sha256 value="41c72ad55867c0efdd5b87037164689e2e7b5aa1058cf64cf7b45b27af418399" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
<artifact name="groovy-groovydoc-4.0.29.module">
|
||||
<sha256 value="36f314ccab47b8183f7bb7061b0929452f1485f90c8f53054bea49987808875b" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="org.apache.groovy" name="groovy-json" version="4.0.29">
|
||||
<artifact name="groovy-json-4.0.29.jar">
|
||||
<sha256 value="74370a440d98b84c3d3492dcba16a57ec65977c36c671058e460b85744be97d4" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
<artifact name="groovy-json-4.0.29.module">
|
||||
<sha256 value="8b82fd7951cc0659ea3a87fce02f8ff7a9461ac30240e9f5e9d89ee72106db65" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="org.apache.groovy" name="groovy-nio" version="4.0.29">
|
||||
<artifact name="groovy-nio-4.0.29.jar">
|
||||
<sha256 value="67b953261371a8bd0ccdc0debf2f133d86c52a322739bb9f01068a3469a84916" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
<artifact name="groovy-nio-4.0.29.module">
|
||||
<sha256 value="4f68a402a10b30dcdd4990c5418036329da4d5d224b35fceadd9b71a577c18dc" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="org.apache.groovy" name="groovy-templates" version="4.0.29">
|
||||
<artifact name="groovy-templates-4.0.29.jar">
|
||||
<sha256 value="94640de5660c8f702b85b917f44fe924755befb312e113ac3de839a782f96806" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
<artifact name="groovy-templates-4.0.29.module">
|
||||
<sha256 value="12d98916ff0244b1daa3ff0fd90693ae901371a9d8b290b9fc1a040874c7ad74" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="org.apache.groovy" name="groovy-xml" version="4.0.29">
|
||||
<artifact name="groovy-xml-4.0.29.jar">
|
||||
<sha256 value="30ce3967fd87d4ba6b9c433dc6082ae6a63007a7f8e8c464fb00714505f1950f" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
<artifact name="groovy-xml-4.0.29.module">
|
||||
<sha256 value="34f940a5c1cdec2d3550b020d4c9aecd4779d4200570e1972261da5e21b7391d" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="org.apache.httpcomponents" name="httpclient" version="4.5.14">
|
||||
<artifact name="httpclient-4.5.14.jar">
|
||||
<sha256 value="c8bc7e1c51a6d4ce72f40d2ebbabf1c4b68bfe76e732104b04381b493478e9d6" origin="Generated by Gradle"/>
|
||||
@@ -7611,6 +7734,11 @@ https://docs.gradle.org/current/userguide/dependency_verification.html
|
||||
<sha256 value="de70ac5d91a52656d8890a6d23b9e04d99b99b1a0402530decad71bf31b2735e" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="org.junit" name="junit-bom" version="5.14.0">
|
||||
<artifact name="junit-bom-5.14.0.module">
|
||||
<sha256 value="7ad3ddb2d74e6a77d65ae89aca45d468c97bf9915b6bc52f449d675e4e6f9b35" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="org.junit" name="junit-bom" version="5.8.1">
|
||||
<artifact name="junit-bom-5.8.1.module">
|
||||
<sha256 value="6b82cba52a134b13c1982f0cf9622c6d485371d40b989246f3124e3b0a5b1854" origin="Generated by Gradle"/>
|
||||
|
||||
Reference in New Issue
Block a user