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 = install4jApplicationName
285 .replaceAll("[^\\w\\-\\.]", "_") // replace other non [alphanumeric,_,-,.]
286 .replaceAll("_+", "_") // collapse __
287 .replaceAll("_*-_*", "-") // collapse _-_
290 getdownAppDir = string("${getdownWebsiteDir}/${getdownAppDistDir}")
291 //getdownJ11libDir = "${getdownWebsiteDir}/${getdown_j11lib_dir}"
292 getdownResourceDir = string("${getdownWebsiteDir}/${getdown_resource_dir}")
293 getdownInstallDir = string("${getdownWebsiteDir}/${getdown_install_dir}")
294 getdownFilesDir = string("${jalviewDir}/${getdown_files_dir}/${JAVA_VERSION}/")
295 getdownFilesInstallDir = string("${getdownFilesDir}/${getdown_install_dir}")
296 /* compile without modules -- using classpath libraries
297 modules_compileClasspath = fileTree(dir: "${jalviewDir}/${j11modDir}", include: ["*.jar"])
298 modules_runtimeClasspath = modules_compileClasspath
301 gitBranch = string("")
303 println("Using a ${CHANNEL} profile.")
305 additional_compiler_args = []
306 // configure classpath/args for j8/j11 compilation
307 if (JAVA_VERSION.equals("1.8")) {
308 JAVA_INTEGER_VERSION = string("8")
311 libDistDir = j8libDir
312 compile_source_compatibility = 1.8
313 compile_target_compatibility = 1.8
314 // these are getdown.txt properties defined dependent on the JAVA_VERSION
315 getdownAltJavaMinVersion = string(findProperty("getdown_alt_java8_min_version"))
316 getdownAltJavaMaxVersion = string(findProperty("getdown_alt_java8_max_version"))
317 // this property is assigned below and expanded to multiple lines in the getdown task
318 getdownAltMultiJavaLocation = string(findProperty("getdown_alt_java8_txt_multi_java_location"))
319 // this property is for the Java library used in eclipse
320 eclipseJavaRuntimeName = string("JavaSE-1.8")
321 } else if (JAVA_VERSION.equals("11")) {
322 JAVA_INTEGER_VERSION = string("11")
324 libDistDir = j11libDir
325 compile_source_compatibility = 11
326 compile_target_compatibility = 11
327 getdownAltJavaMinVersion = string(findProperty("getdown_alt_java11_min_version"))
328 getdownAltJavaMaxVersion = string(findProperty("getdown_alt_java11_max_version"))
329 getdownAltMultiJavaLocation = string(findProperty("getdown_alt_java11_txt_multi_java_location"))
330 eclipseJavaRuntimeName = string("JavaSE-11")
331 /* compile without modules -- using classpath libraries
332 additional_compiler_args += [
333 '--module-path', modules_compileClasspath.asPath,
334 '--add-modules', j11modules
337 } else if (JAVA_VERSION.equals("12") || JAVA_VERSION.equals("13")) {
338 JAVA_INTEGER_VERSION = JAVA_VERSION
340 libDistDir = j11libDir
341 compile_source_compatibility = JAVA_VERSION
342 compile_target_compatibility = JAVA_VERSION
343 getdownAltJavaMinVersion = string(findProperty("getdown_alt_java11_min_version"))
344 getdownAltJavaMaxVersion = string(findProperty("getdown_alt_java11_max_version"))
345 getdownAltMultiJavaLocation = string(findProperty("getdown_alt_java11_txt_multi_java_location"))
346 eclipseJavaRuntimeName = string("JavaSE-11")
347 /* compile without modules -- using classpath libraries
348 additional_compiler_args += [
349 '--module-path', modules_compileClasspath.asPath,
350 '--add-modules', j11modules
354 throw new GradleException("JAVA_VERSION=${JAVA_VERSION} not currently supported by Jalview")
359 JAVA_MIN_VERSION = JAVA_VERSION
360 JAVA_MAX_VERSION = JAVA_VERSION
361 def jreInstallsDir = string(jre_installs_dir)
362 if (jreInstallsDir.startsWith("~/")) {
363 jreInstallsDir = System.getProperty("user.home") + jreInstallsDir.substring(1)
365 macosJavaVMDir = string("${jreInstallsDir}/jre-${JAVA_INTEGER_VERSION}-mac-x64/jre")
366 macosJavaVMTgz = string("${jreInstallsDir}/tgz/jre-${JAVA_INTEGER_VERSION}-mac-x64.tar.gz")
367 windowsJavaVMDir = string("${jreInstallsDir}/jre-${JAVA_INTEGER_VERSION}-windows-x64/jre")
368 windowsJavaVMTgz = string("${jreInstallsDir}/tgz/jre-${JAVA_INTEGER_VERSION}-windows-x64.tar.gz")
369 linuxJavaVMDir = string("${jreInstallsDir}/jre-${JAVA_INTEGER_VERSION}-linux-x64/jre")
370 linuxJavaVMTgz = string("${jreInstallsDir}/tgz/jre-${JAVA_INTEGER_VERSION}-linux-x64.tar.gz")
371 install4jDir = string("${jalviewDir}/${install4j_utils_dir}")
372 install4jConfFileName = string("jalview-install4j-conf.install4j")
373 install4jConfFile = file("${install4jDir}/${install4jConfFileName}")
374 install4jHomeDir = install4j_home_dir
375 if (install4jHomeDir.startsWith("~/")) {
376 install4jHomeDir = System.getProperty("user.home") + install4jHomeDir.substring(1)
381 buildingHTML = string("${jalviewDir}/${docDir}/building.html")
382 helpFile = string("${classesDir}/${help_dir}/help.jhm")
383 helpParentDir = string("${jalviewDir}/${help_parent_dir}")
384 helpSourceDir = string("${helpParentDir}/${help_dir}")
387 relativeBuildDir = file(jalviewDirAbsolutePath).toPath().relativize(buildDir.toPath())
388 jalviewjsBuildDir = string("${relativeBuildDir}/jalviewjs")
389 jalviewjsSiteDir = string("${jalviewjsBuildDir}/${jalviewjs_site_dir}")
391 jalviewjsTransferSiteJsDir = string(jalviewjsSiteDir)
393 jalviewjsTransferSiteJsDir = string("${jalviewjsBuildDir}/tmp/${jalviewjs_site_dir}_js")
395 jalviewjsTransferSiteLibDir = string("${jalviewjsBuildDir}/tmp/${jalviewjs_site_dir}_lib")
396 jalviewjsTransferSiteSwingJsDir = string("${jalviewjsBuildDir}/tmp/${jalviewjs_site_dir}_swingjs")
397 jalviewjsTransferSiteCoreDir = string("${jalviewjsBuildDir}/tmp/${jalviewjs_site_dir}_core")
398 jalviewjsJalviewCoreHtmlFile = string("")
399 jalviewjsJalviewCoreName = string(jalviewjs_core_name)
400 jalviewjsCoreClasslists = []
401 jalviewjsJalviewTemplateName = string(jalviewjs_name)
402 jalviewjsJ2sSettingsFileName = string("${jalviewDir}/${jalviewjs_j2s_settings}")
403 jalviewjsJ2sProps = null
405 eclipseWorkspace = null
406 eclipseBinary = string("")
407 eclipseVersion = string("")
417 outputDir = file(classesDir)
422 srcDirs += helpParentDir
425 jar.destinationDir = file("${jalviewDir}/${packageDir}")
427 compileClasspath = files(sourceSets.main.java.outputDir)
428 //compileClasspath += files(sourceSets.main.resources.srcDirs)
429 compileClasspath += fileTree(dir: "${jalviewDir}/${libDir}", include: ["*.jar"])
431 runtimeClasspath = compileClasspath
436 srcDirs = [ cloverInstrDir ]
437 outputDir = file("${buildDir}/${cloverClassesDir}")
441 srcDirs = sourceSets.main.resources.srcDirs
443 compileClasspath = configurations.cloverRuntime + files( sourceSets.clover.java.outputDir )
444 compileClasspath += files(sourceSets.main.java.outputDir)
445 compileClasspath += sourceSets.main.compileClasspath
446 compileClasspath += fileTree(dir: "${jalviewDir}/${utilsDir}", include: ["**/*.jar"])
447 compileClasspath += fileTree(dir: "${jalviewDir}/${libDir}", include: ["*.jar"])
449 runtimeClasspath = compileClasspath
454 srcDirs testSourceDir
455 outputDir = file("${jalviewDir}/${testOutputDir}")
459 srcDirs = sourceSets.main.resources.srcDirs
462 compileClasspath = files( sourceSets.test.java.outputDir )
465 compileClasspath = sourceSets.clover.compileClasspath
467 compileClasspath += files(sourceSets.main.java.outputDir)
470 compileClasspath += fileTree(dir: "${jalviewDir}/${libDir}", include: ["*.jar"])
471 compileClasspath += fileTree(dir: "${jalviewDir}/${utilsDir}/testnglibs", include: ["**/*.jar"])
472 compileClasspath += fileTree(dir: "${jalviewDir}/${utilsDir}/testlibs", include: ["**/*.jar"])
474 runtimeClasspath = compileClasspath
482 cloverCompile 'org.openclover:clover:4.4.1'
483 testCompile 'org.openclover:clover:4.4.1'
489 cloverRuntime.extendsFrom cloverCompile
493 // eclipse project and settings files creation, also used by buildship
496 name = eclipse_project_name
498 natures 'org.eclipse.jdt.core.javanature',
499 'org.eclipse.jdt.groovy.core.groovyNature',
500 'org.eclipse.buildship.core.gradleprojectnature'
502 buildCommand 'org.eclipse.jdt.core.javabuilder'
503 buildCommand 'org.eclipse.buildship.core.gradleprojectbuilder'
507 //defaultOutputDir = sourceSets.main.java.outputDir
510 if (it.isCanBeResolved()) {
515 minusConfigurations += removeThese
516 plusConfigurations = [ ]
520 def removeTheseToo = []
521 HashMap<String, Boolean> alreadyAddedSrcPath = new HashMap<>();
522 cp.entries.each { entry ->
523 // This conditional removes all src classpathentries that a) have already been added or b) aren't "src" or "test".
524 // e.g. this removes the resources dir being copied into bin/main, bin/test AND bin/clover
525 // we add the resources and help/help dirs in as libs afterwards (see below)
526 if (entry.kind == 'src') {
527 if (alreadyAddedSrcPath.getAt(entry.path) || !(entry.path == bareSourceDir || entry.path == bareTestSourceDir)) {
528 removeTheseToo += entry
530 alreadyAddedSrcPath.putAt(entry.path, true)
535 cp.entries.removeAll(removeTheseToo)
537 //cp.entries += new Output("${eclipse_bin_dir}/main")
538 if (file(helpParentDir).isDirectory()) {
539 cp.entries += new Library(fileReference(helpParentDir))
541 if (file(resourceDir).isDirectory()) {
542 cp.entries += new Library(fileReference(resourceDir))
545 HashMap<String, Boolean> alreadyAddedLibPath = new HashMap<>();
547 sourceSets.main.compileClasspath.findAll { it.name.endsWith(".jar") }.any {
548 //don't want to add outputDir as eclipse is using its own output dir in bin/main
549 if (it.isDirectory() || ! it.exists()) {
550 // don't add dirs to classpath, especially if they don't exist
551 return false // groovy "continue" in .any closure
553 def itPath = it.toString()
554 if (itPath.startsWith("${jalviewDirAbsolutePath}/")) {
555 // make relative path
556 itPath = itPath.substring(jalviewDirAbsolutePath.length()+1)
558 if (alreadyAddedLibPath.get(itPath)) {
559 //println("Not adding duplicate entry "+itPath)
561 //println("Adding entry "+itPath)
562 cp.entries += new Library(fileReference(itPath))
563 alreadyAddedLibPath.put(itPath, true)
567 sourceSets.test.compileClasspath.findAll { it.name.endsWith(".jar") }.any {
568 //no longer want to add outputDir as eclipse is using its own output dir in bin/main
569 if (it.isDirectory() || ! it.exists()) {
570 // don't add dirs to classpath
571 return false // groovy "continue" in .any closure
574 def itPath = it.toString()
575 if (itPath.startsWith("${jalviewDirAbsolutePath}/")) {
576 itPath = itPath.substring(jalviewDirAbsolutePath.length()+1)
578 if (alreadyAddedLibPath.get(itPath)) {
581 def lib = new Library(fileReference(itPath))
582 lib.entryAttributes["test"] = "true"
584 alreadyAddedLibPath.put(itPath, true)
592 containers 'org.eclipse.buildship.core.gradleclasspathcontainer'
597 // for the IDE, use java 11 compatibility
598 sourceCompatibility = compile_source_compatibility
599 targetCompatibility = compile_target_compatibility
600 javaRuntimeName = eclipseJavaRuntimeName
602 // add in jalview project specific properties/preferences into eclipse core preferences
604 withProperties { props ->
605 def jalview_prefs = new Properties()
606 def ins = new FileInputStream("${jalviewDirAbsolutePath}/${eclipse_extra_jdt_prefs_file}")
607 jalview_prefs.load(ins)
609 jalview_prefs.forEach { t, v ->
610 if (props.getAt(t) == null) {
620 // Don't want these to be activated if in headless build
621 synchronizationTasks "eclipseSynchronizationTask"
622 autoBuildTasks "eclipseAutoBuildTask"
629 // only instrument source, we build test classes as normal
630 inputs.files files (sourceSets.main.allJava,sourceSets.test.allJava) // , fileTree(dir:"$jalviewDir/$testSourceDir", include: ["**/*.java"]))
631 outputs.dir cloverInstrDir
634 delete cloverInstrDir
639 cloverInstrDir.getPath(),
642 inputs.files.files.collect(
643 { file -> file.absolutePath }
646 String[] args = argsList.toArray()
647 println("About to instrument "+args.length +" files")
648 com.atlassian.clover.CloverInstr.mainImpl(args)
653 cloverClasses.dependsOn cloverInstr
657 group = "Verification"
658 description = "Creates the Clover report"
659 inputs.dir "${buildDir}/clover"
660 outputs.dir "${reportsDir}/clover"
662 file(cloverDb).exists()
669 "${reportsDir}/clover"
671 String[] args = argsList.toArray()
672 com.atlassian.clover.reporters.html.HtmlReporter.runReport(args)
674 // and generate ${reportsDir}/clover/clover.xml
679 "${reportsDir}/clover/clover.xml"
681 com.atlassian.clover.reporters.xml.XMLReporter.runReport(args)
689 sourceCompatibility = compile_source_compatibility
690 targetCompatibility = compile_target_compatibility
691 options.compilerArgs += additional_compiler_args
692 print ("Setting target compatibility to "+targetCompatibility+"\n")
694 classpath += configurations.cloverRuntime
700 delete cloverInstrDir
710 sourceCompatibility = compile_source_compatibility
711 targetCompatibility = compile_target_compatibility
712 options.compilerArgs = additional_compiler_args
713 print ("Setting target compatibility to "+targetCompatibility+"\n")
721 dependsOn compileCloverJava
722 classpath += configurations.cloverRuntime
724 classpath += sourceSets.main.runtimeClasspath
727 sourceCompatibility = compile_source_compatibility
728 targetCompatibility = compile_target_compatibility
729 options.compilerArgs = additional_compiler_args
730 print ("Setting target compatibility to "+targetCompatibility+"\n")
737 delete sourceSets.main.java.outputDir
743 dependsOn cleanClover
745 delete sourceSets.test.java.outputDir
750 // format is a string like date.format("dd MMMM yyyy")
751 def getDate(format) {
752 def date = new Date()
753 return date.format(format)
758 def hashStdOut = new ByteArrayOutputStream()
760 commandLine "git", "rev-parse", "--short", "HEAD"
761 standardOutput = hashStdOut
765 def branchStdOut = new ByteArrayOutputStream()
767 commandLine "git", "rev-parse", "--abbrev-ref", "HEAD"
768 standardOutput = branchStdOut
772 gitHash = hashStdOut.toString().trim()
773 gitBranch = branchStdOut.toString().trim()
775 outputs.upToDateWhen { false }
779 task createBuildProperties(type: WriteProperties) {
781 inputs.dir(sourceDir)
782 inputs.dir(resourceDir)
783 file(buildProperties).getParentFile().mkdirs()
784 outputFile (buildProperties)
785 // taking time specific comment out to allow better incremental builds
786 comment "--Jalview Build Details--\n"+getDate("yyyy-MM-dd HH:mm:ss")
787 //comment "--Jalview Build Details--\n"+getDate("yyyy-MM-dd")
788 property "BUILD_DATE", getDate("HH:mm:ss dd MMMM yyyy")
789 property "VERSION", JALVIEW_VERSION
790 property "INSTALLATION", INSTALLATION+" git-commit:"+gitHash+" ["+gitBranch+"]"
791 outputs.file(outputFile)
795 task cleanBuildingHTML(type: Delete) {
802 task convertBuildingMD(type: Exec) {
803 dependsOn cleanBuildingHTML
804 def buildingMD = "${jalviewDir}/${docDir}/building.md"
805 def css = "${jalviewDir}/${docDir}/github.css"
808 pandoc_exec.split(",").each {
809 if (file(it.trim()).exists()) {
815 def hostname = "hostname".execute().text.trim()
816 def buildtoolsPandoc = System.getProperty("user.home")+"/buildtools/pandoc/bin/pandoc"
817 if ((pandoc == null || ! file(pandoc).exists()) && file(buildtoolsPandoc).exists()) {
818 pandoc = System.getProperty("user.home")+"/buildtools/pandoc/bin/pandoc"
822 if (pandoc != null && file(pandoc).exists()) {
823 commandLine pandoc, '-s', '-o', buildingHTML, '--metadata', 'pagetitle="Building Jalview from Source"', '--toc', '-H', css, buildingMD
825 println("Cannot find pandoc. Skipping convert building.md to HTML")
826 throw new StopExecutionException("Cannot find pandoc. Skipping convert building.md to HTML")
832 inputs.file(buildingMD)
834 outputs.file(buildingHTML)
845 task syncDocs(type: Sync) {
846 dependsOn convertBuildingMD
847 def syncDir = "${classesDir}/${docDir}"
848 from fileTree("${jalviewDir}/${docDir}")
854 task copyHelp(type: Copy) {
855 def inputDir = helpSourceDir
856 def outputDir = "${classesDir}/${help_dir}"
861 filter(ReplaceTokens,
865 'Version-Rel': JALVIEW_VERSION,
866 'Year-Rel': getDate("yyyy")
878 outputs.files(helpFile)
879 outputs.dir(outputDir)
883 task syncLib(type: Sync) {
884 def syncDir = "${classesDir}/${libDistDir}"
885 from fileTree("${jalviewDir}/${libDistDir}")
890 task syncResources(type: Sync) {
901 dependsOn syncResources
907 //testReportDirName = "test-reports" // note that test workingDir will be $jalviewDir
910 dependsOn compileJava
912 dependsOn cloverInstr
916 print("Running tests " + (use_clover?"WITH":"WITHOUT") + " clover [clover="+use_clover+"]\n")
920 includeGroups testngGroups
921 excludeGroups testngExcludedGroups
923 useDefaultListeners=true
926 maxHeapSize = "1024m"
928 workingDir = jalviewDir
929 //systemProperties 'clover.jar' System.properties.clover.jar
930 sourceCompatibility = compile_source_compatibility
931 targetCompatibility = compile_target_compatibility
932 jvmArgs += additional_compiler_args
937 task buildIndices(type: JavaExec) {
939 classpath = sourceSets.main.compileClasspath
940 main = "com.sun.java.help.search.Indexer"
941 workingDir = "${classesDir}/${help_dir}"
944 inputs.dir("${workingDir}/${argDir}")
946 outputs.dir("${classesDir}/doc")
947 outputs.dir("${classesDir}/help")
948 outputs.file("${workingDir}/JavaHelpSearch/DOCS")
949 outputs.file("${workingDir}/JavaHelpSearch/DOCS.TAB")
950 outputs.file("${workingDir}/JavaHelpSearch/OFFSETS")
951 outputs.file("${workingDir}/JavaHelpSearch/POSITIONS")
952 outputs.file("${workingDir}/JavaHelpSearch/SCHEMA")
953 outputs.file("${workingDir}/JavaHelpSearch/TMAP")
957 task compileLinkCheck(type: JavaCompile) {
959 classpath = files("${jalviewDir}/${utilsDir}")
960 destinationDir = file("${jalviewDir}/${utilsDir}")
961 source = fileTree(dir: "${jalviewDir}/${utilsDir}", include: ["HelpLinksChecker.java", "BufferedLineReader.java"])
963 inputs.file("${jalviewDir}/${utilsDir}/HelpLinksChecker.java")
964 inputs.file("${jalviewDir}/${utilsDir}/HelpLinksChecker.java")
965 outputs.file("${jalviewDir}/${utilsDir}/HelpLinksChecker.class")
966 outputs.file("${jalviewDir}/${utilsDir}/BufferedLineReader.class")
970 task linkCheck(type: JavaExec) {
971 dependsOn prepare, compileLinkCheck
973 def helpLinksCheckerOutFile = file("${jalviewDir}/${utilsDir}/HelpLinksChecker.out")
974 classpath = files("${jalviewDir}/${utilsDir}")
975 main = "HelpLinksChecker"
976 workingDir = jalviewDir
977 args = [ "${classesDir}/${help_dir}", "-nointernet" ]
979 def outFOS = new FileOutputStream(helpLinksCheckerOutFile, false) // false == don't append
981 standardOutput = new org.apache.tools.ant.util.TeeOutputStream(
984 errorOutput = new org.apache.tools.ant.util.TeeOutputStream(
988 inputs.dir("${classesDir}/${help_dir}")
989 outputs.file(helpLinksCheckerOutFile)
992 // import the pubhtmlhelp target
993 ant.properties.basedir = "${jalviewDir}"
994 ant.properties.helpBuildDir = "${jalviewDirAbsolutePath}/${classes_dir}/${help_dir}"
995 ant.importBuild "${utilsDir}/publishHelp.xml"
998 task cleanPackageDir(type: Delete) {
1000 delete fileTree(dir: "${jalviewDir}/${packageDir}", include: "*.jar")
1006 dependsOn buildIndices
1007 dependsOn createBuildProperties
1010 attributes "Main-Class": mainClass,
1011 "Permissions": "all-permissions",
1012 "Application-Name": "Jalview Desktop",
1013 "Codebase": application_codebase
1016 destinationDir = file("${jalviewDir}/${packageDir}")
1017 archiveName = rootProject.name+".jar"
1023 exclude "**/*.jar.*"
1025 inputs.dir(classesDir)
1026 outputs.file("${jalviewDir}/${packageDir}/${archiveName}")
1030 task copyJars(type: Copy) {
1031 from fileTree(dir: classesDir, include: "**/*.jar").files
1032 into "${jalviewDir}/${packageDir}"
1036 // doing a Sync instead of Copy as Copy doesn't deal with "outputs" very well
1037 task syncJars(type: Sync) {
1038 from fileTree(dir: "${jalviewDir}/${libDistDir}", include: "**/*.jar").files
1039 into "${jalviewDir}/${packageDir}"
1041 include jar.archiveName
1048 description = "Put all required libraries in dist"
1049 // order of "cleanPackageDir", "copyJars", "jar" important!
1050 jar.mustRunAfter cleanPackageDir
1051 syncJars.mustRunAfter cleanPackageDir
1052 dependsOn cleanPackageDir
1055 outputs.dir("${jalviewDir}/${packageDir}")
1060 dependsOn cleanPackageDir
1066 group = "distribution"
1070 from ("${jalviewDir}/${libDistDir}") {
1074 attributes 'Implementation-Version': JALVIEW_VERSION
1076 mainClassName = shadowJarMainClass
1078 classifier = "all-"+JALVIEW_VERSION+"-j"+JAVA_VERSION
1083 task getdownWebsite() {
1084 group = "distribution"
1085 description = "Create the getdown minimal app folder, and website folder for this version of jalview. Website folder also used for offline app installer"
1090 def getdownWebsiteResourceFilenames = []
1091 def getdownTextString = ""
1092 def getdownResourceDir = getdownResourceDir
1093 def getdownResourceFilenames = []
1096 // clean the getdown website and files dir before creating getdown folders
1097 delete getdownWebsiteDir
1098 delete getdownFilesDir
1101 from buildProperties
1102 rename(build_properties_file, getdown_build_properties)
1105 getdownWebsiteResourceFilenames += "${getdownAppDistDir}/${getdown_build_properties}"
1107 // set some getdown_txt_ properties then go through all properties looking for getdown_txt_...
1108 def props = project.properties.sort { it.key }
1109 if (getdownAltJavaMinVersion != null && getdownAltJavaMinVersion.length() > 0) {
1110 props.put("getdown_txt_java_min_version", getdownAltJavaMinVersion)
1112 if (getdownAltJavaMaxVersion != null && getdownAltJavaMaxVersion.length() > 0) {
1113 props.put("getdown_txt_java_max_version", getdownAltJavaMaxVersion)
1115 if (getdownAltMultiJavaLocation != null && getdownAltMultiJavaLocation.length() > 0) {
1116 props.put("getdown_txt_multi_java_location", getdownAltMultiJavaLocation)
1119 props.put("getdown_txt_title", jalview_name)
1120 props.put("getdown_txt_ui.name", install4jApplicationName)
1122 // start with appbase
1123 getdownTextString += "appbase = ${getdownAppBase}\n"
1124 props.each{ prop, val ->
1125 if (prop.startsWith("getdown_txt_") && val != null) {
1126 if (prop.startsWith("getdown_txt_multi_")) {
1127 def key = prop.substring(18)
1128 val.split(",").each{ v ->
1129 def line = "${key} = ${v}\n"
1130 getdownTextString += line
1133 // file values rationalised
1134 if (val.indexOf('/') > -1 || prop.startsWith("getdown_txt_resource")) {
1136 if (val.indexOf('/') == 0) {
1139 } else if (val.indexOf('/') > 0) {
1140 // relative path (relative to jalviewDir)
1141 r = file( "${jalviewDir}/${val}" )
1144 val = "${getdown_resource_dir}/" + r.getName()
1145 getdownWebsiteResourceFilenames += val
1146 getdownResourceFilenames += r.getPath()
1149 if (! prop.startsWith("getdown_txt_resource")) {
1150 def line = prop.substring(12) + " = ${val}\n"
1151 getdownTextString += line
1157 getdownWebsiteResourceFilenames.each{ filename ->
1158 getdownTextString += "resource = ${filename}\n"
1160 getdownResourceFilenames.each{ filename ->
1163 into getdownResourceDir
1168 fileTree(file(packageDir)).each{ f ->
1169 if (f.isDirectory()) {
1170 def files = fileTree(dir: f, include: ["*"]).getFiles()
1172 } else if (f.exists()) {
1176 codeFiles.sort().each{f ->
1177 def name = f.getName()
1178 def line = "code = ${getdownAppDistDir}/${name}\n"
1179 getdownTextString += line
1186 // NOT USING MODULES YET, EVERYTHING SHOULD BE IN dist
1188 if (JAVA_VERSION.equals("11")) {
1189 def j11libFiles = fileTree(dir: "${jalviewDir}/${j11libDir}", include: ["*.jar"]).getFiles()
1190 j11libFiles.sort().each{f ->
1191 def name = f.getName()
1192 def line = "code = ${getdown_j11lib_dir}/${name}\n"
1193 getdownTextString += line
1196 into getdownJ11libDir
1202 // 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.
1203 //getdownTextString += "class = " + file(getdownLauncher).getName() + "\n"
1204 getdownTextString += "resource = ${getdown_launcher_new}\n"
1205 getdownTextString += "class = ${mainClass}\n"
1207 def getdown_txt = file("${getdownWebsiteDir}/getdown.txt")
1208 getdown_txt.write(getdownTextString)
1210 def getdownLaunchJvl = getdown_launch_jvl_name + ( (jvlChannelName != null && jvlChannelName.length() > 0)?"-${jvlChannelName}":"" ) + ".jvl"
1211 def launchJvl = file("${getdownWebsiteDir}/${getdownLaunchJvl}")
1212 launchJvl.write("appbase=${getdownAppBase}")
1215 from getdownLauncher
1216 rename(file(getdownLauncher).getName(), getdown_launcher_new)
1217 into getdownWebsiteDir
1221 from getdownLauncher
1222 if (file(getdownLauncher).getName() != getdown_launcher) {
1223 rename(file(getdownLauncher).getName(), getdown_launcher)
1225 into getdownWebsiteDir
1228 if (! (CHANNEL.startsWith("ARCHIVE") || CHANNEL.startsWith("DEVELOP"))) {
1231 from getdownLauncher
1232 from "${getdownWebsiteDir}/${getdown_build_properties}"
1233 if (file(getdownLauncher).getName() != getdown_launcher) {
1234 rename(file(getdownLauncher).getName(), getdown_launcher)
1236 into getdownInstallDir
1240 from getdownInstallDir
1241 into getdownFilesInstallDir
1248 from getdownLauncher
1249 from "${getdownWebsiteDir}/${getdown_build_properties}"
1250 if (file(getdownLauncher).getName() != getdown_launcher) {
1251 rename(file(getdownLauncher).getName(), getdown_launcher)
1253 into getdownFilesDir
1257 from getdownResourceDir
1258 into "${getdownFilesDir}/${getdown_resource_dir}"
1263 inputs.dir("${jalviewDir}/${packageDir}")
1265 outputs.dir(getdownWebsiteDir)
1266 outputs.dir(getdownFilesDir)
1270 // a helper task to allow getdown digest of any dir: `gradle getdownDigestDir -PDIGESTDIR=/path/to/my/random/getdown/dir
1271 task getdownDigestDir(type: JavaExec) {
1272 def digestDirPropertyName = "DIGESTDIR"
1273 description = "Digest a local dir (-P${digestDirPropertyName}=...) for getdown"
1275 classpath = files(getdownLauncher)
1276 def digestDir = findProperty(digestDirPropertyName)
1277 if (digestDir == null) {
1278 throw new GradleException("Must provide a DIGESTDIR value to produce an alternative getdown digest")
1282 main = "com.threerings.getdown.tools.Digester"
1286 task getdownDigest(type: JavaExec) {
1287 group = "distribution"
1288 description = "Digest the getdown website folder"
1289 dependsOn getdownWebsite
1291 classpath = files(getdownLauncher)
1293 main = "com.threerings.getdown.tools.Digester"
1294 args getdownWebsiteDir
1295 inputs.dir(getdownWebsiteDir)
1296 outputs.file("${getdownWebsiteDir}/digest2.txt")
1301 group = "distribution"
1302 description = "Create the minimal and full getdown app folder for installers and website and create digest file"
1303 dependsOn getdownDigest
1305 if (reportRsyncCommand) {
1306 def fromDir = getdownWebsiteDir + (getdownWebsiteDir.endsWith('/')?'':'/')
1307 def toDir = "${getdown_rsync_dest}/${getdownDir}" + (getdownDir.endsWith('/')?'':'/')
1308 println "LIKELY RSYNC COMMAND:"
1309 println "mkdir -p '$toDir'\nrsync -avh --delete '$fromDir' '$toDir'"
1310 if (RUNRSYNC == "true") {
1312 commandLine "mkdir", "-p", toDir
1315 commandLine "rsync", "-avh", "--delete", fromDir, toDir
1325 delete getdownWebsiteDir
1326 delete getdownFilesDir
1332 if (file(install4jHomeDir).exists()) {
1334 } else if (file(System.getProperty("user.home")+"/buildtools/install4j").exists()) {
1335 install4jHomeDir = System.getProperty("user.home")+"/buildtools/install4j"
1336 } else if (file("/Applications/install4j.app/Contents/Resources/app").exists()) {
1337 install4jHomeDir = "/Applications/install4j.app/Contents/Resources/app"
1339 installDir(file(install4jHomeDir))
1341 mediaTypes = Arrays.asList(install4j_media_types.split(","))
1345 task copyInstall4jTemplate {
1346 def install4jTemplateFile = file("${install4jDir}/${install4j_template}")
1347 def install4jFileAssociationsFile = file("${install4jDir}/${install4j_installer_file_associations}")
1348 inputs.file(install4jTemplateFile)
1349 inputs.file(install4jFileAssociationsFile)
1350 outputs.file(install4jConfFile)
1353 def install4jConfigXml = new XmlParser().parse(install4jTemplateFile)
1355 // turn off code signing if no OSX_KEYPASS
1356 if (OSX_KEYPASS == "") {
1357 install4jConfigXml.'**'.codeSigning.each { codeSigning ->
1358 codeSigning.'@macEnabled' = "false"
1360 install4jConfigXml.'**'.windows.each { windows ->
1361 windows.'@runPostProcessor' = "false"
1365 // turn off checksum creation for LOCAL channel
1366 def e = install4jConfigXml.application[0]
1367 if (CHANNEL == "LOCAL") {
1368 e.'@createChecksums' = "false"
1370 e.'@createChecksums' = "true"
1373 // put file association actions where placeholder action is
1374 def install4jFileAssociationsText = install4jFileAssociationsFile.text
1375 def fileAssociationActions = new XmlParser().parseText("<actions>${install4jFileAssociationsText}</actions>")
1376 install4jConfigXml.'**'.action.any { a ->
1377 if (a.'@name' == 'EXTENSIONS_REPLACED_BY_GRADLE') {
1378 def parent = a.parent()
1380 fileAssociationActions.each { faa ->
1383 // don't need to continue in .any loop once replacements have been made
1388 // write install4j file
1389 install4jConfFile.text = XmlUtil.serialize(install4jConfigXml)
1396 delete install4jConfFile
1401 task installers(type: com.install4j.gradle.Install4jTask) {
1402 group = "distribution"
1403 description = "Create the install4j installers"
1404 dependsOn setGitVals
1406 dependsOn copyInstall4jTemplate
1408 projectFile = install4jConfFile
1410 // create an md5 for the input files to use as version for install4j conf file
1411 def digest = MessageDigest.getInstance("MD5")
1413 (file("${install4jDir}/${install4j_template}").text +
1414 file("${install4jDir}/${install4j_info_plist_file_associations}").text +
1415 file("${install4jDir}/${install4j_installer_file_associations}").text).bytes)
1416 def filesMd5 = new BigInteger(1, digest.digest()).toString(16)
1417 if (filesMd5.length() >= 8) {
1418 filesMd5 = filesMd5.substring(0,8)
1420 def install4jTemplateVersion = "${JALVIEW_VERSION}_F${filesMd5}_C${gitHash}"
1421 // make install4jBuildDir relative to jalviewDir
1422 def install4jBuildDir = "${install4j_build_dir}/${JAVA_VERSION}"
1425 'JALVIEW_NAME': jalview_name,
1426 'JALVIEW_APPLICATION_NAME': install4jApplicationName,
1427 'JALVIEW_DIR': "../..",
1428 'OSX_KEYSTORE': OSX_KEYSTORE,
1429 'JSIGN_SH': JSIGN_SH,
1430 'JRE_DIR': getdown_app_dir_java,
1431 'INSTALLER_TEMPLATE_VERSION': install4jTemplateVersion,
1432 'JALVIEW_VERSION': JALVIEW_VERSION,
1433 'JAVA_MIN_VERSION': JAVA_MIN_VERSION,
1434 'JAVA_MAX_VERSION': JAVA_MAX_VERSION,
1435 'JAVA_VERSION': JAVA_VERSION,
1436 'JAVA_INTEGER_VERSION': JAVA_INTEGER_VERSION,
1437 'VERSION': JALVIEW_VERSION,
1438 'MACOS_JAVA_VM_DIR': macosJavaVMDir,
1439 'WINDOWS_JAVA_VM_DIR': windowsJavaVMDir,
1440 'LINUX_JAVA_VM_DIR': linuxJavaVMDir,
1441 'MACOS_JAVA_VM_TGZ': macosJavaVMTgz,
1442 'WINDOWS_JAVA_VM_TGZ': windowsJavaVMTgz,
1443 'LINUX_JAVA_VM_TGZ': linuxJavaVMTgz,
1444 'COPYRIGHT_MESSAGE': install4j_copyright_message,
1445 'BUNDLE_ID': install4jBundleId,
1446 'INTERNAL_ID': install4jInternalId,
1447 'WINDOWS_APPLICATION_ID': install4jWinApplicationId,
1448 'MACOS_DS_STORE': install4jDSStore,
1449 'MACOS_DMG_BG_IMAGE': install4jDMGBackgroundImage,
1450 'INSTALLER_NAME': install4jInstallerName,
1451 'INSTALL4J_UTILS_DIR': install4j_utils_dir,
1452 'GETDOWN_WEBSITE_DIR': getdown_website_dir,
1453 'GETDOWN_FILES_DIR': getdown_files_dir,
1454 'GETDOWN_RESOURCE_DIR': getdown_resource_dir,
1455 'GETDOWN_DIST_DIR': getdownAppDistDir,
1456 'GETDOWN_ALT_DIR': getdown_app_dir_alt,
1457 'GETDOWN_INSTALL_DIR': getdown_install_dir,
1458 'INFO_PLIST_FILE_ASSOCIATIONS_FILE': install4j_info_plist_file_associations,
1459 'BUILD_DIR': install4jBuildDir,
1460 'APPLICATION_CATEGORIES': install4j_application_categories,
1461 'APPLICATION_FOLDER': install4jApplicationFolder,
1462 'UNIX_APPLICATION_FOLDER': install4jUnixApplicationFolder,
1463 'EXECUTABLE_NAME': install4jExecutableName,
1464 'EXTRA_SCHEME': install4jExtraScheme,
1467 //println("INSTALL4J VARIABLES:")
1468 //variables.each{k,v->println("${k}=${v}")}
1470 destination = "${jalviewDir}/${install4jBuildDir}"
1471 buildSelected = true
1473 if (install4j_faster.equals("true") || CHANNEL.startsWith("LOCAL")) {
1475 disableSigning = true
1479 macKeystorePassword = OSX_KEYPASS
1483 println("Using projectFile "+projectFile)
1486 inputs.dir(getdownWebsiteDir)
1487 inputs.file(install4jConfFile)
1488 inputs.file("${install4jDir}/${install4j_info_plist_file_associations}")
1489 inputs.dir(macosJavaVMDir)
1490 inputs.dir(windowsJavaVMDir)
1491 outputs.dir("${jalviewDir}/${install4j_build_dir}/${JAVA_VERSION}")
1495 task sourceDist(type: Tar) {
1497 def VERSION_UNDERSCORES = JALVIEW_VERSION.replaceAll("\\.", "_")
1498 def outputFileName = "${project.name}_${VERSION_UNDERSCORES}.tar.gz"
1499 // cater for buildship < 3.1 [3.0.1 is max version in eclipse 2018-09]
1501 archiveFileName = outputFileName
1502 } catch (Exception e) {
1503 archiveName = outputFileName
1506 compression Compression.GZIP
1521 "**/*.class","$j11modDir/**/*.jar","appletlib","**/*locales",
1523 "utils/InstallAnywhere",
1538 "gradle.properties",
1549 ".settings/org.eclipse.jdt.core.jalview.prefs",
1553 exclude (EXCLUDE_FILES)
1554 include (PROCESS_FILES)
1555 filter(ReplaceTokens,
1559 'Version-Rel': JALVIEW_VERSION,
1560 'Year-Rel': getDate("yyyy")
1565 exclude (EXCLUDE_FILES)
1566 exclude (PROCESS_FILES)
1567 exclude ("appletlib")
1568 exclude ("**/*locales")
1569 exclude ("*locales/**")
1570 exclude ("utils/InstallAnywhere")
1572 exclude (getdown_files_dir)
1573 exclude (getdown_website_dir)
1575 // exluding these as not using jars as modules yet
1576 exclude ("$j11modDir/**/*.jar")
1579 include(INCLUDE_FILES)
1581 // from (jalviewDir) {
1582 // // explicit includes for stuff that seemed to not get included
1583 // include(fileTree("test/**/*."))
1584 // exclude(EXCLUDE_FILES)
1585 // exclude(PROCESS_FILES)
1592 dependsOn pubhtmlhelp
1594 inputs.dir("${classesDir}/${help_dir}")
1595 outputs.dir("${buildDir}/distributions/${help_dir}")
1598 // LARGE AMOUNT OF JALVIEWJS STUFF DELETED HERE
1599 task eclipseAutoBuildTask {}
1600 task eclipseSynchronizationTask {}