groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sun...@apache.org
Subject [groovy] branch master updated: Add clean tasks and save actions
Date Tue, 28 May 2019 02:51:45 GMT
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


The following commit(s) were added to refs/heads/master by this push:
     new b5c9a8c  Add clean tasks and save actions
b5c9a8c is described below

commit b5c9a8c5e1aa3a07518b6e4e2a9f3541793f5972
Author: Eric Milles <eric.milles@thomsonreuters.com>
AuthorDate: Mon May 27 18:59:33 2019 -0500

    Add clean tasks and save actions
---
 gradle/eclipse.gradle | 27 +++++++++++++++++++++++++--
 1 file changed, 25 insertions(+), 2 deletions(-)

diff --git a/gradle/eclipse.gradle b/gradle/eclipse.gradle
index 84be8cf..f7d3220 100644
--- a/gradle/eclipse.gradle
+++ b/gradle/eclipse.gradle
@@ -82,19 +82,42 @@ allprojects {
             if (!prefs.exists()) {
                 append('''\
                     eclipse.preferences.version=1
+                    editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
                     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
+                    sp_cleanup.on_save_use_additional_actions=true
+                    sp_cleanup.organize_imports=true
+                    sp_cleanup.remove_trailing_whitespaces=true
+                    sp_cleanup.remove_trailing_whitespaces_all=true
+                    sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
+                    sp_cleanup.update_copyright_notice=true
                     '''.stripIndent()
                 )
             }
         }
     }
+
+    // tasks for cleaning the .settings files created above
+
+    task cleanEclipseGdt(type: Delete) {
+        delete "${project.projectDir}/.settings/org.eclipse.jdt.groovy.core.prefs"
+    }
+    cleanEclipse.dependsOn(cleanEclipseGdt)
+
+    task cleanEclipseJdtUI(type: Delete) {
+        delete "${project.projectDir}/.settings/org.eclipse.jdt.ui.prefs"
+    }
+    cleanEclipse.dependsOn(cleanEclipseJdtUI)
+
+    project.tasks.cleanEclipse.doLast {
+        file("${project.projectDir}/.settings/org.eclipse.core.resources.prefs").delete()
+        file("${project.projectDir}/.settings/org.eclipse.core.runtime.prefs").delete()
+        file("${project.projectDir}/.settings/").with { if (!listFiles()) delete() }
+    }
 }
 
 eclipse.classpath.file.whenMerged {
     entries.removeAll { entry -> entry.path == '/groovy-groovydoc' }
 }
-
-// TODO: Create tasks for cleaning the .settings files created above


Mime
View raw message