1 import org.apache.tools.ant.filters.ReplaceTokens
2 import org.gradle.internal.os.OperatingSystem
3 import org.gradle.plugins.ide.eclipse.model.Output
4 import org.gradle.plugins.ide.eclipse.model.Library
5 import java.security.MessageDigest
7 import groovy.transform.ExternalizeMethods
11 classpath 'org.openclover:clover:4.3.1'
19 id 'com.github.johnrengelman.shadow' version '4.0.3'
20 id 'com.install4j.gradle' version '7.0.9'
21 id 'com.dorongold.task-tree' version '1.4' // only needed to display task dependency tree with gradle task1 [task2 ...] taskTree
34 compile 'org.apache.commons:commons-compress:1.18'
38 // in ext the values are cast to Object. Ensure string values are cast as String (and not GStringImpl) for later use
39 def string(Object o) {
45 jalviewDirAbsolutePath = file(jalviewDir).getAbsolutePath()
46 jalviewDirRelativePath = jalviewDir
48 // local build environment properties
49 def localProps = "${jalviewDirAbsolutePath}/local.properties"
50 if (file(localProps).exists()) {
52 def p = new Properties()
53 def localPropsFIS = new FileInputStream(localProps)
58 def over = getProperty(key) != null
61 println("Overriding property '${key}' with local.properties value '${val}'")
64 } catch (Exception e) {
65 System.out.println("Exception reading local.properties")
69 // this property set when running Eclipse headlessly
70 j2sHeadlessBuildProperty = string("net.sf.j2s.core.headlessbuild")
71 // this property set by Eclipse
72 eclipseApplicationProperty = string("eclipse.application")
73 // CHECK IF RUNNING FROM WITHIN ECLIPSE
74 def eclipseApplicationPropertyVal = System.properties[eclipseApplicationProperty]
75 IN_ECLIPSE = eclipseApplicationPropertyVal != null && eclipseApplicationPropertyVal.startsWith("org.eclipse.ui.")
76 // BUT WITHOUT THE HEADLESS BUILD PROPERTY SET
77 if (System.properties[j2sHeadlessBuildProperty].equals("true")) {
78 println("Setting IN_ECLIPSE to ${IN_ECLIPSE} as System.properties['${j2sHeadlessBuildProperty}'] == '${System.properties[j2sHeadlessBuildProperty]}'")
82 println("WITHIN ECLIPSE IDE")
84 println("HEADLESS BUILD")
87 System.properties.sort { it.key }.each {
88 key, val -> println("SYSTEM PROPERTY ${key}='${val}'")
91 if (false && IN_ECLIPSE) {
92 jalviewDir = jalviewDirAbsolutePath
97 bareSourceDir = string(source_dir)
98 sourceDir = string("${jalviewDir}/${bareSourceDir}")
99 resourceDir = string("${jalviewDir}/${resource_dir}")
100 bareTestSourceDir = string(test_source_dir)
101 testSourceDir = string("${jalviewDir}/${bareTestSourceDir}")
104 cloverInstrDir = file("${buildDir}/${cloverSourcesInstrDir}")
105 classesDir = string("${jalviewDir}/${classes_dir}")
106 if (clover.equals("true")) {
108 classesDir = string("${buildDir}/${cloverClassesDir}")
111 classesDir = string("${jalviewDir}/${classes_dir}")
116 getdownWebsiteDir = string("${jalviewDir}/${getdown_website_dir}/${JAVA_VERSION}")
117 getdownDir = string("")
118 reportRsyncCmd = false
120 buildProperties = build_properties_file
121 getdownLauncher = string("${jalviewDir}/${getdown_lib_dir}/${getdown_launcher}")
125 // TODO: get bamboo build artifact URL for getdown artifacts
126 getdown_channel_base = bamboo_channelbase
127 getdown_channel_name = string("${bamboo_planKey}/${JAVA_VERSION}")
128 getdown_app_base = string("${bamboo_channelbase}/${bamboo_planKey}${bamboo_getdown_channel_suffix}/${JAVA_VERSION}")
129 getdown_app_dir = getdown_app_dir_alt
130 buildProperties = string("${classesDir}/${build_properties_file}")
134 getdown_channel_name = CHANNEL.toLowerCase()
135 getdownDir = string("${getdown_channel_name}/${JAVA_VERSION}")
136 getdown_app_base = string("${getdown_channel_base}/${getdownDir}")
137 getdown_app_dir = getdown_app_dir_release
138 buildProperties = string("${classesDir}/${build_properties_file}")
139 reportRsyncCommand = true
143 getdown_channel_name = CHANNEL.toLowerCase()+"/${JALVIEW_VERSION}"
144 getdownDir = string("${getdown_channel_name}/${JAVA_VERSION}")
145 getdown_app_base = string("${getdown_channel_base}/${getdownDir}")
146 getdown_app_dir = getdown_app_dir_alt
147 if (!file("${ARCHIVEDIR}/${packageDir}").exists()) {
148 print "Must provide an ARCHIVEDIR value to produce an archive distribution"
151 packageDir = string("${ARCHIVEDIR}/${packageDir}")
152 buildProperties = string("${ARCHIVEDIR}/${classes_dir}/${build_properties_file}")
155 reportRsyncCommand = true
159 getdown_channel_name = string("archive/${JALVIEW_VERSION}")
160 getdownDir = string("${getdown_channel_name}/${JAVA_VERSION}")
161 getdown_app_base = file(getdownWebsiteDir).toURI().toString()
162 getdown_app_dir = getdown_app_dir_alt
163 if (!file("${ARCHIVEDIR}/${packageDir}").exists()) {
164 print "Must provide an ARCHIVEDIR value to produce an archive distribution"
167 packageDir = string("${ARCHIVEDIR}/${packageDir}")
168 buildProperties = string("${ARCHIVEDIR}/${classes_dir}/${build_properties_file}")
171 reportRsyncCommand = true
172 getdownLauncher = string("${jalviewDir}/${getdown_lib_dir}/${getdown_launcher_local}")
176 getdown_channel_name = CHANNEL.toLowerCase()
177 getdownDir = string("${getdown_channel_name}/${JAVA_VERSION}")
178 getdown_app_base = string("${getdown_channel_base}/${getdownDir}")
179 getdown_app_dir = getdown_app_dir_alt
180 buildProperties = string("${classesDir}/${build_properties_file}")
181 reportRsyncCommand = true
185 getdown_channel_name = CHANNEL.toLowerCase()
186 getdownDir = string("${getdown_channel_name}/${JAVA_VERSION}")
187 getdown_app_base = string("${getdown_channel_base}/${getdownDir}")
188 getdown_app_dir = getdown_app_dir_alt
189 buildProperties = string("${classesDir}/${build_properties_file}")
190 reportRsyncCommand = true
193 case ~/^SCRATCH(|-[-\w]*)$/:
194 getdown_channel_name = CHANNEL
195 getdownDir = string("${getdown_channel_name}/${JAVA_VERSION}")
196 getdown_app_base = string("${getdown_channel_base}/${getdownDir}")
197 getdown_app_dir = getdown_app_dir_alt
198 buildProperties = string("${classesDir}/${build_properties_file}")
199 reportRsyncCommand = true
203 getdown_app_base = file(getdownWebsiteDir).toURI().toString()
204 getdown_app_dir = getdown_app_dir_alt
205 buildProperties = string("${classesDir}/${build_properties_file}")
206 getdownLauncher = string("${jalviewDir}/${getdown_lib_dir}/${getdown_launcher_local}")
209 default: // something wrong specified
210 print("CHANNEL must be one of BUILD, RELEASE, ARCHIVE, DEVELOP, TEST-RELEASE, SCRATCH-..., LOCAL [default]")
216 getdownAppDir = string("${getdownWebsiteDir}/${getdown_app_dir}")
217 //getdownJ11libDir = "${getdownWebsiteDir}/${getdown_j11lib_dir}"
218 getdownResourceDir = string("${getdownWebsiteDir}/${getdown_resource_dir}")
219 getdownInstallDir = string("${getdownWebsiteDir}/${getdown_install_dir}")
220 getdownFilesDir = string("${jalviewDir}/${getdown_files_dir}/${JAVA_VERSION}/")
221 getdownFilesInstallDir = string("${getdownFilesDir}/${getdown_install_dir}")
222 /* compile without modules -- using classpath libraries
223 modules_compileClasspath = fileTree(dir: "${jalviewDir}/${j11modDir}", include: ["*.jar"])
224 modules_runtimeClasspath = modules_compileClasspath
227 gitBranch = string("")
229 println("Using a ${CHANNEL} profile.")
231 additional_compiler_args = []
232 // configure classpath/args for j8/j11 compilation
233 if (JAVA_VERSION.equals("1.8")) {
234 JAVA_INTEGER_VERSION = string("8")
237 libDistDir = j8libDir
238 compile_source_compatibility = 1.8
239 compile_target_compatibility = 1.8
240 // these are getdown.txt properties defined dependent on the JAVA_VERSION
241 getdown_alt_java_min_version = getdown_alt_java8_min_version
242 getdown_alt_java_max_version = getdown_alt_java8_max_version
243 // this property is assigned below and expanded to multiple lines in the getdown task
244 getdown_alt_multi_java_location = getdown_alt_java8_txt_multi_java_location
245 // this property is for the Java library used in eclipse
246 eclipse_java_runtime_name = string("JavaSE-1.8")
247 } else if (JAVA_VERSION.equals("11")) {
248 JAVA_INTEGER_VERSION = string("11")
250 libDistDir = j11libDir
251 compile_source_compatibility = 11
252 compile_target_compatibility = 11
253 getdown_alt_java_min_version = getdown_alt_java11_min_version
254 getdown_alt_java_max_version = getdown_alt_java11_max_version
255 getdown_alt_multi_java_location = getdown_alt_java11_txt_multi_java_location
256 eclipse_java_runtime_name = string("JavaSE-11")
257 /* compile without modules -- using classpath libraries
258 additional_compiler_args += [
259 '--module-path', modules_compileClasspath.asPath,
260 '--add-modules', j11modules
263 } else if (JAVA_VERSION.equals("12") || JAVA_VERSION.equals("13")) {
264 JAVA_INTEGER_VERSION = JAVA_VERSION
266 libDistDir = j11libDir
267 compile_source_compatibility = JAVA_VERSION
268 compile_target_compatibility = JAVA_VERSION
269 getdown_alt_java_min_version = getdown_alt_java11_min_version
270 getdown_alt_java_max_version = getdown_alt_java11_max_version
271 getdown_alt_multi_java_location = getdown_alt_java11_txt_multi_java_location
272 eclipse_java_runtime_name = string("JavaSE-11")
273 /* compile without modules -- using classpath libraries
274 additional_compiler_args += [
275 '--module-path', modules_compileClasspath.asPath,
276 '--add-modules', j11modules
280 throw new GradleException("JAVA_VERSION=${JAVA_VERSION} not currently supported by Jalview")
285 macosJavaVMDir = string("${System.env.HOME}/buildtools/jre/openjdk-java_vm/getdown/macos-jre${JAVA_VERSION}/jre")
286 macosJavaVMTgz = string("${System.env.HOME}/buildtools/jre/openjdk-java_vm/install4j/tgz/macos-jre${JAVA_VERSION}.tar.gz")
287 windowsJavaVMDir = string("${System.env.HOME}/buildtools/jre/openjdk-java_vm/getdown/windows-jre${JAVA_VERSION}/jre")
288 windowsJavaVMTgz = string("${System.env.HOME}/buildtools/jre/openjdk-java_vm/install4j/tgz/windows-jre${JAVA_VERSION}.tar.gz")
289 install4jDir = string("${jalviewDir}/${install4jResourceDir}")
290 install4jConfFileName = string("jalview-installers-java${JAVA_VERSION}.install4j")
291 install4jConfFile = string("${install4jDir}/${install4jConfFileName}")
294 buildingHTML = string("${jalviewDir}/${docDir}/building.html")
295 helpFile = string("${classesDir}/${help_dir}/help.jhm")
296 helpParentDir = string("${jalviewDir}/${help_parent_dir}")
297 helpDir = string("${help_dir}")
298 helpSourceDir = string("${helpParentDir}/${helpDir}")
301 relativeBuildDir = file(jalviewDirAbsolutePath).toPath().relativize(buildDir.toPath())
302 jalviewjsBuildDir = string("${relativeBuildDir}/jalviewjs")
303 jalviewjsSiteDir = string("${jalviewjsBuildDir}/${jalviewjs_site_dir}")
305 jalviewjsTransferSiteJsDir = string(jalviewjsSiteDir)
307 jalviewjsTransferSiteJsDir = string("${jalviewjsBuildDir}/tmp/${jalviewjs_site_dir}_js")
309 jalviewjsTransferSiteLibDir = string("${jalviewjsBuildDir}/tmp/${jalviewjs_site_dir}_lib")
310 jalviewjsTransferSiteSwingJsDir = string("${jalviewjsBuildDir}/tmp/${jalviewjs_site_dir}_swingjs")
311 jalviewjsTransferSiteCoreDir = string("${jalviewjsBuildDir}/tmp/${jalviewjs_site_dir}_core")
312 jalviewjsJalviewCoreHtmlFile = string("")
313 jalviewjsJalviewCoreName = string(jalviewjs_core_name)
314 jalviewjsCoreClasslists = []
315 jalviewjsJalviewTemplateName = string(jalviewjs_name)
316 jalviewjsJ2sSettingsFileName = string("${jalviewDir}/${jalviewjs_j2s_settings}")
317 jalviewjsJ2sProps = null
319 eclipseWorkspace = null
320 eclipseBinary = string("")
321 eclipseVersion = string("")
331 outputDir = file(classesDir)
338 jar.destinationDir = file("${jalviewDir}/${packageDir}")
340 compileClasspath = files(sourceSets.main.java.outputDir)
341 compileClasspath += fileTree(dir: "${jalviewDir}/${libDir}", include: ["*.jar"])
343 runtimeClasspath = compileClasspath
348 srcDirs = [ cloverInstrDir ]
349 outputDir = file("${buildDir}/${cloverClassesDir}")
353 srcDirs = sourceSets.main.resources.srcDirs
355 compileClasspath = configurations.cloverRuntime + files( sourceSets.clover.java.outputDir )
356 compileClasspath += files(sourceSets.main.java.outputDir)
357 compileClasspath += sourceSets.main.compileClasspath
358 compileClasspath += fileTree(dir: "${jalviewDir}/${utilsDir}", include: ["**/*.jar"])
359 compileClasspath += fileTree(dir: "${jalviewDir}/${libDir}", include: ["*.jar"])
361 runtimeClasspath = compileClasspath
366 srcDirs testSourceDir
367 outputDir = file("${jalviewDir}/${testOutputDir}")
371 srcDirs = sourceSets.main.resources.srcDirs
374 compileClasspath = files( sourceSets.test.java.outputDir )
377 compileClasspath += sourceSets.clover.compileClasspath
379 compileClasspath += files(sourceSets.main.java.outputDir)
382 compileClasspath += fileTree(dir: "${jalviewDir}/${libDir}", include: ["*.jar"])
383 compileClasspath += fileTree(dir: "${jalviewDir}/${utilsDir}/testnglibs", include: ["**/*.jar"])
384 compileClasspath += fileTree(dir: "${jalviewDir}/${utilsDir}/testlibs", include: ["**/*.jar"])
386 runtimeClasspath = compileClasspath
394 cloverCompile 'org.openclover:clover:4.3.1'
395 testCompile 'org.openclover:clover:4.3.1'
402 cloverRuntime.extendsFrom cloverCompile
407 name = eclipse_project_name
409 natures 'org.eclipse.jdt.core.javanature',
410 'org.eclipse.jdt.groovy.core.groovyNature',
411 'org.eclipse.buildship.core.gradleprojectnature'
413 buildCommand 'org.eclipse.jdt.core.javabuilder'
414 buildCommand 'org.eclipse.buildship.core.gradleprojectbuilder'
418 //defaultOutputDir = sourceSets.main.java.outputDir
421 if (it.isCanBeResolved()) {
426 minusConfigurations += removeThese
427 plusConfigurations = [ ]
431 def removeTheseToo = []
432 HashMap<String, Boolean> alreadyAddedSrcPath = new HashMap<>();
433 cp.entries.each { entry ->
434 if (entry.kind == 'src') {
435 if (alreadyAddedSrcPath.getAt(entry.path) || !(entry.path == bareSourceDir || entry.path == bareTestSourceDir)) {
436 removeTheseToo += entry
438 alreadyAddedSrcPath.putAt(entry.path, true)
442 cp.entries.removeAll(removeTheseToo)
444 cp.entries += new Output("${eclipse_bin_dir}/main")
445 if (file(helpSourceDir).isDirectory()) {
446 cp.entries += new Library(fileReference(helpSourceDir))
448 if (file(resourceDir).isDirectory()) {
449 cp.entries += new Library(fileReference(resourceDir))
452 HashMap<String, Boolean> alreadyAddedLibPath = new HashMap<>();
454 sourceSets.main.compileClasspath.findAll { it.name.endsWith(".jar") }.each {
455 //don't want to add outputDir as eclipse is using its own output dir in bin/main
456 if (it.isDirectory() || ! it.exists()) {
457 // don't add dirs to classpath
460 def itPath = it.toString()
461 if (itPath.startsWith("${jalviewDirAbsolutePath}/")) {
462 // make relative path
463 itPath = itPath.substring(jalviewDirAbsolutePath.length()+1)
465 if (alreadyAddedLibPath.get(itPath)) {
466 //println("Not adding duplicate entry "+itPath)
468 //println("Adding entry "+itPath)
469 cp.entries += new Library(fileReference(itPath))
470 alreadyAddedLibPath.put(itPath, true)
474 //fileTree(dir: "$jalviewDir/$utilsDir", include: ["test*/*.jar"]).each {
475 sourceSets.test.compileClasspath.findAll { it.name.endsWith(".jar") }.any {
476 //no longer want to add outputDir as eclipse is using its own output dir in bin/main
477 if (it.isDirectory() || ! it.exists()) {
478 // don't add dirs to classpath
479 return false // groovy "continue" in .any closure
482 def itPath = it.toString()
483 if (itPath.startsWith("${jalviewDirAbsolutePath}/")) {
484 itPath = itPath.substring(jalviewDirAbsolutePath.length()+1)
486 if (alreadyAddedLibPath.get(itPath)) {
489 def lib = new Library(fileReference(itPath))
490 lib.entryAttributes["test"] = "true"
492 alreadyAddedLibPath.put(itPath, true)
500 containers 'org.eclipse.buildship.core.gradleclasspathcontainer'
505 // for the IDE, use java 11 compatibility
506 sourceCompatibility = compile_source_compatibility
507 targetCompatibility = compile_target_compatibility
508 javaRuntimeName = eclipse_java_runtime_name
510 // add in jalview project specific properties/preferences into eclipse core preferences
512 withProperties { props ->
513 def jalview_prefs = new Properties()
514 def ins = new FileInputStream("${jalviewDirAbsolutePath}/${eclipse_extra_jdt_prefs_file}")
515 jalview_prefs.load(ins)
517 jalview_prefs.forEach { t, v ->
518 if (props.getAt(t) == null) {
528 // Don't want these to be activated if in headless build
529 synchronizationTasks "eclipseSynchronizationTask"
530 autoBuildTasks "eclipseAutoBuildTask"
536 // only instrument source, we build test classes as normal
537 inputs.files files (sourceSets.main.allJava) // , fileTree(dir: testSourceDir, include: ["**/*.java"]))
538 outputs.dir cloverInstrDir
541 delete cloverInstrDir
542 def argsList = ["--initstring", "${buildDir}/clover/clover.db",
543 "-d", "${buildDir}/${cloverSourcesInstrDir}"]
544 argsList.addAll(inputs.files.files.collect({ file ->
547 String[] args = argsList.toArray()
548 println("About to instrument "+args.length +" files")
549 com.atlassian.clover.CloverInstr.mainImpl(args)
555 group = "Verification"
556 description = "Createst the Clover report"
557 inputs.dir "${buildDir}/clover"
558 outputs.dir "${reportsDir}/clover"
560 file("${buildDir}/clover/clover.db").exists()
563 def argsList = ["--initstring", "${buildDir}/clover/clover.db",
564 "-o", "${reportsDir}/clover"]
565 String[] args = argsList.toArray()
566 com.atlassian.clover.reporters.html.HtmlReporter.runReport(args)
568 // and generate ${reportsDir}/clover/clover.xml
569 args = ["--initstring", "${buildDir}/clover/clover.db",
570 "-o", "${reportsDir}/clover/clover.xml"].toArray()
571 com.atlassian.clover.reporters.xml.XMLReporter.runReport(args)
580 sourceCompatibility = compile_source_compatibility
581 targetCompatibility = compile_target_compatibility
582 options.compilerArgs = additional_compiler_args
583 print ("Setting target compatibility to "+targetCompatibility+"\n")
591 dependsOn compileCloverJava
592 classpath += configurations.cloverRuntime
594 classpath += sourceSets.main.runtimeClasspath
597 sourceCompatibility = compile_source_compatibility
598 targetCompatibility = compile_target_compatibility
599 options.compilerArgs = additional_compiler_args
600 print ("Setting target compatibility to "+targetCompatibility+"\n")
608 sourceCompatibility = compile_source_compatibility
609 targetCompatibility = compile_target_compatibility
610 options.compilerArgs += additional_compiler_args
611 print ("Setting target compatibility to "+targetCompatibility+"\n")
613 classpath += configurations.cloverRuntime
619 delete sourceSets.main.java.outputDir
626 delete sourceSets.test.java.outputDir
627 delete cloverInstrDir
632 // format is a string like date.format("dd MMMM yyyy")
633 def getDate(format) {
634 def date = new Date()
635 return date.format(format)
640 def hashStdOut = new ByteArrayOutputStream()
642 commandLine "git", "rev-parse", "--short", "HEAD"
643 standardOutput = hashStdOut
647 def branchStdOut = new ByteArrayOutputStream()
649 commandLine "git", "rev-parse", "--abbrev-ref", "HEAD"
650 standardOutput = branchStdOut
654 gitHash = hashStdOut.toString().trim()
655 gitBranch = branchStdOut.toString().trim()
657 outputs.upToDateWhen { false }
661 task createBuildProperties(type: WriteProperties) {
663 inputs.dir(sourceDir)
664 inputs.dir(resourceDir)
665 file(buildProperties).getParentFile().mkdirs()
666 outputFile (buildProperties)
667 // taking time specific comment out to allow better incremental builds
668 comment "--Jalview Build Details--\n"+getDate("yyyy-MM-dd HH:mm:ss")
669 //comment "--Jalview Build Details--\n"+getDate("yyyy-MM-dd")
670 property "BUILD_DATE", getDate("HH:mm:ss dd MMMM yyyy")
671 property "VERSION", JALVIEW_VERSION
672 property "INSTALLATION", INSTALLATION+" git-commit:"+gitHash+" ["+gitBranch+"]"
673 outputs.file(outputFile)
677 task cleanBuildingHTML(type: Delete) {
684 task convertBuildingMD(type: Exec) {
685 dependsOn cleanBuildingHTML
686 def buildingMD = "${jalviewDir}/${docDir}/building.md"
687 def css = "${jalviewDir}/${docDir}/github.css"
690 pandoc_exec.split(",").each {
691 if (file(it.trim()).exists()) {
697 def hostname = "hostname".execute().text.trim()
698 if ((pandoc == null || ! file(pandoc).exists()) && hostname.equals("jv-bamboo")) {
699 pandoc = System.getProperty("user.home")+"/buildtools/pandoc/bin/pandoc"
703 if (pandoc != null && file(pandoc).exists()) {
704 commandLine pandoc, '-s', '-o', buildingHTML, '--metadata', 'pagetitle="Building Jalview from Source"', '--toc', '-H', css, buildingMD
706 println("Cannot find pandoc. Skipping convert building.md to HTML")
707 throw new StopExecutionException("Cannot find pandoc. Skipping convert building.md to HTML")
713 inputs.file(buildingMD)
715 outputs.file(buildingHTML)
726 task syncDocs(type: Sync) {
727 dependsOn convertBuildingMD
728 def syncDir = "${classesDir}/${docDir}"
729 from fileTree("${jalviewDir}/${docDir}")
735 task copyHelp(type: Copy) {
736 def inputDir = helpSourceDir
737 def outputDir = "${classesDir}/${helpDir}"
742 filter(ReplaceTokens,
746 'Version-Rel': JALVIEW_VERSION,
747 'Year-Rel': getDate("yyyy")
759 outputs.files(helpFile)
760 outputs.dir(outputDir)
764 task syncLib(type: Sync) {
765 def syncDir = "${classesDir}/${libDistDir}"
766 from fileTree("${jalviewDir}/${libDistDir}")
771 task syncResources(type: Sync) {
782 dependsOn syncResources
788 //testReportDirName = "test-reports" // note that test workingDir will be $jalviewDir
791 dependsOn compileJava
793 dependsOn cloverInstr
797 print("Running tests " + (use_clover?"WITH":"WITHOUT") + " clover [clover="+use_clover+"]\n")
801 includeGroups testngGroups
803 useDefaultListeners=true
806 workingDir = jalviewDir
807 //systemProperties 'clover.jar' System.properties.clover.jar
808 sourceCompatibility = compile_source_compatibility
809 targetCompatibility = compile_target_compatibility
810 jvmArgs += additional_compiler_args
815 task buildIndices(type: JavaExec) {
817 classpath = sourceSets.main.compileClasspath
818 main = "com.sun.java.help.search.Indexer"
819 workingDir = "${classesDir}/${helpDir}"
822 inputs.dir("${workingDir}/${argDir}")
824 outputs.dir("${classesDir}/doc")
825 outputs.dir("${classesDir}/help")
826 outputs.file("${workingDir}/JavaHelpSearch/DOCS")
827 outputs.file("${workingDir}/JavaHelpSearch/DOCS.TAB")
828 outputs.file("${workingDir}/JavaHelpSearch/OFFSETS")
829 outputs.file("${workingDir}/JavaHelpSearch/POSITIONS")
830 outputs.file("${workingDir}/JavaHelpSearch/SCHEMA")
831 outputs.file("${workingDir}/JavaHelpSearch/TMAP")
835 task compileLinkCheck(type: JavaCompile) {
837 classpath = files("${jalviewDir}/${utilsDir}")
838 destinationDir = file("${jalviewDir}/${utilsDir}")
839 source = fileTree(dir: "${jalviewDir}/${utilsDir}", include: ["HelpLinksChecker.java", "BufferedLineReader.java"])
841 inputs.file("${jalviewDir}/${utilsDir}/HelpLinksChecker.java")
842 inputs.file("${jalviewDir}/${utilsDir}/HelpLinksChecker.java")
843 outputs.file("${jalviewDir}/${utilsDir}/HelpLinksChecker.class")
844 outputs.file("${jalviewDir}/${utilsDir}/BufferedLineReader.class")
848 task linkCheck(type: JavaExec) {
849 dependsOn prepare, compileLinkCheck
851 def helpLinksCheckerOutFile = file("${jalviewDir}/${utilsDir}/HelpLinksChecker.out")
852 classpath = files("${jalviewDir}/${utilsDir}")
853 main = "HelpLinksChecker"
854 workingDir = jalviewDir
855 def help = "${classesDir}/${helpDir}"
856 args = [ "${classesDir}/${helpDir}", "-nointernet" ]
858 def outFOS = new FileOutputStream(helpLinksCheckerOutFile, false) // false == don't append
860 standardOutput = new org.apache.tools.ant.util.TeeOutputStream(
863 errorOutput = new org.apache.tools.ant.util.TeeOutputStream(
867 inputs.dir("${classesDir}/${helpDir}")
868 outputs.file(helpLinksCheckerOutFile)
871 // import the pubhtmlhelp target
872 ant.properties.basedir = "${jalviewDir}"
873 ant.properties.helpBuildDir = "${jalviewDirAbsolutePath}/${classes_dir}/${helpDir}"
874 ant.importBuild "${utilsDir}/publishHelp.xml"
877 task cleanPackageDir(type: Delete) {
879 delete fileTree(dir: "${jalviewDir}/${packageDir}", include: "*.jar")
885 dependsOn buildIndices
886 dependsOn createBuildProperties
889 attributes "Main-Class": mainClass,
890 "Permissions": "all-permissions",
891 "Application-Name": "Jalview Desktop",
892 "Codebase": application_codebase
895 destinationDir = file("${jalviewDir}/${packageDir}")
896 archiveName = rootProject.name+".jar"
904 inputs.dir(classesDir)
905 outputs.file("${jalviewDir}/${packageDir}/${archiveName}")
909 task copyJars(type: Copy) {
910 from fileTree(dir: classesDir, include: "**/*.jar").files
911 into "${jalviewDir}/${packageDir}"
915 // doing a Sync instead of Copy as Copy doesn't deal with "outputs" very well
916 task syncJars(type: Sync) {
917 from fileTree(dir: "${jalviewDir}/${libDistDir}", include: "**/*.jar").files
918 into "${jalviewDir}/${packageDir}"
920 include jar.archiveName
927 description = "Put all required libraries in dist"
928 // order of "cleanPackageDir", "copyJars", "jar" important!
929 jar.mustRunAfter cleanPackageDir
930 syncJars.mustRunAfter cleanPackageDir
931 dependsOn cleanPackageDir
934 outputs.dir("${jalviewDir}/${packageDir}")
939 dependsOn cleanPackageDir
945 group = "distribution"
949 from ("${jalviewDir}/${libDistDir}") {
953 attributes 'Implementation-Version': JALVIEW_VERSION
955 mainClassName = shadowJarMainClass
957 classifier = "all-"+JALVIEW_VERSION+"-j"+JAVA_VERSION
962 task getdownWebsite() {
963 group = "distribution"
964 description = "Create the getdown minimal app folder, and website folder for this version of jalview. Website folder also used for offline app installer"
969 def getdownWebsiteResourceFilenames = []
970 def getdownTextString = ""
971 def getdownResourceDir = getdownResourceDir
972 def getdownAppDir = getdownAppDir
973 def getdownResourceFilenames = []
976 // clean the getdown website and files dir before creating getdown folders
977 delete getdownWebsiteDir
978 delete getdownFilesDir
982 rename(build_properties_file, getdown_build_properties)
985 getdownWebsiteResourceFilenames += "${getdown_app_dir}/${getdown_build_properties}"
987 // go through properties looking for getdown_txt_...
988 def props = project.properties.sort { it.key }
989 if (getdown_alt_java_min_version.length() > 0) {
990 props.put("getdown_txt_java_min_version", getdown_alt_java_min_version)
992 if (getdown_alt_java_max_version.length() > 0) {
993 props.put("getdown_txt_java_max_version", getdown_alt_java_max_version)
995 props.put("getdown_txt_multi_java_location", getdown_alt_multi_java_location)
997 props.put("getdown_txt_appbase", getdown_app_base)
998 props.each{ prop, val ->
999 if (prop.startsWith("getdown_txt_") && val != null) {
1000 if (prop.startsWith("getdown_txt_multi_")) {
1001 def key = prop.substring(18)
1002 val.split(",").each{ v ->
1003 def line = "${key} = ${v}\n"
1004 getdownTextString += line
1007 // file values rationalised
1008 if (val.indexOf('/') > -1 || prop.startsWith("getdown_txt_resource")) {
1010 if (val.indexOf('/') == 0) {
1013 } else if (val.indexOf('/') > 0) {
1014 // relative path (relative to jalviewDir)
1015 r = file( "${jalviewDir}/${val}" )
1018 val = "${getdown_resource_dir}/" + r.getName()
1019 getdownWebsiteResourceFilenames += val
1020 getdownResourceFilenames += r.getPath()
1023 if (! prop.startsWith("getdown_txt_resource")) {
1024 def line = prop.substring(12) + " = ${val}\n"
1025 getdownTextString += line
1031 getdownWebsiteResourceFilenames.each{ filename ->
1032 getdownTextString += "resource = ${filename}\n"
1034 getdownResourceFilenames.each{ filename ->
1037 into getdownResourceDir
1042 fileTree(file(packageDir)).each{ f ->
1043 if (f.isDirectory()) {
1044 def files = fileTree(dir: f, include: ["*"]).getFiles()
1046 } else if (f.exists()) {
1050 codeFiles.sort().each{f ->
1051 def name = f.getName()
1052 def line = "code = ${getdown_app_dir}/${name}\n"
1053 getdownTextString += line
1060 // NOT USING MODULES YET, EVERYTHING SHOULD BE IN dist
1062 if (JAVA_VERSION.equals("11")) {
1063 def j11libFiles = fileTree(dir: "${jalviewDir}/${j11libDir}", include: ["*.jar"]).getFiles()
1064 j11libFiles.sort().each{f ->
1065 def name = f.getName()
1066 def line = "code = ${getdown_j11lib_dir}/${name}\n"
1067 getdownTextString += line
1070 into getdownJ11libDir
1076 // getdown-launcher.jar should not be in main application class path so the main application can move it when updated. Listed as a resource so it gets updated.
1077 //getdownTextString += "class = " + file(getdownLauncher).getName() + "\n"
1078 getdownTextString += "resource = ${getdown_launcher_new}\n"
1079 getdownTextString += "class = ${mainClass}\n"
1081 def getdown_txt = file("${getdownWebsiteDir}/getdown.txt")
1082 getdown_txt.write(getdownTextString)
1084 def launch_jvl = file("${getdownWebsiteDir}/${getdown_launch_jvl}")
1085 launch_jvl.write("appbase="+props.get("getdown_txt_appbase"))
1088 from getdownLauncher
1089 rename(file(getdownLauncher).getName(), getdown_launcher_new)
1090 into getdownWebsiteDir
1094 from getdownLauncher
1095 if (file(getdownLauncher).getName() != getdown_launcher) {
1096 rename(file(getdownLauncher).getName(), getdown_launcher)
1098 into getdownWebsiteDir
1101 if (! (CHANNEL.startsWith("ARCHIVE") || CHANNEL.startsWith("DEVELOP"))) {
1104 from getdownLauncher
1105 from "${getdownWebsiteDir}/${getdown_build_properties}"
1106 if (file(getdownLauncher).getName() != getdown_launcher) {
1107 rename(file(getdownLauncher).getName(), getdown_launcher)
1109 into getdownInstallDir
1113 from getdownInstallDir
1114 into getdownFilesInstallDir
1121 from getdownLauncher
1122 from "${getdownWebsiteDir}/${getdown_build_properties}"
1123 if (file(getdownLauncher).getName() != getdown_launcher) {
1124 rename(file(getdownLauncher).getName(), getdown_launcher)
1126 into getdownFilesDir
1130 from getdownResourceDir
1131 into "${getdownFilesDir}/${getdown_resource_dir}"
1136 inputs.dir("${jalviewDir}/${packageDir}")
1138 outputs.dir(getdownWebsiteDir)
1139 outputs.dir(getdownFilesDir)
1143 task getdownDigest(type: JavaExec) {
1144 group = "distribution"
1145 description = "Digest the getdown website folder"
1146 dependsOn getdownWebsite
1148 classpath = files("${getdownWebsiteDir}/${getdown_launcher}")
1150 main = "com.threerings.getdown.tools.Digester"
1151 args getdownWebsiteDir
1152 inputs.dir(getdownWebsiteDir)
1153 outputs.file("${getdownWebsiteDir}/digest2.txt")
1158 group = "distribution"
1159 description = "Create the minimal and full getdown app folder for installers and website and create digest file"
1160 dependsOn getdownDigest
1162 if (reportRsyncCommand) {
1163 def fromDir = getdownWebsiteDir + (getdownWebsiteDir.endsWith('/')?'':'/')
1164 def toDir = "${getdown_rsync_dest}/${getdownDir}" + (getdownDir.endsWith('/')?'':'/')
1165 println "LIKELY RSYNC COMMAND:"
1166 println "mkdir -p '$toDir'\nrsync -avh --delete '$fromDir' '$toDir'"
1167 if (RUNRSYNC == "true") {
1169 commandLine "mkdir", "-p", toDir
1172 commandLine "rsync", "-avh", "--delete", fromDir, toDir
1182 delete getdownWebsiteDir
1183 delete getdownFilesDir
1189 def install4jHomeDir = "/opt/install4j"
1190 def hostname = "hostname".execute().text.trim()
1191 if (hostname.equals("jv-bamboo")) {
1192 install4jHomeDir = System.getProperty("user.home")+"/buildtools/install4j"
1193 } else if (OperatingSystem.current().isMacOsX()) {
1194 install4jHomeDir = '/Applications/install4j.app/Contents/Resources/app'
1195 if (! file(install4jHomeDir).exists()) {
1196 install4jHomeDir = System.getProperty("user.home")+install4jHomeDir
1198 } else if (OperatingSystem.current().isLinux()) {
1199 install4jHomeDir = System.getProperty("user.home")+"/buildtools/install4j"
1201 installDir = file(install4jHomeDir)
1202 mediaTypes = Arrays.asList(install4jMediaTypes.split(","))
1203 if (install4jFaster.equals("true")) {
1209 task copyInstall4jTemplate(type: Copy) {
1210 from (install4jDir) {
1211 include install4jTemplate
1212 rename (install4jTemplate, install4jConfFileName)
1213 filter(ReplaceTokens,
1217 '9999999999': JAVA_VERSION
1220 filter(ReplaceTokens,
1224 'JAVA_VERSION': JAVA_VERSION,
1225 'JAVA_INTEGER_VERSION': JAVA_INTEGER_VERSION,
1226 'VERSION': JALVIEW_VERSION,
1227 'MACOS_JAVA_VM_DIR': macosJavaVMDir,
1228 'MACOS_JAVA_VM_TGZ': macosJavaVMTgz,
1229 'WINDOWS_JAVA_VM_DIR': windowsJavaVMDir,
1230 'WINDOWS_JAVA_VM_TGZ': windowsJavaVMTgz,
1231 'INSTALL4JINFOPLISTFILEASSOCIATIONS': install4jInfoPlistFileAssociations,
1232 'COPYRIGHT_MESSAGE': install4jCopyrightMessage,
1233 'MACOS_BUNDLE_ID': install4jMacOSBundleId,
1234 'GETDOWN_RESOURCE_DIR': getdown_resource_dir,
1235 'GETDOWN_DIST_DIR': getdown_app_dir,
1236 'GETDOWN_ALT_DIR': getdown_app_dir_alt,
1237 'GETDOWN_INSTALL_DIR': getdown_install_dir
1240 if (OSX_KEYPASS == "") {
1241 filter(ReplaceTokens,
1242 beginToken: 'codeSigning macEnabled="',
1245 'true': 'codeSigning macEnabled="false"'
1248 filter(ReplaceTokens,
1249 beginToken: 'runPostProcessor="true" ',
1250 endToken: 'Processor',
1252 'post': 'runPostProcessor="false" postProcessor'
1258 outputs.files(install4jConfFile)
1261 // include file associations in installer
1262 def installerFileAssociationsXml = file("${install4jDir}/${install4jInstallerFileAssociations}").text
1266 match: '<action name="EXTENSIONS_REPLACED_BY_GRADLE".*?</action>',
1267 replace: installerFileAssociationsXml,
1268 file: install4jConfFile
1271 // include uninstaller applescript app files in dmg
1272 def installerDMGUninstallerXml = file("$install4jDir/$install4jDMGUninstallerAppFiles").text
1276 match: '<file name="UNINSTALL_OLD_JALVIEW_APP_REPLACED_IN_GRADLE" file=.*?>',
1277 replace: installerDMGUninstallerXml,
1278 file: install4jConfFile
1287 delete install4jConfFile
1292 task installers(type: com.install4j.gradle.Install4jTask) {
1293 group = "distribution"
1294 description = "Create the install4j installers"
1296 dependsOn copyInstall4jTemplate
1297 projectFile = file(install4jConfFile)
1298 variables = [majorVersion: version.substring(2, 11), build: 001, OSX_KEYSTORE: OSX_KEYSTORE, JSIGN_SH: JSIGN_SH]
1299 destination = "${jalviewDir}/${install4jBuildDir}/${JAVA_VERSION}"
1300 buildSelected = true
1303 macKeystorePassword=OSX_KEYPASS
1307 println("Using projectFile "+projectFile)
1310 inputs.dir(getdownWebsiteDir)
1311 inputs.file(install4jConfFile)
1312 inputs.dir(macosJavaVMDir)
1313 inputs.dir(windowsJavaVMDir)
1314 outputs.dir("${jalviewDir}/${install4jBuildDir}/${JAVA_VERSION}")
1318 task sourceDist (type: Tar) {
1320 def VERSION_UNDERSCORES = JALVIEW_VERSION.replaceAll("\\.", "_")
1321 def outputFileName = "${project.name}_${VERSION_UNDERSCORES}.tar.gz"
1322 // cater for buildship < 3.1 [3.0.1 is max version in eclipse 2018-09]
1324 archiveFileName = outputFileName
1325 } catch (Exception e) {
1326 archiveName = outputFileName
1329 compression Compression.GZIP
1333 def EXCLUDE_FILES=["build/*","bin/*","test-output/","test-reports","tests","clover*/*"
1338 ,"**/*.class","${j11modDir}/**/*.jar","appletlib","**/*locales"
1340 ,"utils/InstallAnywhere"]
1341 def PROCESS_FILES=[ "AUTHORS",
1349 "THIRDPARTYLIBS","TESTNG",
1351 "gradle.properties",
1362 exclude (EXCLUDE_FILES)
1363 include (PROCESS_FILES)
1364 filter(ReplaceTokens,
1368 'Version-Rel': JALVIEW_VERSION,
1369 'Year-Rel': getDate("yyyy")
1374 exclude (EXCLUDE_FILES)
1375 exclude (PROCESS_FILES)
1376 exclude ("appletlib")
1377 exclude ("**/*locales")
1378 exclude ("*locales/**")
1379 exclude ("utils/InstallAnywhere")
1381 exclude (getdown_files_dir)
1382 exclude (getdown_website_dir)
1384 // exluding these as not using jars as modules yet
1385 exclude ("${j11modDir}/**/*.jar")
1387 // from (jalviewDir) {
1388 // // explicit includes for stuff that seemed to not get included
1389 // include(fileTree("test/**/*."))
1390 // exclude(EXCLUDE_FILES)
1391 // exclude(PROCESS_FILES)
1398 dependsOn pubhtmlhelp
1400 inputs.dir("${classesDir}/${helpDir}")
1401 outputs.dir("${buildDir}/distributions/${helpDir}")
1405 task j2sSetHeadlessBuild {
1412 task jalviewjsSetEclipseWorkspace {
1413 def propKey = "jalviewjs_eclipse_workspace"
1415 if (project.hasProperty(propKey)) {
1416 propVal = project.getProperty(propKey)
1417 if (propVal.startsWith("~/")) {
1418 propVal = System.getProperty("user.home") + propVal.substring(1)
1421 def propsFileName = "${jalviewDirAbsolutePath}/${jalviewjsBuildDir}/${jalviewjs_eclipse_workspace_location_file}"
1422 def propsFile = file(propsFileName)
1423 def eclipseWsDir = propVal
1424 def props = new Properties()
1426 def writeProps = true
1427 if (( eclipseWsDir == null || !file(eclipseWsDir).exists() ) && propsFile.exists()) {
1428 def ins = new FileInputStream(propsFileName)
1431 if (props.getProperty(propKey, null) != null) {
1432 eclipseWsDir = props.getProperty(propKey)
1437 if (eclipseWsDir == null || !file(eclipseWsDir).exists()) {
1438 def tempDir = File.createTempDir()
1439 eclipseWsDir = tempDir.getAbsolutePath()
1442 eclipseWorkspace = file(eclipseWsDir)
1445 // do not run a headless transpile when we claim to be in Eclipse
1447 println("Skipping task ${name} as IN_ECLIPSE=${IN_ECLIPSE}")
1448 throw new StopExecutionException("Not running headless transpile whilst IN_ECLIPSE is '${IN_ECLIPSE}'")
1450 println("Running task ${name} as IN_ECLIPSE=${IN_ECLIPSE}")
1454 props.setProperty(propKey, eclipseWsDir)
1455 propsFile.parentFile.mkdirs()
1456 def bytes = new ByteArrayOutputStream()
1457 props.store(bytes, null)
1458 def propertiesString = bytes.toString()
1459 propsFile.text = propertiesString
1465 println("ECLIPSE WORKSPACE: "+eclipseWorkspace.getPath())
1468 //inputs.property(propKey, eclipseWsDir) // eclipseWsDir only gets set once this task runs, so will be out-of-date
1469 outputs.file(propsFileName)
1470 outputs.upToDateWhen { eclipseWorkspace.exists() && propsFile.exists() }
1474 task jalviewjsEclipsePaths {
1477 def eclipseRoot = jalviewjs_eclipse_root
1478 if (eclipseRoot.startsWith("~/")) {
1479 eclipseRoot = System.getProperty("user.home") + eclipseRoot.substring(1)
1481 if (OperatingSystem.current().isMacOsX()) {
1482 eclipseRoot += "/Eclipse.app"
1483 eclipseBinary = "${eclipseRoot}/Contents/MacOS/eclipse"
1484 eclipseProduct = "${eclipseRoot}/Contents/Eclipse/.eclipseproduct"
1485 } else if (OperatingSystem.current().isWindows()) { // check these paths!!
1486 if (file("${eclipseRoot}/eclipse").isDirectory() && file("${eclipseRoot}/eclipse/.eclipseproduct").exists()) {
1487 eclipseRoot += "/eclipse.exe"
1489 eclipseBinary = "${eclipseRoot}/eclipse"
1490 eclipseProduct = "${eclipseRoot}/.eclipseproduct"
1491 } else { // linux or unix
1492 if (file("${eclipseRoot}/eclipse").isDirectory() && file("${eclipseRoot}/eclipse/.eclipseproduct").exists()) {
1493 eclipseRoot += "/eclipse"
1495 eclipseBinary = "${eclipseRoot}/eclipse"
1496 eclipseProduct = "${eclipseRoot}/.eclipseproduct"
1499 eclipseVersion = "4.13" // default
1500 def assumedVersion = true
1501 if (file(eclipseProduct).exists()) {
1502 def fis = new FileInputStream(eclipseProduct)
1503 def props = new Properties()
1505 eclipseVersion = props.getProperty("version")
1507 assumedVersion = false
1510 def propKey = "eclipse_debug"
1511 eclipseDebug = (project.hasProperty(propKey) && project.getProperty(propKey).equals("true"))
1514 // do not run a headless transpile when we claim to be in Eclipse
1516 println("Skipping task ${name} as IN_ECLIPSE=${IN_ECLIPSE}")
1517 throw new StopExecutionException("Not running headless transpile whilst IN_ECLIPSE is '${IN_ECLIPSE}'")
1519 println("Running task ${name} as IN_ECLIPSE=${IN_ECLIPSE}")
1522 if (!assumedVersion) {
1523 println("ECLIPSE VERSION=${eclipseVersion}")
1530 dependsOn eclipseProject
1531 dependsOn eclipseClasspath
1532 dependsOn eclipseJdt
1536 // this version (type: Copy) will delete anything in the eclipse dropins folder that isn't in fromDropinsDir
1537 task jalviewjsEclipseCopyDropins(type: Copy) {
1538 dependsOn jalviewjsEclipsePaths
1540 def inputFiles = fileTree(dir: "${jalviewDir}/${jalviewjs_eclipse_dropins_dir}", include: "*.jar")
1541 inputFiles += file("${jalviewDir}/${jalviewjs_j2s_plugin}")
1542 def outputDir = "${jalviewDir}/${jalviewjsBuildDir}/${jalviewjs_eclipse_tmp_dropins_dir}"
1549 // this eclipse -clean doesn't actually work
1550 task jalviewjsCleanEclipse(type: Exec) {
1551 dependsOn eclipseSetup
1552 dependsOn jalviewjsEclipsePaths
1553 dependsOn jalviewjsEclipseCopyDropins
1555 executable(eclipseBinary)
1556 args(["-nosplash", "--launcher.suppressErrors", "-data", eclipseWorkspace.getPath(), "-clean", "-console", "-consoleLog"])
1562 def inputString = """exit
1565 def inputByteStream = new ByteArrayInputStream(inputString.getBytes())
1566 standardInput = inputByteStream
1569 /* not really working yet
1570 jalviewjsEclipseCopyDropins.finalizedBy jalviewjsCleanEclipse
1574 task jalviewjsTransferUnzipSwingJs {
1575 def file_zip = "${jalviewDir}/${jalviewjs_swingjs_zip}"
1579 from zipTree(file_zip)
1580 into "${jalviewDir}/${jalviewjsTransferSiteSwingJsDir}"
1584 inputs.file file_zip
1585 outputs.dir "${jalviewDir}/${jalviewjsTransferSiteSwingJsDir}"
1589 task jalviewjsTransferUnzipLib {
1590 def zipFiles = fileTree(dir: "${jalviewDir}/${jalviewjs_libjs_dir}", include: "*.zip")
1593 zipFiles.each { file_zip ->
1595 from zipTree(file_zip)
1596 into "${jalviewDir}/${jalviewjsTransferSiteLibDir}"
1601 inputs.files zipFiles
1602 outputs.dir "${jalviewDir}/${jalviewjsTransferSiteLibDir}"
1606 task jalviewjsTransferUnzipAllLibs {
1607 dependsOn jalviewjsTransferUnzipSwingJs
1608 dependsOn jalviewjsTransferUnzipLib
1612 task jalviewjsCreateJ2sSettings(type: WriteProperties) {
1614 description "Create the .j2s file from the j2s.* properties"
1616 jalviewjsJ2sProps = project.properties.findAll { it.key.startsWith("j2s.") }.sort { it.key }
1617 def siteDirProperty = "j2s.site.directory"
1618 def setSiteDir = false
1619 jalviewjsJ2sProps.each { prop, val ->
1621 if (prop == siteDirProperty) {
1622 if (!(val.startsWith('/') || val.startsWith("file://") )) {
1623 val = "${jalviewDir}/${jalviewjsTransferSiteJsDir}/${val}"
1629 if (!setSiteDir) { // default site location, don't override specifically set property
1630 property(siteDirProperty,"${jalviewDirRelativePath}/${jalviewjsTransferSiteJsDir}")
1633 outputFile = jalviewjsJ2sSettingsFileName
1636 inputs.properties(jalviewjsJ2sProps)
1637 outputs.file(jalviewjsJ2sSettingsFileName)
1642 task jalviewjsEclipseSetup {
1643 dependsOn jalviewjsEclipseCopyDropins
1644 dependsOn jalviewjsSetEclipseWorkspace
1645 dependsOn jalviewjsCreateJ2sSettings
1649 task jalviewjsSyncAllLibs (type: Sync) {
1650 dependsOn jalviewjsTransferUnzipAllLibs
1651 def inputFiles = fileTree(dir: "${jalviewDir}/${jalviewjsTransferSiteLibDir}")
1652 inputFiles += fileTree(dir: "${jalviewDir}/${jalviewjsTransferSiteSwingJsDir}")
1653 def outputDir = "${jalviewDir}/${jalviewjsSiteDir}"
1657 def outputFiles = []
1658 rename { filename ->
1659 outputFiles += "${outputDir}/${filename}"
1665 outputs.files outputFiles
1666 inputs.files inputFiles
1670 task jalviewjsSyncResources (type: Sync) {
1671 def inputFiles = fileTree(dir: resourceDir)
1672 def outputDir = "${jalviewDir}/${jalviewjsSiteDir}/${jalviewjs_j2s_subdir}"
1676 def outputFiles = []
1677 rename { filename ->
1678 outputFiles += "${outputDir}/${filename}"
1684 outputs.files outputFiles
1685 inputs.files inputFiles
1689 task jalviewjsSyncSiteResources (type: Sync) {
1690 def inputFiles = fileTree(dir: "${jalviewDir}/${jalviewjs_site_resource_dir}")
1691 def outputDir = "${jalviewDir}/${jalviewjsSiteDir}"
1695 def outputFiles = []
1696 rename { filename ->
1697 outputFiles += "${outputDir}/${filename}"
1703 outputs.files outputFiles
1704 inputs.files inputFiles
1708 task jalviewjsSyncBuildProperties (type: Sync) {
1709 dependsOn createBuildProperties
1710 def inputFiles = [file(buildProperties)]
1711 def outputDir = "${jalviewDir}/${jalviewjsSiteDir}/${jalviewjs_j2s_subdir}"
1715 def outputFiles = []
1716 rename { filename ->
1717 outputFiles += "${outputDir}/${filename}"
1723 outputs.files outputFiles
1724 inputs.files inputFiles
1728 task jalviewjsProjectImport(type: Exec) {
1729 dependsOn eclipseSetup
1730 dependsOn jalviewjsEclipsePaths
1731 dependsOn jalviewjsEclipseSetup
1734 // do not run a headless import when we claim to be in Eclipse
1736 println("Skipping task ${name} as IN_ECLIPSE=${IN_ECLIPSE}")
1737 throw new StopExecutionException("Not running headless import whilst IN_ECLIPSE is '${IN_ECLIPSE}'")
1739 println("Running task ${name} as IN_ECLIPSE=${IN_ECLIPSE}")
1743 //def projdir = eclipseWorkspace.getPath()+"/.metadata/.plugins/org.eclipse.core.resources/.projects/jalview/org.eclipse.jdt.core"
1744 def projdir = eclipseWorkspace.getPath()+"/.metadata/.plugins/org.eclipse.core.resources/.projects/jalview"
1745 executable(eclipseBinary)
1746 args(["-nosplash", "--launcher.suppressErrors", "-application", "com.seeq.eclipse.importprojects.headlessimport", "-data", eclipseWorkspace.getPath(), "-import", jalviewDirAbsolutePath])
1750 args += [ "--launcher.appendVmargs", "-vmargs", "-Dorg.eclipse.equinox.p2.reconciler.dropins.directory=${jalviewDirAbsolutePath}/${jalviewjsBuildDir}/${jalviewjs_eclipse_tmp_dropins_dir}" ]
1752 args += [ "-D${j2sHeadlessBuildProperty}=true" ]
1755 inputs.file("${jalviewDir}/.project")
1756 outputs.upToDateWhen {
1757 file(projdir).exists()
1762 task jalviewjsTranspile(type: Exec) {
1763 dependsOn jalviewjsEclipseSetup
1764 dependsOn jalviewjsProjectImport
1765 dependsOn jalviewjsEclipsePaths
1768 // do not run a headless transpile when we claim to be in Eclipse
1770 println("Skipping task ${name} as IN_ECLIPSE=${IN_ECLIPSE}")
1771 throw new StopExecutionException("Not running headless transpile whilst IN_ECLIPSE is '${IN_ECLIPSE}'")
1773 println("Running task ${name} as IN_ECLIPSE=${IN_ECLIPSE}")
1777 executable(eclipseBinary)
1778 args(["-nosplash", "--launcher.suppressErrors", "-application", "org.eclipse.jdt.apt.core.aptBuild", "-data", eclipseWorkspace, "-${jalviewjs_eclipse_build_arg}", eclipse_project_name ])
1782 args += [ "--launcher.appendVmargs", "-vmargs", "-Dorg.eclipse.equinox.p2.reconciler.dropins.directory=${jalviewDirAbsolutePath}/${jalviewjsBuildDir}/${jalviewjs_eclipse_tmp_dropins_dir}" ]
1784 args += [ "-D${j2sHeadlessBuildProperty}=true" ]
1790 stdout = new ByteArrayOutputStream()
1791 stderr = new ByteArrayOutputStream()
1793 def logOutFileName = "${jalviewDirAbsolutePath}/${jalviewjsBuildDir}/${jalviewjs_j2s_transpile_stdout}"
1794 def logOutFile = file(logOutFileName)
1795 logOutFile.createNewFile()
1796 logOutFile.text = """ROOT: ${jalviewjs_eclipse_root}
1797 BINARY: ${eclipseBinary}
1798 VERSION: ${eclipseVersion}
1799 WORKSPACE: ${eclipseWorkspace}
1800 DEBUG: ${eclipseDebug}
1803 def logOutFOS = new FileOutputStream(logOutFile, true) // true == append
1804 // combine stdout and stderr
1805 def logErrFOS = logOutFOS
1807 if (jalviewjs_j2s_to_console.equals("true")) {
1808 standardOutput = new org.apache.tools.ant.util.TeeOutputStream(
1809 new org.apache.tools.ant.util.TeeOutputStream(
1813 errorOutput = new org.apache.tools.ant.util.TeeOutputStream(
1814 new org.apache.tools.ant.util.TeeOutputStream(
1819 standardOutput = new org.apache.tools.ant.util.TeeOutputStream(
1822 errorOutput = new org.apache.tools.ant.util.TeeOutputStream(
1829 if (stdout.toString().contains("Error processing ")) {
1830 // j2s did not complete transpile
1831 //throw new TaskExecutionException("Error during transpilation:\n${stderr}\nSee eclipse transpile log file '${jalviewDir}/${jalviewjsBuildDir}/${jalviewjs_j2s_transpile_stdout}'")
1832 throw new GradleException("Error during transpilation:\n${stderr}\nSee eclipse transpile log file '${jalviewDir}/${jalviewjsBuildDir}/${jalviewjs_j2s_transpile_stdout}'")
1836 inputs.dir("${jalviewDir}/${sourceDir}")
1837 outputs.dir("${jalviewDir}/${jalviewjsTransferSiteJsDir}")
1838 outputs.upToDateWhen( { file("${jalviewDir}/${jalviewjsTransferSiteJsDir}${jalviewjs_server_resource}").exists() } )
1842 def jalviewjsCallCore(String name, FileCollection list, String prefixFile, String suffixFile, String jsfile, String zjsfile, File logOutFile, Boolean logOutConsole) {
1844 def stdout = new ByteArrayOutputStream()
1845 def stderr = new ByteArrayOutputStream()
1847 def coreFile = file(jsfile)
1849 msg = "Creating core for ${name}...\nGenerating ${jsfile}"
1851 logOutFile.createNewFile()
1852 logOutFile.append(msg+"\n")
1854 def coreTop = file(prefixFile)
1855 def coreBottom = file(suffixFile)
1856 coreFile.getParentFile().mkdirs()
1857 coreFile.createNewFile()
1858 coreFile.write( coreTop.text )
1863 t.replaceAll("Clazz\\.([^_])","Clazz_${1}")
1864 coreFile.append( t )
1866 msg = "...file '"+f.getPath()+"' does not exist, skipping"
1868 logOutFile.append(msg+"\n")
1871 coreFile.append( coreBottom.text )
1873 msg = "Generating ${zjsfile}"
1875 logOutFile.append(msg+"\n")
1876 def logOutFOS = new FileOutputStream(logOutFile, true) // true == append
1877 def logErrFOS = logOutFOS
1880 classpath = files(["${jalviewDir}/tools/closure_compiler.jar"])
1881 args = [ "--js", jsfile, "--js_output_file", zjsfile ]
1883 msg = "\nRunning '"+commandLine.join(' ')+"'\n"
1885 logOutFile.append(msg+"\n")
1887 if (logOutConsole) {
1888 standardOutput = new org.apache.tools.ant.util.TeeOutputStream(
1889 new org.apache.tools.ant.util.TeeOutputStream(
1893 errorOutput = new org.apache.tools.ant.util.TeeOutputStream(
1894 new org.apache.tools.ant.util.TeeOutputStream(
1899 standardOutput = new org.apache.tools.ant.util.TeeOutputStream(
1902 errorOutput = new org.apache.tools.ant.util.TeeOutputStream(
1909 logOutFile.append(msg+"\n")
1913 task jalviewjsBuildAllCores {
1915 description "Build the core js lib closures listed in the classlists dir"
1916 dependsOn jalviewjsTranspile
1917 dependsOn jalviewjsTransferUnzipSwingJs
1919 def j2sDir = "${jalviewDir}/${jalviewjsTransferSiteJsDir}/${jalviewjs_j2s_subdir}"
1920 def swingJ2sDir = "${jalviewDir}/${jalviewjsTransferSiteSwingJsDir}/${jalviewjs_j2s_subdir}"
1921 def libJ2sDir = "${jalviewDir}/${jalviewjsTransferSiteLibDir}/${jalviewjs_j2s_subdir}"
1922 def jsDir = "${jalviewDir}/${jalviewjsTransferSiteSwingJsDir}/${jalviewjs_js_subdir}"
1923 def outputDir = "${jalviewDir}/${jalviewjsTransferSiteCoreDir}/${jalviewjs_j2s_subdir}/core"
1924 def prefixFile = "${jsDir}/core/coretop2.js"
1925 def suffixFile = "${jsDir}/core/corebottom2.js"
1927 inputs.file prefixFile
1928 inputs.file suffixFile
1930 def classlistFiles = []
1931 // add the classlists found int the jalviewjs_classlists_dir
1932 fileTree(dir: "${jalviewDir}/${jalviewjs_classlists_dir}", include: "*.txt").each {
1934 def name = file.getName() - ".txt"
1941 // _jmol and _jalview cores. Add any other peculiar classlist.txt files here
1942 //classlistFiles += [ 'file': file("${jalviewDir}/${jalviewjs_classlist_jmol}"), 'name': "_jvjmol" ]
1943 classlistFiles += [ 'file': file("${jalviewDir}/${jalviewjs_classlist_jalview}"), 'name': jalviewjsJalviewCoreName ]
1945 jalviewjsCoreClasslists = []
1947 classlistFiles.each {
1950 def file = hash['file']
1951 if (! file.exists()) {
1952 println("...classlist file '"+file.getPath()+"' does not exist, skipping")
1953 return false // this is a "continue" in groovy .each closure
1955 def name = hash['name']
1957 name = file.getName() - ".txt"
1965 def list = fileTree(dir: j2sDir, includes: filelist)
1967 def jsfile = "${outputDir}/core${name}.js"
1968 def zjsfile = "${outputDir}/core${name}.z.js"
1970 jalviewjsCoreClasslists += [
1979 outputs.file(jsfile)
1980 outputs.file(zjsfile)
1983 // _stevesoft core. add any cores without a classlist here (and the inputs and outputs)
1984 def stevesoftClasslistName = "_stevesoft"
1985 def stevesoftClasslist = [
1986 'jsfile': "${outputDir}/core${stevesoftClasslistName}.js",
1987 'zjsfile': "${outputDir}/core${stevesoftClasslistName}.z.js",
1988 'list': fileTree(dir: j2sDir, include: "com/stevesoft/pat/**/*.js"),
1989 'name': stevesoftClasslistName
1991 jalviewjsCoreClasslists += stevesoftClasslist
1992 inputs.files(stevesoftClasslist['list'])
1993 outputs.file(stevesoftClasslist['jsfile'])
1994 outputs.file(stevesoftClasslist['zjsfile'])
1997 def allClasslistName = "_all"
1998 def allJsFiles = fileTree(dir: j2sDir, include: "**/*.js")
1999 allJsFiles += fileTree(
2003 // these exlusions are files that the closure-compiler produces errors for. Should fix them
2004 "**/org/jmol/jvxl/readers/IsoIntersectFileReader.js",
2005 "**/org/jmol/export/JSExporter.js"
2008 allJsFiles += fileTree(
2012 // these exlusions are files that the closure-compiler produces errors for. Should fix them
2013 "**/sun/misc/Unsafe.js",
2014 "**/swingjs/jquery/jquery-editable-select.js",
2015 "**/swingjs/jquery/j2sComboBox.js",
2016 "**/sun/misc/FloatingDecimal.js"
2019 def allClasslist = [
2020 'jsfile': "${outputDir}/core${allClasslistName}.js",
2021 'zjsfile': "${outputDir}/core${allClasslistName}.z.js",
2023 'name': allClasslistName
2025 jalviewjsCoreClasslists += allClasslist
2026 inputs.files(allClasslist['list'])
2027 outputs.file(allClasslist['jsfile'])
2028 outputs.file(allClasslist['zjsfile'])
2031 def logOutFile = file("${jalviewDirAbsolutePath}/${jalviewjsBuildDir}/${jalviewjs_j2s_closure_stdout}")
2032 logOutFile.getParentFile().mkdirs()
2033 logOutFile.createNewFile()
2034 logOutFile.write(getDate("yyyy-MM-dd HH:mm:ss")+" jalviewjsBuildAllCores\n----\n")
2036 jalviewjsCoreClasslists.each {
2037 jalviewjsCallCore(it.name, it.list, prefixFile, suffixFile, it.jsfile, it.zjsfile, logOutFile, jalviewjs_j2s_to_console.equals("true"))
2044 def jalviewjsPublishCoreTemplate(String coreName, String templateName, File inputFile, String outputFile) {
2047 into file(outputFile).getParentFile()
2048 rename { filename ->
2049 if (filename.equals(inputFile.getName())) {
2050 return file(outputFile).getName()
2054 filter(ReplaceTokens,
2058 'MAIN': '"'+mainClass+'"',
2060 'NAME': jalviewjsJalviewTemplateName+" [core ${coreName}]",
2061 'COREKEY': jalviewjs_core_key,
2062 'CORENAME': coreName
2069 task jalviewjsPublishCoreTemplates {
2070 dependsOn jalviewjsBuildAllCores
2071 def inputFileName = "${jalviewDir}/${j2s_coretemplate_html}"
2072 def inputFile = file(inputFileName)
2073 def outputDir = "${jalviewDir}/${jalviewjsTransferSiteCoreDir}"
2075 def outputFiles = []
2076 jalviewjsCoreClasslists.each { cl ->
2077 def outputFile = "${outputDir}/${jalviewjsJalviewTemplateName}_${cl.name}.html"
2078 cl['outputfile'] = outputFile
2079 outputFiles += outputFile
2083 jalviewjsCoreClasslists.each { cl ->
2084 jalviewjsPublishCoreTemplate(cl.name, jalviewjsJalviewTemplateName, inputFile, cl.outputfile)
2087 inputs.file(inputFile)
2088 outputs.files(outputFiles)
2092 task jalviewjsSyncCore (type: Sync) {
2093 dependsOn jalviewjsBuildAllCores
2094 dependsOn jalviewjsPublishCoreTemplates
2095 def inputFiles = fileTree(dir: "${jalviewDir}/${jalviewjsTransferSiteCoreDir}")
2096 def outputDir = "${jalviewDir}/${jalviewjsSiteDir}"
2100 def outputFiles = []
2101 rename { filename ->
2102 outputFiles += "${outputDir}/${filename}"
2108 outputs.files outputFiles
2109 inputs.files inputFiles
2113 // this Copy version of TransferSiteJs will delete anything else in the target dir
2114 task jalviewjsCopyTransferSiteJs(type: Copy) {
2115 dependsOn jalviewjsTranspile
2116 from "${jalviewDir}/${jalviewjsTransferSiteJsDir}"
2117 into "${jalviewDir}/${jalviewjsSiteDir}"
2121 // this Sync version of TransferSite is used by buildship to keep the website automatically up to date when a file changes
2122 task jalviewjsSyncTransferSiteJs(type: Sync) {
2123 from "${jalviewDir}/${jalviewjsTransferSiteJsDir}"
2125 into "${jalviewDir}/${jalviewjsSiteDir}"
2132 jalviewjsSyncAllLibs.mustRunAfter jalviewjsCopyTransferSiteJs
2133 jalviewjsSyncResources.mustRunAfter jalviewjsCopyTransferSiteJs
2134 jalviewjsSyncSiteResources.mustRunAfter jalviewjsCopyTransferSiteJs
2135 jalviewjsSyncBuildProperties.mustRunAfter jalviewjsCopyTransferSiteJs
2137 jalviewjsSyncAllLibs.mustRunAfter jalviewjsSyncTransferSiteJs
2138 jalviewjsSyncResources.mustRunAfter jalviewjsSyncTransferSiteJs
2139 jalviewjsSyncSiteResources.mustRunAfter jalviewjsSyncTransferSiteJs
2140 jalviewjsSyncBuildProperties.mustRunAfter jalviewjsSyncTransferSiteJs
2143 task jalviewjsPrepareSite {
2145 description "Prepares the website folder including unzipping files and copying resources"
2146 dependsOn jalviewjsSyncAllLibs
2147 dependsOn jalviewjsSyncResources
2148 dependsOn jalviewjsSyncSiteResources
2149 dependsOn jalviewjsSyncBuildProperties
2150 dependsOn jalviewjsSyncCore
2154 task jalviewjsBuildSite {
2156 description "Builds the whole website including transpiled code"
2157 dependsOn jalviewjsCopyTransferSiteJs
2158 dependsOn jalviewjsPrepareSite
2162 task cleanJalviewjsSite {
2164 delete "${jalviewDir}/${jalviewjsTransferSiteJsDir}"
2165 delete "${jalviewDir}/${jalviewjsTransferSiteLibDir}"
2166 delete "${jalviewDir}/${jalviewjsTransferSiteSwingJsDir}"
2167 delete "${jalviewDir}/${jalviewjsTransferSiteCoreDir}"
2168 delete "${jalviewDir}/${jalviewjsSiteDir}"
2173 task jalviewjsSiteTar(type: Tar) {
2175 description "Creates a tar.gz file for the website"
2176 dependsOn jalviewjsBuildSite
2177 def outputFilename = "jalviewjs-site-${JALVIEW_VERSION}.tar.gz"
2179 archiveFileName = outputFilename
2180 } catch (Exception e) {
2181 archiveName = outputFilename
2184 compression Compression.GZIP
2186 from "${jalviewDir}/${jalviewjsSiteDir}"
2187 into jalviewjs_site_dir // this is inside the tar file
2189 inputs.dir("${jalviewDir}/${jalviewjsSiteDir}")
2193 task jalviewjsServer {
2195 def filename = "jalviewjsTest.html"
2196 description "Starts a webserver on localhost to test the website. See ${filename} to access local site on most recently used port."
2197 def htmlFile = "${jalviewDirAbsolutePath}/${filename}"
2200 SimpleHttpFileServerFactory factory = new SimpleHttpFileServerFactory()
2201 def port = Integer.valueOf(jalviewjs_server_port)
2206 while(port < start+1000 && !running) {
2208 def doc_root = new File("${jalviewDirAbsolutePath}/${jalviewjsSiteDir}")
2209 jalviewjsServer = factory.start(doc_root, port)
2211 url = jalviewjsServer.getResourceUrl(jalviewjs_server_resource)
2212 println("SERVER STARTED with document root ${doc_root}.")
2213 println("Go to "+url+" . Run gradle --stop to stop (kills all gradle daemons).")
2214 println("For debug: "+url+"?j2sdebug")
2215 println("For verbose: "+url+"?j2sverbose")
2216 } catch (Exception e) {
2221 <p><a href="${url}">JalviewJS Test. <${url}></a></p>
2222 <p><a href="${url}?j2sdebug">JalviewJS Test with debug. <${url}?j2sdebug></a></p>
2223 <p><a href="${url}?j2sverbose">JalviewJS Test with verbose. <${url}?j2sdebug></a></p>
2225 jalviewjsCoreClasslists.each { cl ->
2226 def urlcore = jalviewjsServer.getResourceUrl(file(cl.outputfile).getName())
2228 <p><a href="${urlcore}">${jalviewjsJalviewTemplateName} [core ${cl.name}]. <${urlcore}></a></p>
2230 println("For core ${cl.name}: "+urlcore)
2233 file(htmlFile).text = htmlText
2236 outputs.file(htmlFile)
2237 outputs.upToDateWhen({false})
2241 task cleanJalviewjsAll {
2243 description "Delete all configuration and build artifacts to do with JalviewJS build"
2244 dependsOn cleanJalviewjsSite
2245 dependsOn jalviewjsEclipsePaths
2248 delete "${jalviewDir}/${jalviewjsBuildDir}"
2249 delete "${jalviewDir}/${eclipse_bin_dir}"
2250 if (eclipseWorkspace != null && file(eclipseWorkspace.getAbsolutePath()+"/.metadata").exists()) {
2251 delete file(eclipseWorkspace.getAbsolutePath()+"/.metadata")
2253 delete "${jalviewDir}/${jalviewjs_j2s_settings}"
2256 outputs.upToDateWhen( { false } )
2260 task jalviewjsIDE_checkJ2sPlugin {
2261 group "00 JalviewJS in Eclipse"
2262 description "Compare the swingjs/net.sf.j2s.core.jar file with the Eclipse pluing version"
2265 def j2sPlugin = string("${jalviewDir}/${jalviewjs_j2s_plugin}")
2266 def j2sPluginFile = file(j2sPlugin)
2267 def eclipseHome = System.properties["eclipse.home.location"]
2268 if (eclipseHome == null || ! IN_ECLIPSE) {
2269 throw new StopExecutionException("Cannot find running Eclipse home from System.properties['eclipse.home.location']. Skipping J2S Plugin Check.")
2271 def eclipseJ2sPlugin = "${eclipseHome}/dropins/${j2sPluginFile.getName()}"
2272 def eclipseJ2sPluginFile = file(eclipseJ2sPlugin)
2273 if (!eclipseJ2sPluginFile.exists()) {
2274 def msg = "Eclipse J2S Plugin is not installed"
2276 throw new GradleException(msg)
2279 def digest = MessageDigest.getInstance("MD5")
2281 digest.update(j2sPluginFile.text.bytes)
2282 def j2sPluginMd5 = new BigInteger(1, digest.digest()).toString(16).padLeft(32, '0')
2284 digest.update(eclipseJ2sPluginFile.text.bytes)
2285 def eclipseJ2sPluginMd5 = new BigInteger(1, digest.digest()).toString(16).padLeft(32, '0')
2287 if (j2sPluginMd5 != eclipseJ2sPluginMd5) {
2288 def msg = "Eclipse J2S Plugin is different to '${j2sPlugin}'"
2290 throw new GradleException(msg)
2293 println("Eclipse J2S Plugin is same as '${j2sPlugin}'")
2298 task jalviewjsIDE_j2sFile {
2299 group "00 JalviewJS in Eclipse"
2300 description "Creates the .j2s file"
2301 dependsOn jalviewjsCreateJ2sSettings
2305 task jalviewjsIDE_SyncCore {
2306 group "00 JalviewJS in Eclipse"
2307 description "Build the core js lib closures listed in the classlists dir and publish core html from template"
2308 dependsOn jalviewjsSyncCore
2312 task jalviewjsIDE_PrepareSite {
2313 group "00 JalviewJS in Eclipse"
2314 description "Sync libs and resources to site dir, but not closure cores"
2315 dependsOn jalviewjsSyncAllLibs
2316 dependsOn jalviewjsSyncResources
2317 dependsOn jalviewjsSyncSiteResources
2318 dependsOn jalviewjsSyncBuildProperties
2322 task jalviewjsIDE_AssembleSite {
2323 group "00 JalviewJS in Eclipse"
2324 description "Assembles unzipped supporting zipfiles, resources, site resources and closure cores into the Eclipse transpiled site"
2325 dependsOn jalviewjsPrepareSite
2329 task jalviewjsIDE_SiteClean {
2330 group "00 JalviewJS in Eclipse"
2331 description "Deletes the Eclipse transpiled site"
2332 dependsOn cleanJalviewjsSite
2336 task jalviewjsIDE_Server {
2337 group "00 JalviewJS in Eclipse"
2338 description "Starts a webserver on localhost to test the website"
2339 dependsOn jalviewjsServer
2343 // buildship runs this at import
2344 task eclipseSynchronizationTask {
2345 //dependsOn eclipseSetup
2346 dependsOn jalviewjsIDE_j2sFile
2350 // buildship runs this at build time
2351 task eclipseAutoBuildTask {
2352 dependsOn jalviewjsIDE_PrepareSite
2364 description "Build the site"
2365 dependsOn jalviewjsBuildSite