You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2020/02/20 05:29:13 UTC

[groovy] branch master updated: follow up to GROOVY-9410 (issue spotted with groovy-templates) to fix dependency info when using other artifacts directly

This is an automated email from the ASF dual-hosted git repository.

paulk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git


The following commit(s) were added to refs/heads/master by this push:
     new 82ed93c  follow up to GROOVY-9410 (issue spotted with groovy-templates) to fix dependency info when using other artifacts directly
82ed93c is described below

commit 82ed93cc5d14650aed5749a87ae12785feb61c97
Author: Paul King <pa...@asert.com.au>
AuthorDate: Thu Feb 20 15:26:10 2020 +1000

    follow up to GROOVY-9410 (issue spotted with groovy-templates) to fix dependency info when using other artifacts directly
---
 build.gradle                                | 19 +++++++++++--------
 gradle/assemble.gradle                      |  4 ++--
 subprojects/groovy-ant/build.gradle         | 14 +++++++++-----
 subprojects/groovy-astbuilder/build.gradle  |  2 +-
 subprojects/groovy-bsf/build.gradle         |  6 +++---
 subprojects/groovy-cli-commons/build.gradle |  4 ++--
 subprojects/groovy-cli-picocli/build.gradle |  4 ++--
 subprojects/groovy-console/build.gradle     |  2 +-
 subprojects/groovy-datetime/build.gradle    |  2 +-
 subprojects/groovy-dateutil/build.gradle    |  2 +-
 subprojects/groovy-groovydoc/build.gradle   |  9 +++++----
 subprojects/groovy-groovysh/build.gradle    |  3 ++-
 subprojects/groovy-jmx/build.gradle         |  2 +-
 subprojects/groovy-json/build.gradle        |  2 +-
 subprojects/groovy-jsr223/build.gradle      |  2 +-
 subprojects/groovy-macro/build.gradle       |  2 +-
 subprojects/groovy-nio/build.gradle         |  2 +-
 subprojects/groovy-servlet/build.gradle     |  8 ++++----
 subprojects/groovy-sql/build.gradle         |  2 +-
 subprojects/groovy-swing/build.gradle       |  2 +-
 subprojects/groovy-templates/build.gradle   |  4 ++--
 subprojects/groovy-test-junit5/build.gradle | 10 +++++++---
 subprojects/groovy-test/build.gradle        |  4 ++--
 subprojects/groovy-testng/build.gradle      |  2 +-
 subprojects/groovy-xml/build.gradle         |  2 +-
 subprojects/groovy-yaml/build.gradle        |  8 ++++----
 26 files changed, 68 insertions(+), 55 deletions(-)

