[build] Fix Gradle 9 archives deprecation warning (#8247)

The deprecation message was:
```
The `archives` configuration added by the `base` plugin has been
deprecated and will be removed in Gradle 10.0.0. Adding artifacts to the
`archives` configuration will now result in a deprecation warning. If
you want the artifact built when running the `assemble` task, you should
add the artifact (or the task that produces it) as a dependency of the
`assemble` task directly.

val specialJar = tasks.register<Jar>("specialJar") {
    archiveBaseName.set("special")
    from("build/special")
}
tasks.named("assemble") {
    dependsOn(specialJar)
}
```
This commit is contained in:
Tyler Veness
2025-09-22 10:58:14 -07:00
committed by GitHub
parent 8fb5a1985a
commit ab259c2e89
3 changed files with 15 additions and 9 deletions

View File

@@ -39,11 +39,13 @@ task outputJavadocJar(type: Jar, dependsOn: javadoc) {
}
artifacts {
archives sourcesJar
archives javadocJar
archives outputJar
archives outputSourcesJar
archives outputJavadocJar
tasks.named("assemble") {
dependsOn(sourcesJar)
dependsOn(javadocJar)
dependsOn(outputJar)
dependsOn(outputSourcesJar)
dependsOn(outputJavadocJar)
}
}
addTaskToCopyAllOutputs(outputSourcesJar)