You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by su...@apache.org on 2019/05/31 02:31:35 UTC

[groovy] 02/02: Sort eclipse source folders by full path: src/main/java, src/test/groovy

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

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

commit e20153e10e7d8908a16565a82589ef565994f9d4
Author: Eric Milles <er...@thomsonreuters.com>
AuthorDate: Wed May 29 08:15:46 2019 -0500

    Sort eclipse source folders by full path: src/main/java, src/test/groovy
---
 gradle/eclipse.gradle | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/gradle/eclipse.gradle b/gradle/eclipse.gradle
index 006a823..2a6a3a8 100644
--- a/gradle/eclipse.gradle
+++ b/gradle/eclipse.gradle
@@ -22,7 +22,13 @@ allprojects {
     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.split('/')[-1].toLowerCase()}".toString() }
+        entries.sort(true) { entry ->
+            if (entry.class.simpleName != 'SourceFolder') {
+                "${entry.kind}:${entry.path.split('/')[-1].toLowerCase()}"
+            } else {
+                "${entry.kind}:${entry.path}"
+            }
+        }
 
         // set "test" attribute based on gradle scopes
         entries.findAll { entry ->