import org.apache.tools.ant.filters.ReplaceTokens
import org.gradle.internal.os.OperatingSystem
+import org.gradle.plugins.ide.internal.generator.PropertiesPersistableConfigurationObject
+import org.gradle.api.internal.PropertiesTransformer
+import org.gradle.util.ConfigureUtil
import org.gradle.plugins.ide.eclipse.model.Output
import org.gradle.plugins.ide.eclipse.model.Library
import java.security.MessageDigest
}
+/* hack to change eclipse prefs in .settings files other than org.eclipse.jdt.core.prefs */
+// Class to allow updating arbitrary properties files
+class PropertiesFile extends PropertiesPersistableConfigurationObject {
+ public PropertiesFile(PropertiesTransformer t) { super(t); }
+ @Override protected void load(Properties properties) { }
+ @Override protected void store(Properties properties) { }
+ @Override protected String getDefaultResourceName() { return ""; }
+ // This is necessary, because PropertiesPersistableConfigurationObject fails
+ // if no default properties file exists.
+ @Override public void loadDefaults() { load(new StringBufferInputStream("")); }
+}
+
+// Task to update arbitrary properties files (set outputFile)
+class PropertiesFileTask extends PropertiesGeneratorTask<PropertiesFile> {
+ private final PropertiesFileContentMerger file;
+ public PropertiesFileTask() { file = new PropertiesFileContentMerger(getTransformer()); }
+ protected PropertiesFile create() { return new PropertiesFile(getTransformer()); }
+ protected void configure(PropertiesFile props) {
+ file.getBeforeMerged().execute(props); file.getWhenMerged().execute(props);
+ }
+ public void file(Closure closure) { ConfigureUtil.configure(closure, file); }
+}
+
+task eclipseUIPreferences(type: PropertiesFileTask) {
+ description = "Generate Eclipse additional settings"
+ def filename = "org.eclipse.jdt.ui.prefs"
+ outputFile = "$projectDir/.settings/${filename}" as File
+ file {
+ withProperties {
+ it.load new FileInputStream("$projectDir/utils/eclipse/${filename}" as String)
+ }
+ }
+}
+
+task eclipseGroovyCorePreferences(type: PropertiesFileTask) {
+ description = "Generate Eclipse additional settings"
+ def filename = "org.eclipse.jdt.groovy.core.prefs"
+ outputFile = "$projectDir/.settings/${filename}" as File
+ file {
+ withProperties {
+ it.load new FileInputStream("$projectDir/utils/eclipse/${filename}" as String)
+ }
+ }
+}
+
+task eclipseAllPreferences {
+ dependsOn eclipseJdt
+ dependsOn eclipseUIPreferences
+ dependsOn eclipseGroovyCorePreferences
+}
+
+eclipseUIPreferences.mustRunAfter eclipseJdt
+eclipseGroovyCorePreferences.mustRunAfter eclipseJdt
+
+/* end of eclipse preferences hack */
+
+
task cloverInstr {
// only instrument source, we build test classes as normal
inputs.files files (sourceSets.main.allJava,sourceSets.test.allJava) // , fileTree(dir:"$jalviewDir/$testSourceDir", include: ["**/*.java"]))