import org.gradle.internal.os.OperatingSystem
import org.gradle.plugins.ide.eclipse.model.Output
import org.gradle.plugins.ide.eclipse.model.Library
+import java.security.MessageDigest
import groovy.transform.ExternalizeMethods
} else {
println("HEADLESS BUILD")
}
- /*
+ /* *-/
System.properties.sort { it.key }.each {
key, val -> println("SYSTEM PROPERTY ${key}='${val}'")
}
+ /-* *-/
if (false && IN_ECLIPSE) {
jalviewDir = jalviewDirAbsolutePath
}
commandLine pandoc, '-s', '-o', buildingHTML, '--metadata', 'pagetitle="Building Jalview from Source"', '--toc', '-H', css, buildingMD
} else {
println("Cannot find pandoc. Skipping convert building.md to HTML")
- throw new StopExecutionException()
+ throw new StopExecutionException("Cannot find pandoc. Skipping convert building.md to HTML")
}
}
}
+task jalviewjsIDE_checkJ2sPlugin {
+ group "00 JalviewJS in Eclipse"
+ description "Compare the swingjs/net.sf.j2s.core.jar file with the Eclipse pluing version"
+
+ doFirst {
+ def j2sPlugin = string("${jalviewDir}/${jalviewjs_j2s_plugin}")
+ def j2sPluginFile = file(j2sPlugin)
+ def eclipseHome = System.properties["eclipse.home.location"]
+ if (eclipseHome == null || ! IN_ECLIPSE) {
+ throw new StopExecutionException("Cannot find running Eclipse home from System.properties['eclipse.home.location']. Skipping J2S Plugin Check.")
+ }
+ def eclipseJ2sPlugin = "${eclipseHome}/dropins/${j2sPluginFile.getName()}"
+ def eclipseJ2sPluginFile = file(eclipseJ2sPlugin)
+ if (!eclipseJ2sPluginFile.exists()) {
+ def msg = "Eclipse J2S Plugin is not installed"
+ println(msg)
+ throw new GradleException(msg)
+ }
+
+ def digest = MessageDigest.getInstance("MD5")
+
+ digest.update(j2sPluginFile.text.bytes)
+ def j2sPluginMd5 = new BigInteger(1, digest.digest()).toString(16).padLeft(32, '0')
+
+ digest.update(eclipseJ2sPluginFile.text.bytes)
+ def eclipseJ2sPluginMd5 = new BigInteger(1, digest.digest()).toString(16).padLeft(32, '0')
+
+ if (j2sPluginMd5 != eclipseJ2sPluginMd5) {
+ def msg = "Eclipse J2S Plugin is different to '${j2sPlugin}'"
+ println(msg)
+ throw new GradleException(msg)
+ }
+
+ println("Eclipse J2S Plugin is same as '${j2sPlugin}'")
+ }
+}
+
task jalviewjsIDE_j2sFile {
group "00 JalviewJS in Eclipse"