eclipse {
project {
- name = "Jalview with gradle build"
+ name = "jalview-js"
natures 'org.eclipse.jdt.core.javanature',
'org.eclipse.jdt.groovy.core.groovyNature',
// 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)
+ }
+ }
}
}
inputs.dir("$classes/$helpDir")
outputs.dir("$helpOutputDir")
}
+
+
+task jalviewjs_unzipFiles {
+ def zipFiles = fileTree(dir: jalviewjs_libjs_dir).include("*.zip")
+ zipFiles += jalviewjs_swingjs_zip
+
+ doLast {
+ zipFiles.each { file_zip ->
+ copy {
+ from zipTree(file_zip)
+ into jalviewjs_site_dir
+ }
+ }
+ }
+
+ inputs.files zipFiles
+ outputs.dir jalviewjs_site_dir
+}
+
+task jalviewjs_copyResources (type: Copy) {
+ from fileTree(dir: jalviewjs_resource_dir)
+ into jalviewjs_site_dir+"/"+jalviewjs_j2s_subdir
+}
+
+task jalviewjs_copySiteResources (type: Copy) {
+ from fileTree(dir: jalviewjs_site_resource_dir)
+ into jalviewjs_site_dir
+}
+
+task jalviewjsBuildSite {
+ dependsOn jalviewjs_unzipFiles
+ dependsOn jalviewjs_copyResources
+ dependsOn jalviewjs_copySiteResources
+}