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
6 import groovy.transform.ExternalizeMethods
7 import groovy.util.XmlParser
8 import groovy.xml.XmlUtil
17 classpath 'org.openclover:clover:4.4.1'
26 id 'com.github.johnrengelman.shadow' version '4.0.3'
27 id 'com.install4j.gradle' version '8.0.4'
28 id 'com.dorongold.task-tree' version '1.5' // only needed to display task dependency tree with gradle task1 [task2 ...] taskTree
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) {
40 return o == null ? "" : o.toString()
45 jalviewDirAbsolutePath = file(jalviewDir).getAbsolutePath()
46 jalviewDirRelativePath = jalviewDir
48 // local build environment properties
49 // can be "projectDir/local.properties"
50 def localProps = "${projectDir}/local.properties"
52 if (file(localProps).exists()) {
53 propsFile = localProps
55 // or "../projectDir_local.properties"
56 def dirLocalProps = projectDir.getParent() + "/" + projectDir.getName() + "_local.properties"
57 if (file(dirLocalProps).exists()) {
58 propsFile = dirLocalProps
60 if (propsFile != null) {
62 def p = new Properties()
63 def localPropsFIS = new FileInputStream(propsFile)
68 def oldval = findProperty(key)
71 println("Overriding property '${key}' ('${oldval}') with ${file(propsFile).getName()} value '${val}'")
73 println("Setting unknown property '${key}' with ${file(propsFile).getName()}s value '${val}'")
76 } catch (Exception e) {
77 System.out.println("Exception reading local.properties")
81 // this property set when running Eclipse headlessly
82 j2sHeadlessBuildProperty = string("net.sf.j2s.core.headlessbuild")
83 // this property set by Eclipse
84 eclipseApplicationProperty = string("eclipse.application")
85 // CHECK IF RUNNING FROM WITHIN ECLIPSE
86 def eclipseApplicationPropertyVal = System.properties[eclipseApplicationProperty]
87 IN_ECLIPSE = eclipseApplicationPropertyVal != null && eclipseApplicationPropertyVal.startsWith("org.eclipse.ui.")
88 // BUT WITHOUT THE HEADLESS BUILD PROPERTY SET
89 if (System.properties[j2sHeadlessBuildProperty].equals("true")) {
90 println("Setting IN_ECLIPSE to ${IN_ECLIPSE} as System.properties['${j2sHeadlessBuildProperty}'] == '${System.properties[j2sHeadlessBuildProperty]}'")
94 println("WITHIN ECLIPSE IDE")
96 println("HEADLESS BUILD")
99 System.properties.sort { it.key }.each {
100 key, val -> println("SYSTEM PROPERTY ${key}='${val}'")
103 if (false && IN_ECLIPSE) {
104 jalviewDir = jalviewDirAbsolutePath
109 bareSourceDir = string(source_dir)
110 sourceDir = string("${jalviewDir}/${bareSourceDir}")
111 resourceDir = string("${jalviewDir}/${resource_dir}")
112 bareTestSourceDir = string(test_source_dir)
113 testSourceDir = string("${jalviewDir}/${bareTestSourceDir}")
116 cloverInstrDir = file("${buildDir}/${cloverSourcesInstrDir}")
117 cloverDb = string("${buildDir}/clover/clover.db")
118 classesDir = string("${jalviewDir}/${classes_dir}")
119 if (clover.equals("true")) {
121 classesDir = string("${buildDir}/${cloverClassesDir}")
124 classesDir = string("${jalviewDir}/${classes_dir}")
129 getdownWebsiteDir = string("${jalviewDir}/${getdown_website_dir}/${JAVA_VERSION}")
132 // the following values might be overridden by the CHANNEL switch
133 getdownChannelName = CHANNEL.toLowerCase()
134 getdownDir = string("${getdownChannelName}/${JAVA_VERSION}")
135 getdownAppBase = string("${getdown_channel_base}/${getdownDir}")
136 getdownLauncher = string("${jalviewDir}/${getdown_lib_dir}/${getdown_launcher}")
137 getdownAppDistDir = getdown_app_dir_alt
138 buildProperties = string("${classesDir}/${build_properties_file}")
139 reportRsyncCommand = false
140 jvlChannelName = CHANNEL.toLowerCase()
141 install4jSuffix = CHANNEL.substring(0, 1).toUpperCase() + CHANNEL.substring(1).toLowerCase(); // BUILD -> Build
142 install4jDSStore = "DS_Store-NON-RELEASE"
143 install4jDMGBackgroundImage = "jalview_dmg_background-NON-RELEASE.png"
144 install4jInstallerName = "${jalview_name} Non-Release Installer"
145 install4jExecutableName = jalview_name.replaceAll("[^\\w]+", "_").toLowerCase()
146 install4jExtraScheme = "jalviewx"
150 // TODO: get bamboo build artifact URL for getdown artifacts
151 getdown_channel_base = bamboo_channelbase
152 getdownChannelName = string("${bamboo_planKey}/${JAVA_VERSION}")
153 getdownAppBase = string("${bamboo_channelbase}/${bamboo_planKey}${bamboo_getdown_channel_suffix}/${JAVA_VERSION}")
154 jvlChannelName += "_${getdownChannelName}"
155 // automatically add the test group Not-bamboo for exclusion
156 if ("".equals(testngExcludedGroups)) {
157 testngExcludedGroups = "Not-bamboo"
159 install4jExtraScheme = "jalviewb"
163 getdownAppDistDir = getdown_app_dir_release
164 reportRsyncCommand = true
166 install4jDSStore = "DS_Store"
167 install4jDMGBackgroundImage = "jalview_dmg_background.png"
168 install4jInstallerName = "${jalview_name} Installer"
172 getdownChannelName = CHANNEL.toLowerCase()+"/${JALVIEW_VERSION}"
173 getdownDir = string("${getdownChannelName}/${JAVA_VERSION}")
174 getdownAppBase = string("${getdown_channel_base}/${getdownDir}")
175 if (!file("${ARCHIVEDIR}/${packageDir}").exists()) {
176 throw new GradleException("Must provide an ARCHIVEDIR value to produce an archive distribution")
178 packageDir = string("${ARCHIVEDIR}/${packageDir}")
179 buildProperties = string("${ARCHIVEDIR}/${classes_dir}/${build_properties_file}")
182 reportRsyncCommand = true
183 install4jExtraScheme = "jalviewa"
187 getdownChannelName = string("archive/${JALVIEW_VERSION}")
188 getdownDir = string("${getdownChannelName}/${JAVA_VERSION}")
189 getdownAppBase = file(getdownWebsiteDir).toURI().toString()
190 if (!file("${ARCHIVEDIR}/${packageDir}").exists()) {
191 throw new GradleException("Must provide an ARCHIVEDIR value to produce an archive distribution")
193 packageDir = string("${ARCHIVEDIR}/${packageDir}")
194 buildProperties = string("${ARCHIVEDIR}/${classes_dir}/${build_properties_file}")
197 reportRsyncCommand = true
198 getdownLauncher = string("${jalviewDir}/${getdown_lib_dir}/${getdown_launcher_local}")
199 install4jSuffix = "Archive"
200 install4jExtraScheme = "jalviewa"
204 reportRsyncCommand = true
205 install4jExtraScheme = "jalviewd"
209 reportRsyncCommand = true
210 JALVIEW_VERSION = "TEST"
211 install4jSuffix = "Test"
212 install4jDSStore = "DS_Store-TEST-RELEASE"
213 install4jDMGBackgroundImage = "jalview_dmg_background.png"
214 install4jExtraScheme = "jalviewt"
215 install4jInstallerName = "${jalview_name} Test Installer"
218 case ~/^SCRATCH(|-[-\w]*)$/:
219 getdownChannelName = CHANNEL
220 getdownDir = string("${getdownChannelName}/${JAVA_VERSION}")
221 getdownAppBase = string("${getdown_channel_base}/${getdownDir}")
222 reportRsyncCommand = true
223 install4jSuffix = "Scratch"
227 if (!file("${LOCALDIR}").exists()) {
228 throw new GradleException("Must provide a LOCALDIR value to produce a local distribution")
230 getdownAppBase = file(file("${LOCALDIR}").getAbsolutePath()).toURI().toString()
231 getdownLauncher = string("${jalviewDir}/${getdown_lib_dir}/${getdown_launcher_local}")
233 JALVIEW_VERSION = "TEST"
234 install4jSuffix = "Test-Local"
235 install4jDSStore = "DS_Store-TEST-RELEASE"
236 install4jDMGBackgroundImage = "jalview_dmg_background.png"
237 install4jExtraScheme = "jalviewt"
238 install4jInstallerName = "${jalview_name} Test Installer"
242 getdownAppBase = file(getdownWebsiteDir).toURI().toString()
243 getdownLauncher = string("${jalviewDir}/${getdown_lib_dir}/${getdown_launcher_local}")
244 install4jExtraScheme = "jalviewl"
247 default: // something wrong specified
248 throw new GradleException("CHANNEL must be one of BUILD, RELEASE, ARCHIVE, DEVELOP, TEST-RELEASE, SCRATCH-..., LOCAL [default]")
252 // override getdownAppBase if requested
253 if (findProperty("getdown_appbase_override") != null) {
254 getdownAppBase = string(getProperty("getdown_appbase_override"))
255 println("Overriding getdown appbase with '${getdownAppBase}'")
257 // sanitise file name for jalview launcher file for this channel
258 jvlChannelName = jvlChannelName.replaceAll("[^\\w\\-]+", "_")
259 // install4j application and folder names
260 if (install4jSuffix == "") {
261 install4jApplicationName = "${jalview_name}"
262 install4jBundleId = "${install4j_bundle_id}"
263 install4jWinApplicationId = install4j_release_win_application_id
265 install4jApplicationName = "${jalview_name} ${install4jSuffix}"
266 install4jBundleId = "${install4j_bundle_id}-" + install4jSuffix.toLowerCase()
267 // add int hash of install4jSuffix to the last part of the application_id
268 def id = install4j_release_win_application_id
269 def idsplitreverse = id.split("-").reverse()
270 idsplitreverse[0] = idsplitreverse[0].toInteger() + install4jSuffix.hashCode()
271 install4jWinApplicationId = idsplitreverse.reverse().join("-")
273 // sanitise folder and id names
274 // install4jApplicationFolder = e.g. "Jalview Build"
275 install4jApplicationFolder = install4jApplicationName
276 .replaceAll("[\"'~:/\\\\\\s]", "_") // replace all awkward filename chars " ' ~ : / \
277 .replaceAll("_+", "_") // collapse __
278 install4jInternalId = install4jApplicationName
280 .replaceAll("[^\\w\\-\\.]", "_") // replace other non [alphanumeric,_,-,.]
281 .replaceAll("_+", "") // collapse __
282 //.replaceAll("_*-_*", "-") // collapse _-_
283 install4jUnixApplicationFolder = install4jInternalId
286 getdownAppDir = string("${getdownWebsiteDir}/${getdownAppDistDir}")
287 //getdownJ11libDir = "${getdownWebsiteDir}/${getdown_j11lib_dir}"
288 getdownResourceDir = string("${getdownWebsiteDir}/${getdown_resource_dir}")
289 getdownInstallDir = string("${getdownWebsiteDir}/${getdown_install_dir}")
290 getdownFilesDir = string("${jalviewDir}/${getdown_files_dir}/${JAVA_VERSION}/")
291 getdownFilesInstallDir = string("${getdownFilesDir}/${getdown_install_dir}")
292 /* compile without modules -- using classpath libraries
293 modules_compileClasspath = fileTree(dir: "${jalviewDir}/${j11modDir}", include: ["*.jar"])
294 modules_runtimeClasspath = modules_compileClasspath
297 gitBranch = string("")
299 println("Using a ${CHANNEL} profile.")
301 additional_compiler_args = []
302 // configure classpath/args for j8/j11 compilation
303 if (JAVA_VERSION.equals("1.8")) {
304 JAVA_INTEGER_VERSION = string("8")
307 libDistDir = j8libDir
308 compile_source_compatibility = 1.8
309 compile_target_compatibility = 1.8
310 // these are getdown.txt properties defined dependent on the JAVA_VERSION
311 getdownAltJavaMinVersion = string(findProperty("getdown_alt_java8_min_version"))
312 getdownAltJavaMaxVersion = string(findProperty("getdown_alt_java8_max_version"))
313 // this property is assigned below and expanded to multiple lines in the getdown task
314 getdownAltMultiJavaLocation = string(findProperty("getdown_alt_java8_txt_multi_java_location"))
315 // this property is for the Java library used in eclipse
316 eclipseJavaRuntimeName = string("JavaSE-1.8")
317 } else if (JAVA_VERSION.equals("11")) {
318 JAVA_INTEGER_VERSION = string("11")
320 libDistDir = j11libDir
321 compile_source_compatibility = 11
322 compile_target_compatibility = 11
323 getdownAltJavaMinVersion = string(findProperty("getdown_alt_java11_min_version"))
324 getdownAltJavaMaxVersion = string(findProperty("getdown_alt_java11_max_version"))
325 getdownAltMultiJavaLocation = string(findProperty("getdown_alt_java11_txt_multi_java_location"))
326 eclipseJavaRuntimeName = string("JavaSE-11")
327 /* compile without modules -- using classpath libraries
328 additional_compiler_args += [
329 '--module-path', modules_compileClasspath.asPath,
330 '--add-modules', j11modules
333 } else if (JAVA_VERSION.equals("12") || JAVA_VERSION.equals("13")) {
334 JAVA_INTEGER_VERSION = JAVA_VERSION
336 libDistDir = j11libDir
337 compile_source_compatibility = JAVA_VERSION
338 compile_target_compatibility = JAVA_VERSION
339 getdownAltJavaMinVersion = string(findProperty("getdown_alt_java11_min_version"))
340 getdownAltJavaMaxVersion = string(findProperty("getdown_alt_java11_max_version"))
341 getdownAltMultiJavaLocation = string(findProperty("getdown_alt_java11_txt_multi_java_location"))
342 eclipseJavaRuntimeName = string("JavaSE-11")
343 /* compile without modules -- using classpath libraries
344 additional_compiler_args += [
345 '--module-path', modules_compileClasspath.asPath,
346 '--add-modules', j11modules
350 throw new GradleException("JAVA_VERSION=${JAVA_VERSION} not currently supported by Jalview")
355 JAVA_MIN_VERSION = JAVA_VERSION
356 JAVA_MAX_VERSION = JAVA_VERSION
357 def jreInstallsDir = string(jre_installs_dir)
358 if (jreInstallsDir.startsWith("~/")) {
359 jreInstallsDir = System.getProperty("user.home") + jreInstallsDir.substring(1)
361 macosJavaVMDir = string("${jreInstallsDir}/jre-${JAVA_INTEGER_VERSION}-mac-x64/jre")
362 macosJavaVMTgz = string("${jreInstallsDir}/tgz/jre-${JAVA_INTEGER_VERSION}-mac-x64.tar.gz")
363 windowsJavaVMDir = string("${jreInstallsDir}/jre-${JAVA_INTEGER_VERSION}-windows-x64/jre")
364 windowsJavaVMTgz = string("${jreInstallsDir}/tgz/jre-${JAVA_INTEGER_VERSION}-windows-x64.tar.gz")
365 linuxJavaVMDir = string("${jreInstallsDir}/jre-${JAVA_INTEGER_VERSION}-linux-x64/jre")
366 linuxJavaVMTgz = string("${jreInstallsDir}/tgz/jre-${JAVA_INTEGER_VERSION}-linux-x64.tar.gz")
367 install4jDir = string("${jalviewDir}/${install4j_utils_dir}")
368 install4jConfFileName = string("jalview-install4j-conf.install4j")
369 install4jConfFile = file("${install4jDir}/${install4jConfFileName}")
370 install4jHomeDir = install4j_home_dir
371 if (install4jHomeDir.startsWith("~/")) {
372 install4jHomeDir = System.getProperty("user.home") + install4jHomeDir.substring(1)
377 buildingHTML = string("${jalviewDir}/${docDir}/building.html")
378 helpFile = string("${classesDir}/${help_dir}/help.jhm")
379 helpParentDir = string("${jalviewDir}/${help_parent_dir}")
380 helpSourceDir = string("${helpParentDir}/${help_dir}")
383 relativeBuildDir = file(jalviewDirAbsolutePath).toPath().relativize(buildDir.toPath())
384 jalviewjsBuildDir = string("${relativeBuildDir}/jalviewjs")
385 jalviewjsSiteDir = string("${jalviewjsBuildDir}/${jalviewjs_site_dir}")
387 jalviewjsTransferSiteJsDir = string(jalviewjsSiteDir)
389 jalviewjsTransferSiteJsDir = string("${jalviewjsBuildDir}/tmp/${jalviewjs_site_dir}_js")
391 jalviewjsTransferSiteLibDir = string("${jalviewjsBuildDir}/tmp/${jalviewjs_site_dir}_lib")
392 jalviewjsTransferSiteSwingJsDir = string("${jalviewjsBuildDir}/tmp/${jalviewjs_site_dir}_swingjs")
393 jalviewjsTransferSiteCoreDir = string("${jalviewjsBuildDir}/tmp/${jalviewjs_site_dir}_core")
394 jalviewjsJalviewCoreHtmlFile = string("")
395 jalviewjsJalviewCoreName = string(jalviewjs_core_name)
396 jalviewjsCoreClasslists = []
397 jalviewjsJalviewTemplateName = string(jalviewjs_name)
398 jalviewjsJ2sSettingsFileName = string("${jalviewDir}/${jalviewjs_j2s_settings}")
399 jalviewjsJ2sProps = null
401 eclipseWorkspace = null
402 eclipseBinary = string("")
403 eclipseVersion = string("")
413 outputDir = file(classesDir)
418 srcDirs += helpParentDir
421 jar.destinationDir = file("${jalviewDir}/${packageDir}")
423 compileClasspath = files(sourceSets.main.java.outputDir)
424 //compileClasspath += files(sourceSets.main.resources.srcDirs)
425 compileClasspath += fileTree(dir: "${jalviewDir}/${libDir}", include: ["*.jar"])
427 runtimeClasspath = compileClasspath
432 srcDirs = [ cloverInstrDir ]
433 outputDir = file("${buildDir}/${cloverClassesDir}")
437 srcDirs = sourceSets.main.resources.srcDirs
439 compileClasspath = configurations.cloverRuntime + files( sourceSets.clover.java.outputDir )
440 compileClasspath += files(sourceSets.main.java.outputDir)
441 compileClasspath += sourceSets.main.compileClasspath
442 compileClasspath += fileTree(dir: "${jalviewDir}/${utilsDir}", include: ["**/*.jar"])
443 compileClasspath += fileTree(dir: "${jalviewDir}/${libDir}", include: ["*.jar"])
445 runtimeClasspath = compileClasspath
450 srcDirs testSourceDir
451 outputDir = file("${jalviewDir}/${testOutputDir}")
455 srcDirs = sourceSets.main.resources.srcDirs
458 compileClasspath = files( sourceSets.test.java.outputDir )
461 compileClasspath = sourceSets.clover.compileClasspath
463 compileClasspath += files(sourceSets.main.java.outputDir)
466 compileClasspath += fileTree(dir: "${jalviewDir}/${libDir}", include: ["*.jar"])
467 compileClasspath += fileTree(dir: "${jalviewDir}/${utilsDir}/testnglibs", include: ["**/*.jar"])
468 compileClasspath += fileTree(dir: "${jalviewDir}/${utilsDir}/testlibs", include: ["**/*.jar"])
470 runtimeClasspath = compileClasspath
478 cloverCompile 'org.openclover:clover:4.4.1'
479 testCompile 'org.openclover:clover:4.4.1'
485 cloverRuntime.extendsFrom cloverCompile
489 // eclipse project and settings files creation, also used by buildship
492 name = eclipse_project_name
494 natures 'org.eclipse.jdt.core.javanature',
495 'org.eclipse.jdt.groovy.core.groovyNature',
496 'org.eclipse.buildship.core.gradleprojectnature'
498 buildCommand 'org.eclipse.jdt.core.javabuilder'
499 buildCommand 'org.eclipse.buildship.core.gradleprojectbuilder'
503 //defaultOutputDir = sourceSets.main.java.outputDir
506 if (it.isCanBeResolved()) {
511 minusConfigurations += removeThese
512 plusConfigurations = [ ]
516 def removeTheseToo = []
517 HashMap<String, Boolean> alreadyAddedSrcPath = new HashMap<>();
518 cp.entries.each { entry ->
519 // This conditional removes all src classpathentries that a) have already been added or b) aren't "src" or "test".
520 // e.g. this removes the resources dir being copied into bin/main, bin/test AND bin/clover
521 // we add the resources and help/help dirs in as libs afterwards (see below)
522 if (entry.kind == 'src') {
523 if (alreadyAddedSrcPath.getAt(entry.path) || !(entry.path == bareSourceDir || entry.path == bareTestSourceDir)) {
524 removeTheseToo += entry
526 alreadyAddedSrcPath.putAt(entry.path, true)
531 cp.entries.removeAll(removeTheseToo)
533 //cp.entries += new Output("${eclipse_bin_dir}/main")
534 if (file(helpParentDir).isDirectory()) {
535 cp.entries += new Library(fileReference(helpParentDir))
537 if (file(resourceDir).isDirectory()) {
538 cp.entries += new Library(fileReference(resourceDir))
541 HashMap<String, Boolean> alreadyAddedLibPath = new HashMap<>();
543 sourceSets.main.compileClasspath.findAll { it.name.endsWith(".jar") }.any {
544 //don't want to add outputDir as eclipse is using its own output dir in bin/main
545 if (it.isDirectory() || ! it.exists()) {
546 // don't add dirs to classpath, especially if they don't exist
547 return false // groovy "continue" in .any closure
549 def itPath = it.toString()
550 if (itPath.startsWith("${jalviewDirAbsolutePath}/")) {
551 // make relative path
552 itPath = itPath.substring(jalviewDirAbsolutePath.length()+1)
554 if (alreadyAddedLibPath.get(itPath)) {
555 //println("Not adding duplicate entry "+itPath)
557 //println("Adding entry "+itPath)
558 cp.entries += new Library(fileReference(itPath))
559 alreadyAddedLibPath.put(itPath, true)
563 sourceSets.test.compileClasspath.findAll { it.name.endsWith(".jar") }.any {
564 //no longer want to add outputDir as eclipse is using its own output dir in bin/main
565 if (it.isDirectory() || ! it.exists()) {
566 // don't add dirs to classpath
567 return false // groovy "continue" in .any closure
570 def itPath = it.toString()
571 if (itPath.startsWith("${jalviewDirAbsolutePath}/")) {
572 itPath = itPath.substring(jalviewDirAbsolutePath.length()+1)
574 if (alreadyAddedLibPath.get(itPath)) {
577 def lib = new Library(fileReference(itPath))
578 lib.entryAttributes["test"] = "true"
580 alreadyAddedLibPath.put(itPath, true)
588 containers 'org.eclipse.buildship.core.gradleclasspathcontainer'
593 // for the IDE, use java 11 compatibility
594 sourceCompatibility = compile_source_compatibility
595 targetCompatibility = compile_target_compatibility
596 javaRuntimeName = eclipseJavaRuntimeName
598 // add in jalview project specific properties/preferences into eclipse core preferences
600 withProperties { props ->
601 def jalview_prefs = new Properties()
602 def ins = new FileInputStream("${jalviewDirAbsolutePath}/${eclipse_extra_jdt_prefs_file}")
603 jalview_prefs.load(ins)
605 jalview_prefs.forEach { t, v ->
606 if (props.getAt(t) == null) {
616 // Don't want these to be activated if in headless build
617 synchronizationTasks "eclipseSynchronizationTask"
618 autoBuildTasks "eclipseAutoBuildTask"
625 // only instrument source, we build test classes as normal
626 inputs.files files (sourceSets.main.allJava,sourceSets.test.allJava) // , fileTree(dir:"$jalviewDir/$testSourceDir", include: ["**/*.java"]))
627 outputs.dir cloverInstrDir
630 delete cloverInstrDir
635 cloverInstrDir.getPath(),
638 inputs.files.files.collect(
639 { file -> file.absolutePath }
642 String[] args = argsList.toArray()
643 println("About to instrument "+args.length +" files")
644 com.atlassian.clover.CloverInstr.mainImpl(args)
649 cloverClasses.dependsOn cloverInstr
653 group = "Verification"
654 description = "Creates the Clover report"
655 inputs.dir "${buildDir}/clover"
656 outputs.dir "${reportsDir}/clover"
658 file(cloverDb).exists()
665 "${reportsDir}/clover"
667 String[] args = argsList.toArray()
668 com.atlassian.clover.reporters.html.HtmlReporter.runReport(args)
670 // and generate ${reportsDir}/clover/clover.xml
675 "${reportsDir}/clover/clover.xml"
677 com.atlassian.clover.reporters.xml.XMLReporter.runReport(args)
685 sourceCompatibility = compile_source_compatibility
686 targetCompatibility = compile_target_compatibility
687 options.compilerArgs += additional_compiler_args
688 print ("Setting target compatibility to "+targetCompatibility+"\n")
690 classpath += configurations.cloverRuntime
696 delete cloverInstrDir
706 sourceCompatibility = compile_source_compatibility
707 targetCompatibility = compile_target_compatibility
708 options.compilerArgs = additional_compiler_args
709 print ("Setting target compatibility to "+targetCompatibility+"\n")
717 dependsOn compileCloverJava
718 classpath += configurations.cloverRuntime
720 classpath += sourceSets.main.runtimeClasspath
723 sourceCompatibility = compile_source_compatibility
724 targetCompatibility = compile_target_compatibility
725 options.compilerArgs = additional_compiler_args
726 print ("Setting target compatibility to "+targetCompatibility+"\n")
733 delete sourceSets.main.java.outputDir
739 dependsOn cleanClover
741 delete sourceSets.test.java.outputDir
746 // format is a string like date.format("dd MMMM yyyy")
747 def getDate(format) {
748 def date = new Date()
749 return date.format(format)
754 def hashStdOut = new ByteArrayOutputStream()
756 commandLine "git", "rev-parse", "--short", "HEAD"
757 standardOutput = hashStdOut
761 def branchStdOut = new ByteArrayOutputStream()
763 commandLine "git", "rev-parse", "--abbrev-ref", "HEAD"
764 standardOutput = branchStdOut
768 gitHash = hashStdOut.toString().trim()
769 gitBranch = branchStdOut.toString().trim()
771 outputs.upToDateWhen { false }
775 task createBuildProperties(type: WriteProperties) {
777 inputs.dir(sourceDir)
778 inputs.dir(resourceDir)
779 file(buildProperties).getParentFile().mkdirs()
780 outputFile (buildProperties)
781 // taking time specific comment out to allow better incremental builds
782 comment "--Jalview Build Details--\n"+getDate("yyyy-MM-dd HH:mm:ss")
783 //comment "--Jalview Build Details--\n"+getDate("yyyy-MM-dd")
784 property "BUILD_DATE", getDate("HH:mm:ss dd MMMM yyyy")
785 property "VERSION", JALVIEW_VERSION
786 property "INSTALLATION", INSTALLATION+" git-commit:"+gitHash+" ["+gitBranch+"]"
787 outputs.file(outputFile)
791 task cleanBuildingHTML(type: Delete) {
798 task convertBuildingMD(type: Exec) {
799 dependsOn cleanBuildingHTML
800 def buildingMD = "${jalviewDir}/${docDir}/building.md"
801 def css = "${jalviewDir}/${docDir}/github.css"
804 pandoc_exec.split(",").each {
805 if (file(it.trim()).exists()) {
811 def hostname = "hostname".execute().text.trim()
812 def buildtoolsPandoc = System.getProperty("user.home")+"/buildtools/pandoc/bin/pandoc"
813 if ((pandoc == null || ! file(pandoc).exists()) && file(buildtoolsPandoc).exists()) {
814 pandoc = System.getProperty("user.home")+"/buildtools/pandoc/bin/pandoc"
818 if (pandoc != null && file(pandoc).exists()) {
819 commandLine pandoc, '-s', '-o', buildingHTML, '--metadata', 'pagetitle="Building Jalview from Source"', '--toc', '-H', css, buildingMD
821 println("Cannot find pandoc. Skipping convert building.md to HTML")
822 throw new StopExecutionException("Cannot find pandoc. Skipping convert building.md to HTML")
828 inputs.file(buildingMD)
830 outputs.file(buildingHTML)
841 task syncDocs(type: Sync) {
842 dependsOn convertBuildingMD
843 def syncDir = "${classesDir}/${docDir}"
844 from fileTree("${jalviewDir}/${docDir}")
850 task copyHelp(type: Copy) {
851 def inputDir = helpSourceDir
852 def outputDir = "${classesDir}/${help_dir}"
857 filter(ReplaceTokens,
861 'Version-Rel': JALVIEW_VERSION,
862 'Year-Rel': getDate("yyyy")
874 outputs.files(helpFile)
875 outputs.dir(outputDir)
879 task syncLib(type: Sync) {
880 def syncDir = "${classesDir}/${libDistDir}"
881 from fileTree("${jalviewDir}/${libDistDir}")
886 task syncResources(type: Sync) {
897 dependsOn syncResources
903 //testReportDirName = "test-reports" // note that test workingDir will be $jalviewDir
906 dependsOn compileJava
908 dependsOn cloverInstr
912 print("Running tests " + (use_clover?"WITH":"WITHOUT") + " clover [clover="+use_clover+"]\n")
916 includeGroups testngGroups
917 excludeGroups testngExcludedGroups
919 useDefaultListeners=true
922 maxHeapSize = "1024m"
924 workingDir = jalviewDir
925 //systemProperties 'clover.jar' System.properties.clover.jar
926 sourceCompatibility = compile_source_compatibility
927 targetCompatibility = compile_target_compatibility
928 jvmArgs += additional_compiler_args
933 task buildIndices(type: JavaExec) {
935 classpath = sourceSets.main.compileClasspath
936 main = "com.sun.java.help.search.Indexer"
937 workingDir = "${classesDir}/${help_dir}"
940 inputs.dir("${workingDir}/${argDir}")
942 outputs.dir("${classesDir}/doc")
943 outputs.dir("${classesDir}/help")
944 outputs.file("${workingDir}/JavaHelpSearch/DOCS")
945 outputs.file("${workingDir}/JavaHelpSearch/DOCS.TAB")
946 outputs.file("${workingDir}/JavaHelpSearch/OFFSETS")
947 outputs.file("${workingDir}/JavaHelpSearch/POSITIONS")
948 outputs.file("${workingDir}/JavaHelpSearch/SCHEMA")
949 outputs.file("${workingDir}/JavaHelpSearch/TMAP")
953 task compileLinkCheck(type: JavaCompile) {
955 classpath = files("${jalviewDir}/${utilsDir}")
956 destinationDir = file("${jalviewDir}/${utilsDir}")
957 source = fileTree(dir: "${jalviewDir}/${utilsDir}", include: ["HelpLinksChecker.java", "BufferedLineReader.java"])
959 inputs.file("${jalviewDir}/${utilsDir}/HelpLinksChecker.java")
960 inputs.file("${jalviewDir}/${utilsDir}/HelpLinksChecker.java")
961 outputs.file("${jalviewDir}/${utilsDir}/HelpLinksChecker.class")
962 outputs.file("${jalviewDir}/${utilsDir}/BufferedLineReader.class")
966 task linkCheck(type: JavaExec) {
967 dependsOn prepare, compileLinkCheck
969 def helpLinksCheckerOutFile = file("${jalviewDir}/${utilsDir}/HelpLinksChecker.out")
970 classpath = files("${jalviewDir}/${utilsDir}")
971 main = "HelpLinksChecker"
972 workingDir = jalviewDir
973 args = [ "${classesDir}/${help_dir}", "-nointernet" ]
975 def outFOS = new FileOutputStream(helpLinksCheckerOutFile, false) // false == don't append
977 standardOutput = new org.apache.tools.ant.util.TeeOutputStream(
980 errorOutput = new org.apache.tools.ant.util.TeeOutputStream(
984 inputs.dir("${classesDir}/${help_dir}")
985 outputs.file(helpLinksCheckerOutFile)
988 // import the pubhtmlhelp target
989 ant.properties.basedir = "${jalviewDir}"
990 ant.properties.helpBuildDir = "${jalviewDirAbsolutePath}/${classes_dir}/${help_dir}"
991 ant.importBuild "${utilsDir}/publishHelp.xml"
994 task cleanPackageDir(type: Delete) {
996 delete fileTree(dir: "${jalviewDir}/${packageDir}", include: "*.jar")
1002 dependsOn buildIndices
1003 dependsOn createBuildProperties
1006 attributes "Main-Class": mainClass,
1007 "Permissions": "all-permissions",
1008 "Application-Name": "Jalview Desktop",
1009 "Codebase": application_codebase
1012 destinationDir = file("${jalviewDir}/${packageDir}")
1013 archiveName = rootProject.name+".jar"
1019 exclude "**/*.jar.*"
1021 inputs.dir(classesDir)
1022 outputs.file("${jalviewDir}/${packageDir}/${archiveName}")
1026 task copyJars(type: Copy) {
1027 from fileTree(dir: classesDir, include: "**/*.jar").files
1028 into "${jalviewDir}/${packageDir}"
1032 // doing a Sync instead of Copy as Copy doesn't deal with "outputs" very well
1033 task syncJars(type: Sync) {
1034 from fileTree(dir: "${jalviewDir}/${libDistDir}", include: "**/*.jar").files
1035 into "${jalviewDir}/${packageDir}"
1037 include jar.archiveName
1044 description = "Put all required libraries in dist"
1045 // order of "cleanPackageDir", "copyJars", "jar" important!
1046 jar.mustRunAfter cleanPackageDir
1047 syncJars.mustRunAfter cleanPackageDir
1048 dependsOn cleanPackageDir
1051 outputs.dir("${jalviewDir}/${packageDir}")
1056 dependsOn cleanPackageDir
1062 group = "distribution"
1066 from ("${jalviewDir}/${libDistDir}") {
1070 attributes 'Implementation-Version': JALVIEW_VERSION
1072 mainClassName = shadowJarMainClass
1074 classifier = "all-"+JALVIEW_VERSION+"-j"+JAVA_VERSION
1079 task getdownWebsite() {
1080 group = "distribution"
1081 description = "Create the getdown minimal app folder, and website folder for this version of jalview. Website folder also used for offline app installer"
1086 def getdownWebsiteResourceFilenames = []
1087 def getdownTextString = ""
1088 def getdownResourceDir = getdownResourceDir
1089 def getdownResourceFilenames = []
1092 // clean the getdown website and files dir before creating getdown folders
1093 delete getdownWebsiteDir
1094 delete getdownFilesDir
1097 from buildProperties
1098 rename(build_properties_file, getdown_build_properties)
1101 getdownWebsiteResourceFilenames += "${getdownAppDistDir}/${getdown_build_properties}"
1103 // set some getdown_txt_ properties then go through all properties looking for getdown_txt_...
1104 def props = project.properties.sort { it.key }
1105 if (getdownAltJavaMinVersion != null && getdownAltJavaMinVersion.length() > 0) {
1106 props.put("getdown_txt_java_min_version", getdownAltJavaMinVersion)
1108 if (getdownAltJavaMaxVersion != null && getdownAltJavaMaxVersion.length() > 0) {
1109 props.put("getdown_txt_java_max_version", getdownAltJavaMaxVersion)
1111 if (getdownAltMultiJavaLocation != null && getdownAltMultiJavaLocation.length() > 0) {
1112 props.put("getdown_txt_multi_java_location", getdownAltMultiJavaLocation)
1115 props.put("getdown_txt_title", jalview_name)
1116 props.put("getdown_txt_ui.name", install4jApplicationName)
1118 // start with appbase
1119 getdownTextString += "appbase = ${getdownAppBase}\n"
1120 props.each{ prop, val ->
1121 if (prop.startsWith("getdown_txt_") && val != null) {
1122 if (prop.startsWith("getdown_txt_multi_")) {
1123 def key = prop.substring(18)
1124 val.split(",").each{ v ->
1125 def line = "${key} = ${v}\n"
1126 getdownTextString += line
1129 // file values rationalised
1130 if (val.indexOf('/') > -1 || prop.startsWith("getdown_txt_resource")) {
1132 if (val.indexOf('/') == 0) {
1135 } else if (val.indexOf('/') > 0) {
1136 // relative path (relative to jalviewDir)
1137 r = file( "${jalviewDir}/${val}" )
1140 val = "${getdown_resource_dir}/" + r.getName()
1141 getdownWebsiteResourceFilenames += val
1142 getdownResourceFilenames += r.getPath()
1145 if (! prop.startsWith("getdown_txt_resource")) {
1146 def line = prop.substring(12) + " = ${val}\n"
1147 getdownTextString += line
1153 getdownWebsiteResourceFilenames.each{ filename ->
1154 getdownTextString += "resource = ${filename}\n"
1156 getdownResourceFilenames.each{ filename ->
1159 into getdownResourceDir
1164 fileTree(file(packageDir)).each{ f ->
1165 if (f.isDirectory()) {
1166 def files = fileTree(dir: f, include: ["*"]).getFiles()
1168 } else if (f.exists()) {
1172 codeFiles.sort().each{f ->
1173 def name = f.getName()
1174 def line = "code = ${getdownAppDistDir}/${name}\n"
1175 getdownTextString += line
1182 // NOT USING MODULES YET, EVERYTHING SHOULD BE IN dist
1184 if (JAVA_VERSION.equals("11")) {
1185 def j11libFiles = fileTree(dir: "${jalviewDir}/${j11libDir}", include: ["*.jar"]).getFiles()
1186 j11libFiles.sort().each{f ->
1187 def name = f.getName()
1188 def line = "code = ${getdown_j11lib_dir}/${name}\n"
1189 getdownTextString += line
1192 into getdownJ11libDir
1198 // 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.
1199 //getdownTextString += "class = " + file(getdownLauncher).getName() + "\n"
1200 getdownTextString += "resource = ${getdown_launcher_new}\n"
1201 getdownTextString += "class = ${mainClass}\n"
1203 def getdown_txt = file("${getdownWebsiteDir}/getdown.txt")
1204 getdown_txt.write(getdownTextString)
1206 def getdownLaunchJvl = getdown_launch_jvl_name + ( (jvlChannelName != null && jvlChannelName.length() > 0)?"-${jvlChannelName}":"" ) + ".jvl"
1207 def launchJvl = file("${getdownWebsiteDir}/${getdownLaunchJvl}")
1208 launchJvl.write("appbase=${getdownAppBase}")
1211 from getdownLauncher
1212 rename(file(getdownLauncher).getName(), getdown_launcher_new)
1213 into getdownWebsiteDir
1217 from getdownLauncher
1218 if (file(getdownLauncher).getName() != getdown_launcher) {
1219 rename(file(getdownLauncher).getName(), getdown_launcher)
1221 into getdownWebsiteDir
1224 if (! (CHANNEL.startsWith("ARCHIVE") || CHANNEL.startsWith("DEVELOP"))) {
1227 from getdownLauncher
1228 from "${getdownWebsiteDir}/${getdown_build_properties}"
1229 if (file(getdownLauncher).getName() != getdown_launcher) {
1230 rename(file(getdownLauncher).getName(), getdown_launcher)
1232 into getdownInstallDir
1236 from getdownInstallDir
1237 into getdownFilesInstallDir
1244 from getdownLauncher
1245 from "${getdownWebsiteDir}/${getdown_build_properties}"
1246 if (file(getdownLauncher).getName() != getdown_launcher) {
1247 rename(file(getdownLauncher).getName(), getdown_launcher)
1249 into getdownFilesDir
1253 from getdownResourceDir
1254 into "${getdownFilesDir}/${getdown_resource_dir}"
1259 inputs.dir("${jalviewDir}/${packageDir}")
1261 outputs.dir(getdownWebsiteDir)
1262 outputs.dir(getdownFilesDir)
1266 // a helper task to allow getdown digest of any dir: `gradle getdownDigestDir -PDIGESTDIR=/path/to/my/random/getdown/dir
1267 task getdownDigestDir(type: JavaExec) {
1268 def digestDirPropertyName = "DIGESTDIR"
1269 description = "Digest a local dir (-P${digestDirPropertyName}=...) for getdown"
1271 classpath = files(getdownLauncher)
1272 def digestDir = findProperty(digestDirPropertyName)
1273 if (digestDir == null) {
1274 throw new GradleException("Must provide a DIGESTDIR value to produce an alternative getdown digest")
1278 main = "com.threerings.getdown.tools.Digester"
1282 task getdownDigest(type: JavaExec) {
1283 group = "distribution"
1284 description = "Digest the getdown website folder"
1285 dependsOn getdownWebsite
1287 classpath = files(getdownLauncher)
1289 main = "com.threerings.getdown.tools.Digester"
1290 args getdownWebsiteDir
1291 inputs.dir(getdownWebsiteDir)
1292 outputs.file("${getdownWebsiteDir}/digest2.txt")
1297 group = "distribution"
1298 description = "Create the minimal and full getdown app folder for installers and website and create digest file"
1299 dependsOn getdownDigest
1301 if (reportRsyncCommand) {
1302 def fromDir = getdownWebsiteDir + (getdownWebsiteDir.endsWith('/')?'':'/')
1303 def toDir = "${getdown_rsync_dest}/${getdownDir}" + (getdownDir.endsWith('/')?'':'/')
1304 println "LIKELY RSYNC COMMAND:"
1305 println "mkdir -p '$toDir'\nrsync -avh --delete '$fromDir' '$toDir'"
1306 if (RUNRSYNC == "true") {
1308 commandLine "mkdir", "-p", toDir
1311 commandLine "rsync", "-avh", "--delete", fromDir, toDir
1321 delete getdownWebsiteDir
1322 delete getdownFilesDir
1328 if (file(install4jHomeDir).exists()) {
1330 } else if (file(System.getProperty("user.home")+"/buildtools/install4j").exists()) {
1331 install4jHomeDir = System.getProperty("user.home")+"/buildtools/install4j"
1332 } else if (file("/Applications/install4j.app/Contents/Resources/app").exists()) {
1333 install4jHomeDir = "/Applications/install4j.app/Contents/Resources/app"
1335 installDir(file(install4jHomeDir))
1337 mediaTypes = Arrays.asList(install4j_media_types.split(","))
1341 task copyInstall4jTemplate {
1342 def install4jTemplateFile = file("${install4jDir}/${install4j_template}")
1343 def install4jFileAssociationsFile = file("${install4jDir}/${install4j_installer_file_associations}")
1344 inputs.file(install4jTemplateFile)
1345 inputs.file(install4jFileAssociationsFile)
1346 outputs.file(install4jConfFile)
1349 def install4jConfigXml = new XmlParser().parse(install4jTemplateFile)
1351 // turn off code signing if no OSX_KEYPASS
1352 if (OSX_KEYPASS == "") {
1353 install4jConfigXml.'**'.codeSigning.each { codeSigning ->
1354 codeSigning.'@macEnabled' = "false"
1356 install4jConfigXml.'**'.windows.each { windows ->
1357 windows.'@runPostProcessor' = "false"
1361 // turn off checksum creation for LOCAL channel
1362 def e = install4jConfigXml.application[0]
1363 if (CHANNEL == "LOCAL") {
1364 e.'@createChecksums' = "false"
1366 e.'@createChecksums' = "true"
1369 // put file association actions where placeholder action is
1370 def install4jFileAssociationsText = install4jFileAssociationsFile.text
1371 def fileAssociationActions = new XmlParser().parseText("<actions>${install4jFileAssociationsText}</actions>")
1372 install4jConfigXml.'**'.action.any { a ->
1373 if (a.'@name' == 'EXTENSIONS_REPLACED_BY_GRADLE') {
1374 def parent = a.parent()
1376 fileAssociationActions.each { faa ->
1379 // don't need to continue in .any loop once replacements have been made
1384 // write install4j file
1385 install4jConfFile.text = XmlUtil.serialize(install4jConfigXml)
1392 delete install4jConfFile
1397 task installers(type: com.install4j.gradle.Install4jTask) {
1398 group = "distribution"
1399 description = "Create the install4j installers"
1400 dependsOn setGitVals
1402 dependsOn copyInstall4jTemplate
1404 projectFile = install4jConfFile
1406 // create an md5 for the input files to use as version for install4j conf file
1407 def digest = MessageDigest.getInstance("MD5")
1409 (file("${install4jDir}/${install4j_template}").text +
1410 file("${install4jDir}/${install4j_info_plist_file_associations}").text +
1411 file("${install4jDir}/${install4j_installer_file_associations}").text).bytes)
1412 def filesMd5 = new BigInteger(1, digest.digest()).toString(16)
1413 if (filesMd5.length() >= 8) {
1414 filesMd5 = filesMd5.substring(0,8)
1416 def install4jTemplateVersion = "${JALVIEW_VERSION}_F${filesMd5}_C${gitHash}"
1417 // make install4jBuildDir relative to jalviewDir
1418 def install4jBuildDir = "${install4j_build_dir}/${JAVA_VERSION}"
1421 'JALVIEW_NAME': jalview_name,
1422 'JALVIEW_APPLICATION_NAME': install4jApplicationName,
1423 'JALVIEW_DIR': "../..",
1424 'OSX_KEYSTORE': OSX_KEYSTORE,
1425 'JSIGN_SH': JSIGN_SH,
1426 'JRE_DIR': getdown_app_dir_java,
1427 'INSTALLER_TEMPLATE_VERSION': install4jTemplateVersion,
1428 'JALVIEW_VERSION': JALVIEW_VERSION,
1429 'JAVA_MIN_VERSION': JAVA_MIN_VERSION,
1430 'JAVA_MAX_VERSION': JAVA_MAX_VERSION,
1431 'JAVA_VERSION': JAVA_VERSION,
1432 'JAVA_INTEGER_VERSION': JAVA_INTEGER_VERSION,
1433 'VERSION': JALVIEW_VERSION,
1434 'MACOS_JAVA_VM_DIR': macosJavaVMDir,
1435 'WINDOWS_JAVA_VM_DIR': windowsJavaVMDir,
1436 'LINUX_JAVA_VM_DIR': linuxJavaVMDir,
1437 'MACOS_JAVA_VM_TGZ': macosJavaVMTgz,
1438 'WINDOWS_JAVA_VM_TGZ': windowsJavaVMTgz,
1439 'LINUX_JAVA_VM_TGZ': linuxJavaVMTgz,
1440 'COPYRIGHT_MESSAGE': install4j_copyright_message,
1441 'BUNDLE_ID': install4jBundleId,
1442 'INTERNAL_ID': install4jInternalId,
1443 'WINDOWS_APPLICATION_ID': install4jWinApplicationId,
1444 'MACOS_DS_STORE': install4jDSStore,
1445 'MACOS_DMG_BG_IMAGE': install4jDMGBackgroundImage,
1446 'INSTALLER_NAME': install4jInstallerName,
1447 'INSTALL4J_UTILS_DIR': install4j_utils_dir,
1448 'GETDOWN_WEBSITE_DIR': getdown_website_dir,
1449 'GETDOWN_FILES_DIR': getdown_files_dir,
1450 'GETDOWN_RESOURCE_DIR': getdown_resource_dir,
1451 'GETDOWN_DIST_DIR': getdownAppDistDir,
1452 'GETDOWN_ALT_DIR': getdown_app_dir_alt,
1453 'GETDOWN_INSTALL_DIR': getdown_install_dir,
1454 'INFO_PLIST_FILE_ASSOCIATIONS_FILE': install4j_info_plist_file_associations,
1455 'BUILD_DIR': install4jBuildDir,
1456 'UNIX_DESKTOP_ADDITIONS': install4j_unix_desktop_additions,
1457 'APPLICATION_FOLDER': install4jApplicationFolder,
1458 'UNIX_APPLICATION_FOLDER': install4jUnixApplicationFolder,
1459 'EXECUTABLE_NAME': install4jExecutableName,
1460 'EXTRA_SCHEME': install4jExtraScheme,
1463 //println("INSTALL4J VARIABLES:")
1464 //variables.each{k,v->println("${k}=${v}")}
1466 destination = "${jalviewDir}/${install4jBuildDir}"
1467 buildSelected = true
1469 if (install4j_faster.equals("true") || CHANNEL.startsWith("LOCAL")) {
1471 disableSigning = true
1475 macKeystorePassword = OSX_KEYPASS
1479 println("Using projectFile "+projectFile)
1482 inputs.dir(getdownWebsiteDir)
1483 inputs.file(install4jConfFile)
1484 inputs.file("${install4jDir}/${install4j_info_plist_file_associations}")
1485 inputs.dir(macosJavaVMDir)
1486 inputs.dir(windowsJavaVMDir)
1487 outputs.dir("${jalviewDir}/${install4j_build_dir}/${JAVA_VERSION}")
1491 task sourceDist(type: Tar) {
1493 def VERSION_UNDERSCORES = JALVIEW_VERSION.replaceAll("\\.", "_")
1494 def outputFileName = "${project.name}_${VERSION_UNDERSCORES}.tar.gz"
1495 // cater for buildship < 3.1 [3.0.1 is max version in eclipse 2018-09]
1497 archiveFileName = outputFileName
1498 } catch (Exception e) {
1499 archiveName = outputFileName
1502 compression Compression.GZIP
1517 "**/*.class","$j11modDir/**/*.jar","appletlib","**/*locales",
1519 "utils/InstallAnywhere",
1534 "gradle.properties",
1545 ".settings/org.eclipse.jdt.core.jalview.prefs",
1549 exclude (EXCLUDE_FILES)
1550 include (PROCESS_FILES)
1551 filter(ReplaceTokens,
1555 'Version-Rel': JALVIEW_VERSION,
1556 'Year-Rel': getDate("yyyy")
1561 exclude (EXCLUDE_FILES)
1562 exclude (PROCESS_FILES)
1563 exclude ("appletlib")
1564 exclude ("**/*locales")
1565 exclude ("*locales/**")
1566 exclude ("utils/InstallAnywhere")
1568 exclude (getdown_files_dir)
1569 exclude (getdown_website_dir)
1571 // exluding these as not using jars as modules yet
1572 exclude ("$j11modDir/**/*.jar")
1575 include(INCLUDE_FILES)
1577 // from (jalviewDir) {
1578 // // explicit includes for stuff that seemed to not get included
1579 // include(fileTree("test/**/*."))
1580 // exclude(EXCLUDE_FILES)
1581 // exclude(PROCESS_FILES)
1588 dependsOn pubhtmlhelp
1590 inputs.dir("${classesDir}/${help_dir}")
1591 outputs.dir("${buildDir}/distributions/${help_dir}")
1594 // LARGE AMOUNT OF JALVIEWJS STUFF DELETED HERE
1595 task eclipseAutoBuildTask {}
1596 task eclipseSynchronizationTask {}