JAL-4492 Exclude applet classes for desktop build. Not tested jalviewjs build yet... bug/JAL-4492_gradle_build_not_excluding_classes
authorBen Soares <b.soares@dundee.ac.uk>
Fri, 22 Nov 2024 16:33:59 +0000 (16:33 +0000)
committerBen Soares <b.soares@dundee.ac.uk>
Fri, 22 Nov 2024 16:33:59 +0000 (16:33 +0000)
build.gradle

index d466891..a350de3 100644 (file)
@@ -596,14 +596,32 @@ ext {
   jalviewjsChromiumUserDir = "${jalviewjsBuildDir}/${jalviewjs_chromium_user_dir}"
   jalviewjsChromiumProfileDir = "${ext.jalviewjsChromiumUserDir}/${jalviewjs_chromium_profile_name}"
 
+  if (!project.hasProperty("jalviewLite")) {
+    jalviewLite = false
+  }
   // ENDEXT
 }
 
+gradle.taskGraph.whenReady { graph ->
+  jalviewLite = graph.hasTask("jalviewjsTranspile")
+}
+
+
 
 sourceSets {
   main {
     java {
       srcDirs sourceDir
+
+      if (! jalviewLite) {
+        exclude "${sourceDir}/jalview/bin/JalviewLite.java"
+        exclude "${sourceDir}/jalview/urls/applet/**"
+        exclude "${sourceDir}/jalview/javascript/*.java"
+        exclude "${sourceDir}/jalview/appletgui/**"
+        exclude "${sourceDir}/com/stevesoft/**"
+        exclude "${sourceDir}/mc_view/Applet*.java"
+      }
+
       outputDir = file(classesDir)
     }
 
@@ -640,6 +658,11 @@ sourceSets {
   test {
     java {
       srcDirs testSourceDir
+
+      if (! jalviewLite) {
+        exclude "${testSourceDir}/jalview/bin/JalviewLiteTest.java"
+      }
+
       outputDir = file(testClassesDir)
     }