JAL-3210 ben testing
[jalview.git] / build.gradle
index f02d8ad..19314c2 100644 (file)
@@ -366,27 +366,30 @@ eclipse {
 
       // changing from sourcesets.main.classpath to specific Java version lib
       //sourceSets.test.compileClasspath.each{
-      fileTree(dir: "$jalviewDir/$utilsDir", include: ["**/*.jar"]).each {
-        //if ((it.isDirectory() || ! it.exists()) && ! (it.equals(sourceSets.main.java.outputDir))) {
-        //no longer want to add outputDir as eclipse is using its own output dir in bin/main
-        if (it.isDirectory() || ! it.exists()) {
-          // don't add dirs to classpath
-          return false // groovy "break" in .each loop
-        }
-        def itPath = it.toString()
-        if (itPath.startsWith(jalviewDirAbsolutePath+"/")) {
-          itPath = itPath.substring(jalviewDirAbsolutePath.length()+1)
-        }
-        if (addedLibPath.get(itPath)) {
-          // don't duplicate
-        } else {
-          def lib = new Library(fileReference(itPath))
-          // this doesn't work... yet.  Adding test=true attribute using withXml below
-          //def attrs = new Node(null, 'attributes', ["test":"true"])
-          //lib.appendNode(attrs) //
-          cp.entries += lib
-          addedLibPath.put(itPath, true)
-        }
+
+      if (includeUtilsJars == "true") {
+        fileTree(dir: "$jalviewDir/$utilsDir", include: ["**/*.jar"]).each {
+          //if ((it.isDirectory() || ! it.exists()) && ! (it.equals(sourceSets.main.java.outputDir))) {
+          //no longer want to add outputDir as eclipse is using its own output dir in bin/main
+          if (it.isDirectory() || ! it.exists()) {
+            // don't add dirs to classpath
+            return false // groovy "break" in .each loop
+          }
+          def itPath = it.toString()
+          if (itPath.startsWith(jalviewDirAbsolutePath+"/")) {
+            itPath = itPath.substring(jalviewDirAbsolutePath.length()+1)
+          }
+          if (addedLibPath.get(itPath)) {
+            // don't duplicate
+          } else {
+            def lib = new Library(fileReference(itPath))
+            // this doesn't work... yet.  Adding test=true attribute using withXml below
+            //def attrs = new Node(null, 'attributes', ["test":"true"])
+            //lib.appendNode(attrs) //
+            cp.entries += lib
+            addedLibPath.put(itPath, true)
+          }
+          }
         }
       }