zabetak commented on code in PR #264:
URL: https://github.com/apache/calcite-avatica/pull/264#discussion_r1914442973


##########
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

Review Comment:
   We can access the properties in `gradle.properties` if we use the built-in 
functions. For instance the following works:
   ```
   "classpath"("org.ow2.asm:asm:${property("asm.version")}")
   ```



##########
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

Review Comment:
   After using the `${property("asm.version")}` syntax this comment is no 
longer necessary.



##########
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")
+        }
+    }
+}
+

Review Comment:
   I was under the impression that you can define constraints inside 
`pluginManagement` but after doing some research it turns out that its not 
possible.
   
   Basically, I reached out to the same conclusion as you. The only way to 
select dependencies for plugins is via the `buildscript` block.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to