+def cloverInstrDir = file("$buildDir/$cloverSourcesInstrDir")
+def classes = "$jalviewDir/$classesDir"
+
+if (clover.equals("true")) {
+ use_clover = true
+ classes = "$buildDir/$cloverClassesDir"
+} else {
+ use_clover = false
+ classes = "$jalviewDir/$classesDir"
+}
+
+// configure classpath/args for j8/j11 compilation
+
+def jalviewDirAbsolutePath = file(jalviewDir).getAbsolutePath()
+def libDir
+def libDistDir
+def compile_source_compatibility
+def compile_target_compatibility
+
+ext {
+ getdownWebsiteDir = jalviewDir + '/' + getdown_website_dir + '/' + JAVA_VERSION
+ getdownDir = ""
+ reportRsyncCmd = false
+ buildDist = true
+ buildProperties = buildPropertiesFile
+ getdownLauncher = jalviewDir + '/' + getdown_lib_dir + '/' + getdown_launcher
+ switch (CHANNEL) {
+
+ case "BUILD":
+ // TODO: get bamboo build artifact URL for getdown artifacts
+ getdown_channel_base = bamboo_channelbase
+ getdown_channel_name = bamboo_planKey + '/'+JAVA_VERSION
+ getdown_app_base = bamboo_channelbase + '/'+ bamboo_planKey + bamboo_getdown_channel_suffix + '/'+JAVA_VERSION
+ getdown_app_dir = getdown_app_dir_alt
+ buildProperties = jalviewDir + "/" + classesDir +"/" + buildPropertiesFile
+ break
+
+ case "RELEASE":
+ getdown_channel_name = CHANNEL.toLowerCase()
+ getdownDir = getdown_channel_name + "/" + JAVA_VERSION
+ getdown_app_base = getdown_channel_base + "/" + getdownDir
+ getdown_app_dir = getdown_app_dir_release
+ buildProperties = jalviewDir + "/" + classesDir +"/" + buildPropertiesFile
+ reportRsyncCommand = true
+ break
+
+ case "ARCHIVE":
+ getdown_channel_name = CHANNEL.toLowerCase()+"/"+JALVIEW_VERSION
+ getdownDir = getdown_channel_name + "/" + JAVA_VERSION
+ getdown_app_base = getdown_channel_base + "/" + getdownDir
+ getdown_app_dir = getdown_app_dir_alt
+ if (!file(ARCHIVEDIR+"/"+packageDir).exists()) {
+ print "Must provide an ARCHIVEDIR value to produce an archive distribution"
+ exit
+ } else {
+ packageDir = ARCHIVEDIR + "/" + packageDir
+ buildProperties = ARCHIVEDIR +"/" + classesDir + "/" + buildPropertiesFile
+ buildDist = false
+ }
+ reportRsyncCommand = true
+ break
+
+ case "ARCHIVELOCAL":
+ getdown_channel_name = "archive" + "/" + JALVIEW_VERSION
+ getdownDir = getdown_channel_name + "/" + JAVA_VERSION
+ getdown_app_base = file(getdownWebsiteDir).toURI().toString()
+ getdown_app_dir = getdown_app_dir_alt
+ if (!file(ARCHIVEDIR+"/"+packageDir).exists()) {
+ print "Must provide an ARCHIVEDIR value to produce an archive distribution"
+ exit
+ } else {
+ packageDir = ARCHIVEDIR + "/" + packageDir
+ buildProperties = ARCHIVEDIR +"/" + classesDir + "/" + buildPropertiesFile
+ buildDist = false
+ }
+ reportRsyncCommand = true
+ getdownLauncher = jalviewDir + '/' + getdown_lib_dir + '/' + getdown_launcher_local
+ break
+
+ case "DEVELOP":
+ getdown_channel_name = CHANNEL.toLowerCase()
+ getdownDir = getdown_channel_name + "/" + JAVA_VERSION
+ getdown_app_base = getdown_channel_base + "/" + getdownDir
+ getdown_app_dir = getdown_app_dir_alt
+ buildProperties = jalviewDir + "/" + classesDir +"/" + buildPropertiesFile
+ reportRsyncCommand = true
+ break
+
+ case "TEST-RELEASE":
+ getdown_channel_name = CHANNEL.toLowerCase()
+ getdownDir = getdown_channel_name + "/" + JAVA_VERSION
+ getdown_app_base = getdown_channel_base + "/" + getdownDir
+ getdown_app_dir = getdown_app_dir_alt
+ buildProperties = jalviewDir + "/" + classesDir +"/" + buildPropertiesFile
+ reportRsyncCommand = true
+ break
+
+ case ~/^SCRATCH(|-[-\w]*)$/:
+ getdown_channel_name = CHANNEL
+ getdownDir = getdown_channel_name + "/" + JAVA_VERSION
+ getdown_app_base = getdown_channel_base + "/" + getdownDir
+ getdown_app_dir = getdown_app_dir_alt
+ buildProperties = jalviewDir + "/" + classesDir +"/" + buildPropertiesFile
+ reportRsyncCommand = true
+ break
+
+ case "LOCAL":
+ getdown_app_base = file(getdownWebsiteDir).toURI().toString()
+ getdown_app_dir = getdown_app_dir_alt
+ buildProperties = jalviewDir + "/" + classesDir +"/" + buildPropertiesFile
+ getdownLauncher = jalviewDir + '/' + getdown_lib_dir + '/' + getdown_launcher_local
+ break
+
+ default: // something wrong specified
+ print("CHANNEL must be one of BUILD, RELEASE, ARCHIVE, DEVELOP, TEST-RELEASE, SCRATCH-..., LOCAL [default]")
+ exit
+ break
+
+ }
+
+ println("Using a "+CHANNEL+" profile. appbase="+getdown_app_base)
+ getdownAppDir = getdownWebsiteDir + '/' + getdown_app_dir
+ //getdownJ11libDir = getdownWebsiteDir + '/' + getdown_j11lib_dir
+ getdownResourceDir = getdownWebsiteDir + '/' + getdown_resource_dir
+ getdownInstallDir = getdownWebsiteDir + '/' + getdown_install_dir
+ getdownFilesDir = jalviewDir + '/' + getdown_files_dir + '/' + JAVA_VERSION + '/'
+ getdownFilesInstallDir = getdownFilesDir+"/"+getdown_install_dir
+ /* compile without modules -- using classpath libraries
+ modules_compileClasspath = fileTree(dir: "$jalviewDir/$j11modDir", include: ["*.jar"])
+ modules_runtimeClasspath = modules_compileClasspath
+ */
+ gitHash = ""
+ gitBranch = ""
+}
+
+def JAVA_INTEGER_VERSION
+def additional_compiler_args = []
+// these are getdown.txt properties defined dependent on the JAVA_VERSION
+def getdown_alt_java_min_version
+def getdown_alt_java_max_version
+// this property is assigned below and expanded to multiple lines in the getdown task
+def getdown_alt_multi_java_location
+// this property is for the Java library used in eclipse
+def eclipse_java_runtime_name
+if (JAVA_VERSION.equals("1.8")) {
+ JAVA_INTEGER_VERSION = "8"
+ //libDir = j8libDir
+ libDir = j11libDir
+ libDistDir = j8libDir
+ compile_source_compatibility = 1.8
+ compile_target_compatibility = 1.8
+ getdown_alt_java_min_version = getdown_alt_java8_min_version
+ getdown_alt_java_max_version = getdown_alt_java8_max_version
+ getdown_alt_multi_java_location = getdown_alt_java8_txt_multi_java_location
+ eclipse_java_runtime_name = "JavaSE-1.8"
+} else if (JAVA_VERSION.equals("11")) {
+ JAVA_INTEGER_VERSION = "11"
+ libDir = j11libDir
+ libDistDir = j11libDir
+ compile_source_compatibility = 11
+ compile_target_compatibility = 11
+ getdown_alt_java_min_version = getdown_alt_java11_min_version
+ getdown_alt_java_max_version = getdown_alt_java11_max_version
+ getdown_alt_multi_java_location = getdown_alt_java11_txt_multi_java_location
+ eclipse_java_runtime_name = "JavaSE-11"
+ /* compile without modules -- using classpath libraries
+ additional_compiler_args += [
+ '--module-path', ext.modules_compileClasspath.asPath,
+ '--add-modules', j11modules
+ ]
+ */
+} else if (JAVA_VERSION.equals("12") || JAVA_VERSION.equals("13")) {
+ JAVA_INTEGER_VERSION = JAVA_VERSION
+ libDir = j11libDir
+ libDistDir = j11libDir
+ compile_source_compatibility = JAVA_VERSION
+ compile_target_compatibility = JAVA_VERSION
+ getdown_alt_java_min_version = getdown_alt_java11_min_version
+ getdown_alt_java_max_version = getdown_alt_java11_max_version
+ getdown_alt_multi_java_location = getdown_alt_java11_txt_multi_java_location
+ eclipse_java_runtime_name = "JavaSE-11"
+ /* compile without modules -- using classpath libraries
+ additional_compiler_args += [
+ '--module-path', ext.modules_compileClasspath.asPath,
+ '--add-modules', j11modules
+ ]
+ */
+} else {
+ throw new GradleException("JAVA_VERSION=$JAVA_VERSION not currently supported by Jalview")
+}