From ff11d5a2f3174fc48ef17b98b0b20f953b65725b Mon Sep 17 00:00:00 2001 From: Zongle Wang Date: Thu, 28 Nov 2024 05:29:54 -0500 Subject: [PATCH] Migrate to version catalog (#1056) Nothing changed. ``` Parallel Configuration Cache is an incubating feature. Reusing configuration cache. > Task :dependencies ------------------------------------------------------------ Root project 'shadow' - Gradle plugin to create fat/uber JARs, apply file transforms, and relocate packages for applications and libraries. Gradle version of Maven's Shade plugin. ------------------------------------------------------------ runtimeClasspath - Runtime classpath of 'main'. +--- org.jetbrains.kotlin:kotlin-stdlib:2.1.0 | \--- org.jetbrains:annotations:13.0 +--- org.apache.ant:ant:1.10.15 | \--- org.apache.ant:ant-launcher:1.10.15 +--- commons-io:commons-io:2.18.0 +--- org.apache.logging.log4j:log4j-core:2.24.2 | \--- org.apache.logging.log4j:log4j-api:2.24.2 +--- org.ow2.asm:asm-commons:9.7.1 | +--- org.ow2.asm:asm:9.7.1 | \--- org.ow2.asm:asm-tree:9.7.1 | \--- org.ow2.asm:asm:9.7.1 +--- org.vafer:jdependency:2.11 +--- org.jdom:jdom2:2.0.6.1 +--- org.codehaus.plexus:plexus-utils:4.0.2 \--- org.codehaus.plexus:plexus-xml:4.0.4 \--- org.apache.maven:maven-xml-impl:4.0.0-alpha-9 +--- org.apache.maven:maven-api-xml:4.0.0-alpha-9 | \--- org.apache.maven:maven-api-meta:4.0.0-alpha-9 \--- com.fasterxml.woodstox:woodstox-core:6.5.1 \--- org.codehaus.woodstox:stax2-api:4.2.1 (*) - Indicates repeated occurrences of a transitive dependency subtree. Gradle expands transitive dependency subtrees only once per project; repeat occurrences only display the root of the subtree, followed by this annotation. A web-based, searchable dependency report is available by adding the --scan option. BUILD SUCCESSFUL in 327ms 1 actionable task: 1 executed Configuration cache entry reused. ``` --- build.gradle.kts | 40 +++++++++++++++++++-------------------- gradle/libs.versions.toml | 25 ++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 20 deletions(-) create mode 100644 gradle/libs.versions.toml diff --git a/build.gradle.kts b/build.gradle.kts index 1c02867c0..99587de6e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -2,13 +2,13 @@ import org.jetbrains.kotlin.gradle.dsl.JvmTarget import org.jetbrains.kotlin.gradle.dsl.KotlinVersion plugins { - kotlin("jvm") version "2.1.0" + alias(libs.plugins.jetbrains.bcv) + alias(libs.plugins.kotlin) + alias(libs.plugins.android.lint) + alias(libs.plugins.spotless) groovy // Required for Spock tests. id("shadow.convention.publish") id("shadow.convention.deploy") - id("org.jetbrains.kotlinx.binary-compatibility-validator") version "0.16.3" - id("com.android.lint") version "8.7.2" - id("com.diffplug.spotless") version "7.0.0.BETA4" } java { @@ -44,27 +44,27 @@ spotless { } dependencies { - implementation("org.jdom:jdom2:2.0.6.1") - implementation("org.ow2.asm:asm-commons:9.7.1") - implementation("commons-io:commons-io:2.18.0") - implementation("org.apache.ant:ant:1.10.15") - implementation("org.codehaus.plexus:plexus-utils:4.0.2") - implementation("org.codehaus.plexus:plexus-xml:4.0.4") - implementation("org.apache.logging.log4j:log4j-core:2.24.2") - implementation("org.vafer:jdependency:2.11") + implementation(libs.apache.ant) + implementation(libs.apache.commonsIo) + implementation(libs.apache.log4j) + implementation(libs.asm) + implementation(libs.jdependency) + implementation(libs.jdom2) + implementation(libs.plexus.utils) + implementation(libs.plexus.xml) - testImplementation("org.spockframework:spock-core:2.3-groovy-3.0") { + testImplementation(libs.spock) { exclude(group = "org.codehaus.groovy") exclude(group = "org.hamcrest") } - testImplementation("org.xmlunit:xmlunit-legacy:2.10.0") - testImplementation("org.apache.commons:commons-lang3:3.17.0") - testImplementation("com.google.guava:guava:33.3.1-jre") - testImplementation(platform("org.junit:junit-bom:5.11.3")) - testImplementation("org.junit.jupiter:junit-jupiter") - testImplementation("org.junit.platform:junit-platform-suite-engine") + testImplementation(platform(libs.junit.bom)) + testImplementation(libs.junit.jupiter) + testImplementation(libs.junit.platformSuite) + testImplementation(libs.xmlunit) + testImplementation(libs.apache.commonsLang) + testImplementation(libs.guava) - lintChecks("androidx.lint:lint-gradle:1.0.0-alpha02") + lintChecks(libs.androidx.gradlePluginLints) } val isCI = providers.environmentVariable("CI").isPresent diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 000000000..657ed20ba --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,25 @@ +[libraries] +apache-ant = "org.apache.ant:ant:1.10.15" +apache-commonsIo = "commons-io:commons-io:2.18.0" +apache-commonsLang = "org.apache.commons:commons-lang3:3.17.0" +apache-log4j = "org.apache.logging.log4j:log4j-core:2.24.2" +asm = "org.ow2.asm:asm-commons:9.7.1" +guava = "com.google.guava:guava:33.3.1-jre" +jdependency = "org.vafer:jdependency:2.11" +jdom2 = "org.jdom:jdom2:2.0.6.1" +plexus-utils = "org.codehaus.plexus:plexus-utils:4.0.2" +plexus-xml = "org.codehaus.plexus:plexus-xml:4.0.4" +xmlunit = "org.xmlunit:xmlunit-legacy:2.10.0" + +androidx-gradlePluginLints = "androidx.lint:lint-gradle:1.0.0-alpha02" + +spock = "org.spockframework:spock-core:2.3-groovy-3.0" +junit-bom = "org.junit:junit-bom:5.11.3" +junit-jupiter = { module = "org.junit.jupiter:junit-jupiter" } +junit-platformSuite = { module = "org.junit.platform:junit-platform-suite-engine" } + +[plugins] +kotlin = "org.jetbrains.kotlin.jvm:2.1.0" +android-lint = "com.android.lint:8.7.2" +jetbrains-bcv = "org.jetbrains.kotlinx.binary-compatibility-validator:0.16.3" +spotless = "com.diffplug.spotless:7.0.0.BETA4"