JAL-3210 Full incrementality with jalviewTranspile, and corrected thrown Exception
authorBen Soares <bsoares@dundee.ac.uk>
Wed, 2 Oct 2019 12:43:13 +0000 (13:43 +0100)
committerBen Soares <bsoares@dundee.ac.uk>
Wed, 2 Oct 2019 12:43:13 +0000 (13:43 +0100)
build.gradle
gradle.properties

index 0a3ff41..2392175 100644 (file)
@@ -301,7 +301,7 @@ equinoxLaunch {
   }
 }
 
-task testIde(type: ) {
+task testIde(type: Exec) {
 }
 
 task ideCopyDropins (type: Copy) {
@@ -527,15 +527,25 @@ task jalviewjsTranspile(type: Exec) {
   doLast {
     if (stdout.toString().contains("Error processing ")) {
       // j2s did not complete transpile
-      throw new TaskExecutionException("Error during transpilation:\n${stderr}\n")
+      throw new GradleException("Error during transpilation:\n${stderr}\nSee eclipse transpile log files '${jalviewjsBuildDir}/${jalviewjs_j2s_stdout}' and '${jalviewjsBuildDir}/${jalviewjs_j2s_stderr}'\n")
     }
   }
 
   inputs.dir(sourceDir)
   outputs.dir(eclipse_bin_dir+"/main")
-  outputs.dir(jalviewjsSiteDir+"/"+jalviewjs_j2s_subdir)
+  outputs.files(
+    fileTree(
+      dir: jalviewjsSiteDir+"/"+jalviewjs_j2s_subdir,
+      includes: [ "**/*.js" ],
+      excludes: [
+        //jalviewjsSiteDir+"/"+jalviewjs_j2s_subdir+"/intervalstore/**",
+        //jalviewjsSiteDir+"/"+jalviewjs_j2s_subdir+"/org/json/**",
+        "intervalstore/**",
+        "org/json/**",
+      ]
+    ).files
+  )
   outputs.file(jalviewjsSiteDir+jalviewjs_server_resource)
-  outputs.upToDateWhen { file(jalviewjsSiteDir+jalviewjs_server_resource).exists() }
 
 }
 
@@ -544,7 +554,9 @@ task jalviewjsTranspile(type: Exec) {
 
 
 
-
+jalviewjsUnzipFiles.mustRunAfter jalviewjsTranspile
+jalviewjsTranspile.mustRunAfter jalviewjsCopyResources
+jalviewjsTranspile.mustRunAfter jalviewjsCopySiteResources
 
 task jalviewjsBuildSite {
   dependsOn jalviewjsSitePath
index 061efb6..bb15697 100644 (file)
@@ -50,8 +50,8 @@ jalviewjs_j2s_subdir = swingjs/j2s
 jalviewjs_j2s_settings_file = dot_j2s
 jalviewjs_j2s_settings = .j2s
 jalviewjs_eclipse_workspace = ../tmp/eclipse-workspace
-#jalviewjs_eclipseBuildArg = build
-jalviewjs_eclipseBuildArg = cleanBuild
+jalviewjs_eclipseBuildArg = build
+#jalviewjs_eclipseBuildArg = cleanBuild
 jalviewjs_server_port = 9001
 jalviewjs_server_wait = 30
 jalviewjs_server_resource = /jalview_bin_Jalview.html