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 2019/05/24 00:00:50 UTC

[groovy] branch master updated (8635e34 -> 5a5494a)

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

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


    from 8635e34  GROOVY-9139: Bump JUnit 5 to 5.5.0-M1
     new ebd902a  Update eclipse gradle scripts
     new fc99f70  Fix test compile dependency
     new 5a5494a  Add test runtime dependency (closes #932)

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .gitignore                                   |  18 +++--
 gradle/eclipse.gradle                        | 109 +++++++++++++++++----------
 subprojects/groovy-docgenerator/build.gradle |   4 +
 subprojects/groovy-groovydoc/build.gradle    |   4 +
 subprojects/groovy-groovysh/build.gradle     |   4 +
 subprojects/groovy-json/build.gradle         |   7 +-
 subprojects/groovy-servlet/build.gradle      |   7 +-
 subprojects/groovy-test/build.gradle         |   4 +
 subprojects/groovy-yaml/build.gradle         |   4 +
 9 files changed, 111 insertions(+), 50 deletions(-)


[groovy] 01/03: Update eclipse gradle scripts

Posted by pa...@apache.org.
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

commit ebd902af8bd3aa8d96cbe6739258750145a32db3
Author: Eric Milles <er...@thomsonreuters.com>
AuthorDate: Wed May 22 14:40:40 2019 -0500

    Update eclipse gradle scripts
---
 .gitignore                                   |  18 +++--
 gradle/eclipse.gradle                        | 109 +++++++++++++++++----------
 subprojects/groovy-docgenerator/build.gradle |   4 +
 subprojects/groovy-groovydoc/build.gradle    |   4 +
 subprojects/groovy-groovysh/build.gradle     |   4 +
 subprojects/groovy-json/build.gradle         |   6 +-
 subprojects/groovy-servlet/build.gradle      |   6 +-
 subprojects/groovy-test/build.gradle         |   4 +
 subprojects/groovy-yaml/build.gradle         |   4 +
 9 files changed, 111 insertions(+), 48 deletions(-)

diff --git a/.gitignore b/.gitignore
index b7ec6f4..338baa0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,19 +1,21 @@
+user.gradle
+.gradle/
 target/
 build/
 out/
-/bin/
+
 *.DS_Store
+*.class
+*.swp
 *~
-.gradle
+
+.idea
 *.iml
 *.ipr
 *.iws
-.idea
-.*.swp
-*.class
-user.gradle
+.shelf
+
 .settings/
 .classpath
 .project
-.shelf
-
+bin/
diff --git a/gradle/eclipse.gradle b/gradle/eclipse.gradle
index 559004b..84be8cf 100644
--- a/gradle/eclipse.gradle
+++ b/gradle/eclipse.gradle
@@ -16,52 +16,85 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-//most of this is just a "hack" to break the circular dependencies between projects
-//which exist because Eclipse does not distinguish between build phases (e.g. compile, test, runtime)
 allprojects {
     apply plugin: 'eclipse'
-    
-    eclipse.jdt {
-        sourceCompatibility = 1.7
-        targetCompatibility = 1.7
-    }
-    
-    eclipse.classpath.file {
-        whenMerged { classpath ->
-            classpath.entries.removeAll{ entry -> entry.path == '/groovy-groovydoc' }
-            classpath.entries.removeAll{ entry -> entry.path =~ /groovy-ant/ }
-            classpath.entries.removeAll{ entry -> entry.path =~ /target/ }
-            classpath.entries.unique(true){ entry -> entry.path }
+
+    eclipse.classpath.file.whenMerged {
+        entries.removeAll { entry -> entry.path =~ '/target/' } // affects: cli-commons, cli-picocli, console, groovydoc, macro, servlet, swing, templates, xml
+        entries.unique(true) { entry -> entry.path } // affects: console, groovydoc, macro, servlet, swing, templates, xml
+        entries.sort(true) { entry -> "${entry.kind}:${entry.path}".toString() }
+
+        // set "test" attribute based on gradle scopes
+        entries.findAll { entry ->
+            entry.class.name in [
+                'org.gradle.plugins.ide.eclipse.model.Library',
+                'org.gradle.plugins.ide.eclipse.model.SourceFolder'
+            ]
+        }.each { entry ->
+            if (entry.entryAttributes['gradle_used_by_scope'] == 'test') {
+                entry.entryAttributes['test'] = 'true'
+            }
         }
-        withXml {
-            def node = it.asNode()
-            node.appendNode('classpathentry', [kind: 'lib', path: "${rootProject.jar.archivePath}"])
+        // set "test" attribute based on configuration
+        entries.findAll { entry ->
+            entry.class.name in [
+                'org.gradle.plugins.ide.eclipse.model.ProjectDependency'
+            ]
+        }.each { entry ->
+            if (entry.path.substring(1) in project.configurations.testCompile.dependencies*.name) {
+                entry.entryAttributes['test'] = 'true'
+            }
         }
     }
-    
+
     project.tasks.eclipse.doLast {
-        File groovyPrefs = file("${project.projectDir}/.settings/org.eclipse.jdt.groovy.core.prefs")
-        if (!groovyPrefs.exists()) {
-            groovyPrefs.append('groovy.compiler.level=-1\n')
+        file("${project.projectDir}/.settings/org.eclipse.jdt.groovy.core.prefs").with { prefs ->
+            if (!prefs.exists()) {
+                append('''\
+                    eclipse.preferences.version=1
+                    groovy.compiler.level=30
+                    '''.stripIndent()
+                )
+            }
         }
-    }
-}
 
-eclipse.classpath.file {
-    whenMerged { classpath ->
-        classpath.entries.find { entry -> entry.path =~ /src\/main/ }.path = '/groovy/src/main'
-        classpath.entries.find { entry -> entry.path =~ /src\/main/ }.includes = []
-        classpath.entries.each { entry -> if(entry.path == 'src/test'){ entry.excludes = ['groovy/PropertyTest.groovy'] as List } }
-        classpath.entries.removeAll{ entry -> entry.path == '/groovy-test' }
-        classpath.entries.removeAll{ entry -> entry.path =~ /subprojects/ }
-        classpath.entries.removeAll{ entry -> entry.path =~ /examples/ }
-    }
-    withXml {
-        def node = it.asNode()
-        ['groovy-test', 'groovy-groovydoc', 'groovy-jmx', 'groovy-xml', 'groovy-ant'].each{
-            node.appendNode('classpathentry', [kind: 'src', path: "/groovy/subprojects/$it/src/main/groovy"])
-            node.appendNode('classpathentry', [kind: 'src', path: "/groovy/subprojects/$it/src/main/java"])
+        file("${project.projectDir}/.settings/org.eclipse.core.resources.prefs").with { prefs ->
+            if (!prefs.exists()) {
+                append('''\
+                    eclipse.preferences.version=1
+                    encoding/<project>=UTF-8
+                    '''.stripIndent()
+                )
+            }
+        }
+
+        file("${project.projectDir}/.settings/org.eclipse.core.runtime.prefs").with { prefs ->
+            if (!prefs.exists()) {
+                append('''\
+                    eclipse.preferences.version=1
+                    line.separator=\\n
+                    '''.stripIndent()
+                )
+            }
+        }
+
+        file("${project.projectDir}/.settings/org.eclipse.jdt.ui.prefs").with { prefs ->
+            if (!prefs.exists()) {
+                append('''\
+                    eclipse.preferences.version=1
+                    org.eclipse.jdt.ui.ignorelowercasenames=true
+                    org.eclipse.jdt.ui.importorder=;javax;java;\\#;
+                    org.eclipse.jdt.ui.ondemandthreshold=99
+                    org.eclipse.jdt.ui.staticondemandthreshold=99
+                    '''.stripIndent()
+                )
+            }
         }
-        node.appendNode('classpathentry', [kind: 'src', path: '/groovy/subprojects/groovy-templates/src/main/groovy'])
     }
 }
+
+eclipse.classpath.file.whenMerged {
+    entries.removeAll { entry -> entry.path == '/groovy-groovydoc' }
+}
+
+// TODO: Create tasks for cleaning the .settings files created above
diff --git a/subprojects/groovy-docgenerator/build.gradle b/subprojects/groovy-docgenerator/build.gradle
index 552d4bd..0d270e4 100644
--- a/subprojects/groovy-docgenerator/build.gradle
+++ b/subprojects/groovy-docgenerator/build.gradle
@@ -23,3 +23,7 @@ dependencies {
     testCompile project(':groovy-test')
     compile "com.thoughtworks.qdox:qdox:$qdoxVersion"
 }
+
+eclipse.classpath.file.whenMerged {
+    entries.removeAll { entry -> entry.path == '/groovy-xml' }
+}
diff --git a/subprojects/groovy-groovydoc/build.gradle b/subprojects/groovy-groovydoc/build.gradle
index 2e9f98c..80696b1 100644
--- a/subprojects/groovy-groovydoc/build.gradle
+++ b/subprojects/groovy-groovydoc/build.gradle
@@ -31,3 +31,7 @@ compileJava {
         mkdir "$sourceSets.main.java.outputDir/META-INF"
     }
 }
+
+eclipse.classpath.file.whenMerged {
+    entries.removeAll { entry -> entry.path == '/groovy-xml' }
+}
diff --git a/subprojects/groovy-groovysh/build.gradle b/subprojects/groovy-groovysh/build.gradle
index 6e5e1a0..2b7dfbb 100644
--- a/subprojects/groovy-groovysh/build.gradle
+++ b/subprojects/groovy-groovysh/build.gradle
@@ -25,3 +25,7 @@ dependencies {
         exclude(group: 'junit', module: 'junit')
     }
 }
+
+eclipse.classpath.file.whenMerged {
+    entries.removeAll { entry -> entry.path in ['/groovy-xml', '/groovy-swing', '/groovy-templates'] }
+}
diff --git a/subprojects/groovy-json/build.gradle b/subprojects/groovy-json/build.gradle
index 7ef5902..3ff11ac 100644
--- a/subprojects/groovy-json/build.gradle
+++ b/subprojects/groovy-json/build.gradle
@@ -19,6 +19,10 @@
 dependencies {
     compile rootProject
     testCompile project(':groovy-test')
-    testRuntime project(':groovy-ant') // for JavadocAssertionTests
     testCompile project(':groovy-dateutil')
+    testRuntime project(':groovy-ant') // for JavadocAssertionTests
+}
+
+eclipse.classpath.file.whenMerged {
+    entries.removeAll { entry -> entry.path in ['/groovy-ant', '/groovy-groovydoc'] }
 }
diff --git a/subprojects/groovy-servlet/build.gradle b/subprojects/groovy-servlet/build.gradle
index 3dce1cd..60faeb1 100644
--- a/subprojects/groovy-servlet/build.gradle
+++ b/subprojects/groovy-servlet/build.gradle
@@ -33,5 +33,9 @@ dependencies {
     testCompile rootProject.sourceSets.test.runtimeClasspath
     testCompile project(':groovy-test')
     // for compilation, dependency is not necessary because the classes are loaded using Class.forName
-    testCompile project(':groovy-json')
+    testRuntime project(':groovy-json')
+}
+
+eclipse.classpath.file.whenMerged {
+    entries.removeAll { entry -> entry.path == '/groovy-json' }
 }
diff --git a/subprojects/groovy-test/build.gradle b/subprojects/groovy-test/build.gradle
index c0a8bdd..e7e3d0b 100644
--- a/subprojects/groovy-test/build.gradle
+++ b/subprojects/groovy-test/build.gradle
@@ -26,4 +26,8 @@ dependencies {
     testRuntime "org.apache.ant:ant-launcher:$antVersion"
 }
 
+eclipse.classpath.file.whenMerged {
+    entries.removeAll { entry -> entry.path == '/groovy-ant' }
+}
+
 apply from: "${rootProject.projectDir}/gradle/jacoco/jacocofix.gradle"
diff --git a/subprojects/groovy-yaml/build.gradle b/subprojects/groovy-yaml/build.gradle
index df56336..0b39b28 100644
--- a/subprojects/groovy-yaml/build.gradle
+++ b/subprojects/groovy-yaml/build.gradle
@@ -30,3 +30,7 @@ dependencies {
     testCompile project(':groovy-test')
     testRuntime project(':groovy-ant') // for JavadocAssertionTests
 }
+
+eclipse.classpath.file.whenMerged {
+    entries.removeAll { entry -> entry.path in ['/groovy-ant', '/groovy-groovydoc'] }
+}


[groovy] 02/03: Fix test compile dependency

Posted by pa...@apache.org.
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

commit fc99f70c6f146590faf1f952df480398faa5ead1
Author: Eric Milles <er...@thomsonreuters.com>
AuthorDate: Thu May 23 11:29:08 2019 -0500

    Fix test compile dependency
---
 subprojects/groovy-servlet/build.gradle | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/subprojects/groovy-servlet/build.gradle b/subprojects/groovy-servlet/build.gradle
index 60faeb1..f5b16a0 100644
--- a/subprojects/groovy-servlet/build.gradle
+++ b/subprojects/groovy-servlet/build.gradle
@@ -24,18 +24,15 @@ dependencies {
         provided dep
         exclude(group: 'javax.servlet', module: 'servlet-api')
     }
-    compile rootProject
     testCompile "jmock:jmock:$jmockVersion"
+
+    compile rootProject
     // needed for MarkupBuilder
     compile project(':groovy-xml')
     // needed by TemplateServlet
     compile project(':groovy-templates')
+
     testCompile rootProject.sourceSets.test.runtimeClasspath
+    testCompile project(':groovy-json')
     testCompile project(':groovy-test')
-    // for compilation, dependency is not necessary because the classes are loaded using Class.forName
-    testRuntime project(':groovy-json')
-}
-
-eclipse.classpath.file.whenMerged {
-    entries.removeAll { entry -> entry.path == '/groovy-json' }
 }


[groovy] 03/03: Add test runtime dependency (closes #932)

Posted by pa...@apache.org.
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

commit 5a5494ae12be4d2b7c7dd50038f88d86c938a1f5
Author: Eric Milles <er...@thomsonreuters.com>
AuthorDate: Thu May 23 12:30:58 2019 -0500

    Add test runtime dependency (closes #932)
---
 subprojects/groovy-json/build.gradle | 1 +
 1 file changed, 1 insertion(+)

diff --git a/subprojects/groovy-json/build.gradle b/subprojects/groovy-json/build.gradle
index 3ff11ac..1ab2576 100644
--- a/subprojects/groovy-json/build.gradle
+++ b/subprojects/groovy-json/build.gradle
@@ -20,6 +20,7 @@ dependencies {
     compile rootProject
     testCompile project(':groovy-test')
     testCompile project(':groovy-dateutil')
+    testRuntime "org.slf4j:slf4j-api:$slf4jVersion"
     testRuntime project(':groovy-ant') // for JavadocAssertionTests
 }