Update deprecated Gradle task creation

This commit replaces use of the deprecated Gradle `task` method with
the new `tasks.register` method.

Closes gh-34617

Signed-off-by: Dmitry Sulman <dmitry.sulman@gmail.com>
This commit is contained in:
Dmitry Sulman
2025-03-19 10:30:19 +02:00
committed by Sam Brannen
parent adb4b675fc
commit 5455c645f0
3 changed files with 11 additions and 10 deletions

View File

@@ -87,14 +87,15 @@ javadoc {
logging.captureStandardOutput LogLevel.INFO // suppress "## warnings" message
}
task sourcesJar(type: Jar, dependsOn: classes) {
tasks.register('sourcesJar', Jar) {
dependsOn classes
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
archiveClassifier.set("sources")
from sourceSets.main.allSource
// Don't include or exclude anything explicitly by default. See SPR-12085.
}
task javadocJar(type: Jar) {
tasks.register('javadocJar', Jar) {
archiveClassifier.set("javadoc")
from javadoc
}