diff --git a/build.gradle b/build.gradle
index 5aa3276..a92b4dd 100644
--- a/build.gradle
+++ b/build.gradle
@@ -156,13 +156,16 @@ ext {
 }
 
 dependencies {
-    compile "antlr:antlr:$antlrVersion"
-    compile "org.ow2.asm:asm:$asmVersion"
-    compile "org.ow2.asm:asm-analysis:$asmVersion"
-    compile "org.ow2.asm:asm-commons:$asmVersion"
-    compile "org.ow2.asm:asm-tree:$asmVersion"
-    compile "org.ow2.asm:asm-util:$asmVersion"
-    compile "info.picocli:picocli:$picocliVersion"
+    // for internal CLI usage
+    api "info.picocli:picocli:$picocliVersion" // marked as api but manually excluded later in assemble.gradle - modules will use shaded version
+    // for internal usage of things like Opcode
+    api "org.ow2.asm:asm:$asmVersion" // marked as api but manually excluded later in assemble.gradle - modules will use shaded version
+    // for internal usage by the parser but manually excluded later in assemble.gradle - modules will use shaded version
+    api "antlr:antlr:$antlrVersion"
+    compileOnly "org.ow2.asm:asm-analysis:$asmVersion"
+    compileOnly "org.ow2.asm:asm-commons:$asmVersion"
+    compileOnly "org.ow2.asm:asm-tree:$asmVersion"
+    implementation "org.ow2.asm:asm-util:$asmVersion"
     implementation("com.thoughtworks.xstream:xstream:$xstreamVersion") {
         exclude(group: 'xpp3', module: 'xpp3_min')
         exclude(group: 'junit', module: 'junit')
@@ -176,7 +179,7 @@ dependencies {
 
     compileOnly "com.github.spotbugs:spotbugs-annotations:$spotbugsannotationsVersion"
 
-    runtime("org.codehaus.gpars:gpars:$gparsVersion") {
+    implementation("org.codehaus.gpars:gpars:$gparsVersion") {
         exclude(group: 'org.codehaus.groovy', module: 'groovy-all')
     }
 
diff --git a/gradle/assemble.gradle b/gradle/assemble.gradle
index c537cfb..2ab73d1 100644
--- a/gradle/assemble.gradle
+++ b/gradle/assemble.gradle
@@ -362,7 +362,7 @@ ext.distSpec = copySpec {
     into('lib') {
         from jarjar
         from modules()*.jarjar
-        from(configurations.runtime) {
+        from(configurations.runtimeClasspath) {
             exclude {
                 it.file.name.startsWith('openbeans-') ||
                         it.file.name.startsWith('asm-') ||
@@ -373,7 +373,7 @@ ext.distSpec = copySpec {
         }
         from('src/bin/groovy.icns')
     }
-    modules().configurations.runtime.each { conf ->
+    modules().configurations.runtimeClasspath.each { conf ->
         into('lib') {
             from(conf) {
                 exclude {
diff --git a/subprojects/groovy-ant/build.gradle b/subprojects/groovy-ant/build.gradle
index cb9ae55..5d7c569 100644
--- a/subprojects/groovy-ant/build.gradle
+++ b/subprojects/groovy-ant/build.gradle
@@ -17,17 +17,21 @@
  *  under the License.
  */
 dependencies {
-    implementation rootProject
-    compile "org.apache.ant:ant:$antVersion"
-    runtime("org.apache.ant:ant-junit:$antVersion") {
+    api rootProject  // FileNameFinder implements IFileNameFinder...
+    api("org.apache.ant:ant:$antVersion") {  // AntBuilder has Project constructor...
+        transitive = false
+    }
+    implementation("org.apache.ant:ant-junit:$antVersion") {
         exclude(group: 'junit', module: 'junit')
     }
-    runtime "org.apache.ant:ant-launcher:$antVersion"
-    runtime "org.apache.ant:ant-antlr:$antVersion"
+    implementation "org.apache.ant:ant-launcher:$antVersion"
+    implementation "org.apache.ant:ant-antlr:$antVersion"
     // for groovydoc ant command
     implementation project(':groovy-groovydoc'), {
         transitive = false
     }
+    compileOnly "org.ow2.asm:asm-tree:$asmVersion" // VerifyClass
+    compileOnly "org.ow2.asm:asm-util:$asmVersion" // VerifyClass
     testImplementation project(':groovy-test')
     testImplementation project(':groovy-xml')
 }
diff --git a/subprojects/groovy-astbuilder/build.gradle b/subprojects/groovy-astbuilder/build.gradle
index 1e6b820..fdc7480 100644
--- a/subprojects/groovy-astbuilder/build.gradle
+++ b/subprojects/groovy-astbuilder/build.gradle
@@ -17,7 +17,7 @@
  *  under the License.
  */
 dependencies {
-    implementation rootProject
+    api rootProject // AstBuilderTransformation publicly references numerous core classes
     testImplementation project(':groovy-test')
     testImplementation rootProject.sourceSets.test.runtimeClasspath
 }
diff --git a/subprojects/groovy-bsf/build.gradle b/subprojects/groovy-bsf/build.gradle
index 8e34e31..b27d600 100644
--- a/subprojects/groovy-bsf/build.gradle
+++ b/subprojects/groovy-bsf/build.gradle
@@ -17,10 +17,10 @@
  *  under the License.
  */
 dependencies {
-    compile('bsf:bsf:2.4.0') {
+    api('bsf:bsf:2.4.0') {  // GroovyEngine...
         exclude(group: 'commons-logging', module: 'commons-logging')
     }
-    compile 'commons-logging:commons-logging:1.2'
-    implementation rootProject
+    implementation 'commons-logging:commons-logging:1.2'
+    api rootProject // GroovyEngine#getEvalShell
     testImplementation project(':groovy-test')
 }
diff --git a/subprojects/groovy-cli-commons/build.gradle b/subprojects/groovy-cli-commons/build.gradle
index c6091b6..94832ba 100644
--- a/subprojects/groovy-cli-commons/build.gradle
+++ b/subprojects/groovy-cli-commons/build.gradle
@@ -17,8 +17,8 @@
  *  under the License.
  */
 dependencies {
-    implementation rootProject
-    compile "commons-cli:commons-cli:$commonsCliVersion"
+    api rootProject // CliBuilder uses Option...
+    implementation "commons-cli:commons-cli:$commonsCliVersion"
     testImplementation rootProject.sourceSets.test.output
     testImplementation project(':groovy-test')
     testImplementation project(':groovy-dateutil')
diff --git a/subprojects/groovy-cli-picocli/build.gradle b/subprojects/groovy-cli-picocli/build.gradle
index e474ee1..92ef40f 100644
--- a/subprojects/groovy-cli-picocli/build.gradle
+++ b/subprojects/groovy-cli-picocli/build.gradle
@@ -17,8 +17,8 @@
  *  under the License.
  */
 dependencies {
-    implementation rootProject
-    compileOnly "info.picocli:picocli:$picocliVersion"
+    api rootProject   // CliBuilder uses Option...
+    implementation "info.picocli:picocli:$picocliVersion"
     testImplementation rootProject.sourceSets.test.output
     testImplementation project(':groovy-test')
     testImplementation project(':groovy-dateutil')
diff --git a/subprojects/groovy-console/build.gradle b/subprojects/groovy-console/build.gradle
index 1cead09..4b48627 100644
--- a/subprojects/groovy-console/build.gradle
+++ b/subprojects/groovy-console/build.gradle
@@ -19,7 +19,7 @@
 evaluationDependsOn(':groovy-swing')
 
 dependencies {
-    implementation rootProject
+    api rootProject // AstBrowser has methods with Closure params...
     implementation project(':groovy-swing')
     implementation project(':groovy-templates')
     testImplementation project(':groovy-test')
diff --git a/subprojects/groovy-datetime/build.gradle b/subprojects/groovy-datetime/build.gradle
index f23cefb..ae95c54 100644
--- a/subprojects/groovy-datetime/build.gradle
+++ b/subprojects/groovy-datetime/build.gradle
@@ -17,7 +17,7 @@
  *  under the License.
  */
 dependencies {
-    implementation rootProject
+    api rootProject // DateTimeExtensions has methods with Closure params...
     testImplementation project(':groovy-test')
     testImplementation project(':groovy-dateutil')
 }
diff --git a/subprojects/groovy-dateutil/build.gradle b/subprojects/groovy-dateutil/build.gradle
index e5e83fd..c91a0bd 100644
--- a/subprojects/groovy-dateutil/build.gradle
+++ b/subprojects/groovy-dateutil/build.gradle
@@ -17,7 +17,7 @@
  *  under the License.
  */
 dependencies {
-    implementation rootProject
+    api rootProject  // DateUtilExtensions has methods with Closure params...
     testImplementation project(':groovy-test')
 }
 
diff --git a/subprojects/groovy-groovydoc/build.gradle b/subprojects/groovy-groovydoc/build.gradle
index 874e3af..48f90d4 100644
--- a/subprojects/groovy-groovydoc/build.gradle
+++ b/subprojects/groovy-groovydoc/build.gradle
@@ -17,11 +17,12 @@
  *  under the License.
  */
 dependencies {
-    implementation rootProject
-    compile "com.github.javaparser:javaparser-core:$javaParserVersion"
-    testImplementation rootProject.sourceSets.test.runtimeClasspath
+    api rootProject // GroovydocVisitor extends ClassCodeVisitorSupport...
+    api "com.github.javaparser:javaparser-core:$javaParserVersion" // GroovydocJavaVisitor extends VoidVisitorAdapter...
+    compileOnly "antlr:antlr:$antlrVersion" // shaded
     implementation project(':groovy-templates')
-    runtime project(':groovy-docgenerator')
+    implementation project(':groovy-docgenerator')
+    testImplementation rootProject.sourceSets.test.runtimeClasspath
     testImplementation project(':groovy-test')
     testImplementation "org.apache.ant:ant-testutil:$antVersion"
 }
diff --git a/subprojects/groovy-groovysh/build.gradle b/subprojects/groovy-groovysh/build.gradle
index 4a60065..ae8a398 100644
--- a/subprojects/groovy-groovysh/build.gradle
+++ b/subprojects/groovy-groovysh/build.gradle
@@ -20,8 +20,9 @@ dependencies {
     implementation rootProject
     implementation project(':groovy-console')
     implementation project(':groovy-templates')
+    implementation project(':groovy-xml')
     testImplementation project(':groovy-test')
-    compile("jline:jline:$jlineVersion") {
+    implementation("jline:jline:$jlineVersion") {
         exclude(group: 'junit', module: 'junit')
     }
 }
diff --git a/subprojects/groovy-jmx/build.gradle b/subprojects/groovy-jmx/build.gradle
index b18e1ac..3bbba3e 100644
--- a/subprojects/groovy-jmx/build.gradle
+++ b/subprojects/groovy-jmx/build.gradle
@@ -17,7 +17,7 @@
  *  under the License.
  */
 dependencies {
-    implementation rootProject
+    api rootProject // JmxBuilder extends FactoryBuilderSupport...
     testImplementation project(':groovy-test')
 }
 
diff --git a/subprojects/groovy-json/build.gradle b/subprojects/groovy-json/build.gradle
index 33e5c57..9cb272b 100644
--- a/subprojects/groovy-json/build.gradle
+++ b/subprojects/groovy-json/build.gradle
@@ -17,7 +17,7 @@
  *  under the License.
  */
 dependencies {
-    implementation rootProject
+    api rootProject  // JsonBuilder extends GroovyObjectSupport...
     testImplementation project(':groovy-test')
     testImplementation project(':groovy-dateutil')
     testRuntime "org.slf4j:slf4j-api:$slf4jVersion"
diff --git a/subprojects/groovy-jsr223/build.gradle b/subprojects/groovy-jsr223/build.gradle
index 12b2c33..365e663 100644
--- a/subprojects/groovy-jsr223/build.gradle
+++ b/subprojects/groovy-jsr223/build.gradle
@@ -17,7 +17,7 @@
  *  under the License.
  */
 dependencies {
-    implementation rootProject
+    api rootProject // ScriptExtensions use Binding...
     testImplementation project(':groovy-test')
 }
 
diff --git a/subprojects/groovy-macro/build.gradle b/subprojects/groovy-macro/build.gradle
index 7ff2f89..941e813 100644
--- a/subprojects/groovy-macro/build.gradle
+++ b/subprojects/groovy-macro/build.gradle
@@ -17,7 +17,7 @@
  *  under the License.
  */
 dependencies {
-    implementation rootProject
+    api rootProject // ASTMatcher use ASTNode...
     testImplementation rootProject.sourceSets.test.runtimeClasspath
     testImplementation project(':groovy-test')
 }
diff --git a/subprojects/groovy-nio/build.gradle b/subprojects/groovy-nio/build.gradle
index 69387a6..af4d589 100644
--- a/subprojects/groovy-nio/build.gradle
+++ b/subprojects/groovy-nio/build.gradle
@@ -23,7 +23,7 @@ repositories {
 }
 
 dependencies {
-    implementation rootProject
+    api rootProject  // NioExtensions uses Closure...
     testImplementation project(':groovy-test')
     // temporarily disable spock tests since it doesn't support 4 yet
     if (!spockVersion.startsWith('1.3') || !groovyVersion.startsWith('4')) {
diff --git a/subprojects/groovy-servlet/build.gradle b/subprojects/groovy-servlet/build.gradle
index 674c8a4..9a20eea 100644
--- a/subprojects/groovy-servlet/build.gradle
+++ b/subprojects/groovy-servlet/build.gradle
@@ -17,21 +17,21 @@
  *  under the License.
  */
 dependencies {
-    compile('javax.servlet:javax.servlet-api:3.0.1') { dep ->
+    api('javax.servlet:javax.servlet-api:3.0.1') { dep ->
         provided dep
     }
-    compile('javax.servlet:jsp-api:2.0') { dep ->
+    api('javax.servlet:jsp-api:2.0') { dep ->
         provided dep
         exclude(group: 'javax.servlet', module: 'servlet-api')
     }
-    testImplementation "jmock:jmock:$jmockVersion"
 
-    implementation rootProject
+    api rootProject  // ServletBinding extends Binding...
     // needed for MarkupBuilder
     implementation project(':groovy-xml')
     // needed by TemplateServlet
     implementation project(':groovy-templates')
 
+    testImplementation "jmock:jmock:$jmockVersion"
     testImplementation rootProject.sourceSets.test.runtimeClasspath
     testImplementation project(':groovy-json')
     testImplementation project(':groovy-test')
diff --git a/subprojects/groovy-sql/build.gradle b/subprojects/groovy-sql/build.gradle
index 30949a5..0e44dcf 100644
--- a/subprojects/groovy-sql/build.gradle
+++ b/subprojects/groovy-sql/build.gradle
@@ -17,7 +17,7 @@
  *  under the License.
  */
 dependencies {
-    implementation rootProject
+    api rootProject // Sql uses Closure...
     testImplementation group: 'org.hsqldb', name: 'hsqldb', version: '2.3.3'
 // uncomment to test with other databases (requires changes elsewhere too)
 //    testImplementation 'com.h2database:h2:1.3.164'
diff --git a/subprojects/groovy-swing/build.gradle b/subprojects/groovy-swing/build.gradle
index 9951d30..325b65a 100644
--- a/subprojects/groovy-swing/build.gradle
+++ b/subprojects/groovy-swing/build.gradle
@@ -17,7 +17,7 @@
  *  under the License.
  */
 dependencies {
-    implementation rootProject
+    api rootProject  // SwingBuilder extends FactoryBuilderSupport...
     testImplementation rootProject.sourceSets.test.runtimeClasspath
     testImplementation project(':groovy-test')
 }
diff --git a/subprojects/groovy-templates/build.gradle b/subprojects/groovy-templates/build.gradle
index 5717f16..c847a1c 100644
--- a/subprojects/groovy-templates/build.gradle
+++ b/subprojects/groovy-templates/build.gradle
@@ -23,8 +23,8 @@ repositories {
 }
 
 dependencies {
-    api rootProject
-    api project(':groovy-xml')
+    api rootProject // Template uses Writable...
+    implementation project(':groovy-xml')
     testImplementation rootProject.sourceSets.test.runtimeClasspath
     testImplementation project(':groovy-test')
     // temporarily disable spock tests since it doesn't support 4 yet
diff --git a/subprojects/groovy-test-junit5/build.gradle b/subprojects/groovy-test-junit5/build.gradle
index baaf53c..050d13a 100644
--- a/subprojects/groovy-test-junit5/build.gradle
+++ b/subprojects/groovy-test-junit5/build.gradle
@@ -23,9 +23,13 @@ ext {
 }
 
 dependencies {
-    implementation rootProject
-    compile "org.junit.platform:junit-platform-launcher:$junit5PlatformVersion"
-    runtime "org.junit.jupiter:junit-jupiter-engine:$junit5Version"
+    api rootProject // JUnit5Runner implements GroovyRunner...
+    implementation("org.junit.platform:junit-platform-launcher:$junit5PlatformVersion") {
+        exclude(group: 'org.apiguardian', module: 'apiguardian-api')
+    }
+    implementation("org.junit.jupiter:junit-jupiter-engine:$junit5Version") {
+        exclude(group: 'org.apiguardian', module: 'apiguardian-api')
+    }
     testImplementation "org.junit.jupiter:junit-jupiter-params:$junit5Version"
     testRuntime "org.junit.platform:junit-platform-engine:$junit5PlatformVersion"
     testRuntime "org.junit.platform:junit-platform-runner:$junit5PlatformVersion"
diff --git a/subprojects/groovy-test/build.gradle b/subprojects/groovy-test/build.gradle
index e3811ef..8bb1c67 100644
--- a/subprojects/groovy-test/build.gradle
+++ b/subprojects/groovy-test/build.gradle
@@ -22,8 +22,8 @@ ext {
 }
 
 dependencies {
-    implementation rootProject
-    compile "junit:junit:$junitVersion"
+    api rootProject   // GroovyTestCase uses Closure...
+    api "junit:junit:$junitVersion" // GroovyTestCase extends TestCase...
     // groovy-ant needed for FileNameFinder used in AllTestSuite and JavadocAssertionTestSuite
     testRuntime(project(':groovy-ant')) {
         transitive = false // bring in just what we need below
diff --git a/subprojects/groovy-testng/build.gradle b/subprojects/groovy-testng/build.gradle
index d44ee31..b54fe05 100644
--- a/subprojects/groovy-testng/build.gradle
+++ b/subprojects/groovy-testng/build.gradle
@@ -17,7 +17,7 @@
  *  under the License.
  */
 dependencies {
-    implementation rootProject
+    api rootProject // TestNgRunner implements GroovyRunner...
     runtime('org.testng:testng:6.14.3') {
         // exclude 'optional' beanshell even though testng's pom doesn't say optional
         exclude(group: 'org.apache-extras.beanshell', module: 'bsh')
diff --git a/subprojects/groovy-xml/build.gradle b/subprojects/groovy-xml/build.gradle
index f0d82d6..2528544 100644
--- a/subprojects/groovy-xml/build.gradle
+++ b/subprojects/groovy-xml/build.gradle
@@ -17,7 +17,7 @@
  *  under the License.
  */
 dependencies {
-    implementation rootProject
+    api rootProject  // MarkupBuilder extends BuilderSupport...
     testImplementation rootProject.sourceSets.test.runtimeClasspath
     testImplementation "xmlunit:xmlunit:$xmlunitVersion"
     testImplementation project(':groovy-test')
diff --git a/subprojects/groovy-yaml/build.gradle b/subprojects/groovy-yaml/build.gradle
index e7cdee6..ff62ae7 100644
--- a/subprojects/groovy-yaml/build.gradle
+++ b/subprojects/groovy-yaml/build.gradle
@@ -22,12 +22,12 @@ ext {
 }
 
 dependencies {
-    implementation rootProject
-    compile "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:$jacksonVersion"
-    compile "com.fasterxml.jackson.core:jackson-databind:$jacksonVersion"
-    testRuntime "com.fasterxml.jackson.core:jackson-annotations:$jacksonVersion"
+    api rootProject  // YamlBuilder extends GroovyObjectSupport...
+    implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:$jacksonVersion"
+    implementation "com.fasterxml.jackson.core:jackson-databind:$jacksonVersion"
     implementation project(':groovy-json')
     testImplementation project(':groovy-test')
+    testRuntime "com.fasterxml.jackson.core:jackson-annotations:$jacksonVersion"
     testRuntime project(':groovy-ant') // for JavadocAssertionTests
 }