Merge branch 'Jalview-JS/develop' into Jalview-JS/develop_with_gradle_build
[jalview.git] / build.gradle
index bf27433..c9b1332 100644 (file)
@@ -1363,8 +1363,16 @@ task jalviewjsEclipsePaths {
   }
 }
 
-task jalviewjsEclipseCopyDropins {
+task eclipseSetup {
+  dependsOn eclipseProject
+  dependsOn eclipseClasspath
+  dependsOn eclipseJdt
+}
+
+/* using the Copy task below
+task OLDjalviewjsEclipseCopyDropins {
   dependsOn jalviewjsEclipsePaths
+  dependsOn jalviewjsCleanEclipse
   def inputFiles = fileTree(dir: utilsDropinsDir, include: "*.jar")
   def outputDir = eclipseDropinsDir
 
@@ -1382,14 +1390,43 @@ task jalviewjsEclipseCopyDropins {
     }
   }
 }
+*/
 
 // this version (type: Copy) will delete anything in the eclipse dropins folder that isn't in fromDropinsDir
-task NEWjalviewjsEclipseCopyDropins(type: Copy) {
+task jalviewjsEclipseCopyDropins(type: Copy) {
   dependsOn jalviewjsEclipsePaths
+
   from utilsDropinsDir
   into eclipseDropinsDir
 }
 
+// this eclipse -clean doesn't actually work
+task jalviewjsCleanEclipse(type: Exec) {
+  dependsOn eclipseSetup
+  dependsOn jalviewjsEclipsePaths
+  dependsOn jalviewjsEclipseCopyDropins
+
+  executable(eclipseBinary)
+  args(["-nosplash", "--launcher.suppressErrors", "-data", eclipseWorkspace.getPath(), "-clean", "-console", "-consoleLog"])
+  if (eclipseDebug) {
+    args += "-debug"
+  }
+  args += "-l"
+
+  def inputString = """exit
+y
+"""
+  def inputByteStream = new ByteArrayInputStream(inputString.getBytes())
+  standardInput = inputByteStream
+
+  doFirst {
+    println("CLEAN ECLIPSE_DEBUG=${eclipseDebug}")
+  }
+}
+/* not really working yet
+jalviewjsEclipseCopyDropins.finalizedBy jalviewjsCleanEclipse
+*/
+
 task jalviewjsUnzipFiles {
   dependsOn jalviewjsSitePath
 
@@ -1472,9 +1509,7 @@ task jalviewjsCopySiteResources (type: Copy) {
 }
 
 task jalviewjsProjectImport(type: Exec) {
-  dependsOn eclipseProject
-  dependsOn eclipseClasspath
-  dependsOn eclipseJdt
+  dependsOn eclipseSetup
   dependsOn jalviewjsEclipsePaths
   dependsOn jalviewjsEclipseSetup