From ecb6c5393c9bf8a44179670fb0b2066e093e1dd5 Mon Sep 17 00:00:00 2001 From: Istvan Toth Date: Tue, 12 Nov 2024 10:38:07 +0100 Subject: [PATCH] [CALCITE-6687] Add dependency constraints for org.ow2.asm for Gradle build environment in Avatica --- build.gradle.kts | 24 ++++++++++++++---------- gradle.properties | 2 ++ 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 55ae8c2bb..79ce6095f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -31,6 +31,20 @@ import de.thetaphi.forbiddenapis.gradle.CheckForbiddenApis import de.thetaphi.forbiddenapis.gradle.CheckForbiddenApisExtension import org.gradle.api.tasks.testing.logging.TestExceptionFormat +buildscript { + dependencies { + constraints { + // Looks like we cannot access the versions defined in gradle.properties from here + "classpath"("org.ow2.asm:asm:9.7.1") + "classpath"("org.ow2.asm:asm-all:9.7.1") + "classpath"("org.ow2.asm:asm-analysis:9.7.1") + "classpath"("org.ow2.asm:asm-commons:9.7.1") + "classpath"("org.ow2.asm:asm-tree:9.7.1") + "classpath"("org.ow2.asm:asm-util:9.7.1") + } + } +} + plugins { publishing // Verification @@ -345,16 +359,6 @@ allprojects { // By default spotbugs verifies TEST classes as well, and we do not want that this.sourceSets = listOf(sourceSets["main"]) } - dependencies { - constraints { - "spotbugs"("org.ow2.asm:asm:${"asm".v}") - "spotbugs"("org.ow2.asm:asm-all:${"asm".v}") - "spotbugs"("org.ow2.asm:asm-analysis:${"asm".v}") - "spotbugs"("org.ow2.asm:asm-commons:${"asm".v}") - "spotbugs"("org.ow2.asm:asm-tree:${"asm".v}") - "spotbugs"("org.ow2.asm:asm-util:${"asm".v}") - } - } } configure { diff --git a/gradle.properties b/gradle.properties index 621dd523c..86319b247 100644 --- a/gradle.properties +++ b/gradle.properties @@ -55,6 +55,8 @@ checkstyle.version=10.19.0 jdk8.checkstyle.version=9.3 spotbugs.version=3.1.11 +# This only applies to the asm used in the tests. To override the asm used by the gradle plugins +# change the version in the buildScript block of build.gradle.kts directly asm.version=9.7.1 bouncycastle.version=1.70 bytebuddy.version=1.15.1