-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
-// this property is assigned below and expanded to multiple lines in the getdown task
-def getdown_alt_multi_java_location
-if (JAVA_VERSION.equals("1.8")) {
- JAVA_INTEGER_VERSION = "8"
- 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_multi_java_location = getdown_alt_java8_txt_multi_java_location
-} 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_multi_java_location = getdown_alt_java11_txt_multi_java_location
- additional_compiler_args += [
- '--module-path', ext.modules_compileClasspath.asPath,
+ classes = classesDir
+
+ getdownWebsiteDir = string("${jalviewDir}/${getdown_website_dir}/${JAVA_VERSION}")
+ buildDist = true
+
+ // the following values might be overridden by the CHANNEL switch
+ getdownChannelName = CHANNEL.toLowerCase()
+ getdownDir = string("${getdownChannelName}/${JAVA_VERSION}")
+ getdownAppBase = string("${getdown_channel_base}/${getdownDir}")
+ getdownLauncher = string("${jalviewDir}/${getdown_lib_dir}/${getdown_launcher}")
+ getdownAppDistDir = getdown_app_dir_alt
+ buildProperties = string("${classesDir}/${build_properties_file}")
+ reportRsyncCmd = false
+ jvlChannelName = CHANNEL.toLowerCase()
+ switch (CHANNEL) {
+
+ case "BUILD":
+ // TODO: get bamboo build artifact URL for getdown artifacts
+ getdown_channel_base = bamboo_channelbase
+ getdownChannelName = string("${bamboo_planKey}/${JAVA_VERSION}")
+ getdownAppBase = string("${bamboo_channelbase}/${bamboo_planKey}${bamboo_getdown_channel_suffix}/${JAVA_VERSION}")
+ jvlChannelName += "_${getdownChannelName}"
+ break
+
+ case "RELEASE":
+ getdownAppDistDir = getdown_app_dir_release
+ reportRsyncCommand = true
+ break
+
+ case "ARCHIVE":
+ getdownChannelName = CHANNEL.toLowerCase()+"/${JALVIEW_VERSION}"
+ getdownDir = string("${getdownChannelName}/${JAVA_VERSION}")
+ getdownAppBase = string("${getdown_channel_base}/${getdownDir}")
+ if (!file("${ARCHIVEDIR}/${packageDir}").exists()) {
+ throw new GradleException("Must provide an ARCHIVEDIR value to produce an archive distribution")
+ } else {
+ packageDir = string("${ARCHIVEDIR}/${packageDir}")
+ buildProperties = string("${ARCHIVEDIR}/${classes_dir}/${build_properties_file}")
+ buildDist = false
+ }
+ reportRsyncCommand = true
+ break
+
+ case "ARCHIVELOCAL":
+ getdownChannelName = string("archive/${JALVIEW_VERSION}")
+ getdownDir = string("${getdownChannelName}/${JAVA_VERSION}")
+ getdownAppBase = file(getdownWebsiteDir).toURI().toString()
+ if (!file("${ARCHIVEDIR}/${packageDir}").exists()) {
+ throw new GradleException("Must provide an ARCHIVEDIR value to produce an archive distribution")
+ } else {
+ packageDir = string("${ARCHIVEDIR}/${packageDir}")
+ buildProperties = string("${ARCHIVEDIR}/${classes_dir}/${build_properties_file}")
+ buildDist = false
+ }
+ reportRsyncCommand = true
+ getdownLauncher = string("${jalviewDir}/${getdown_lib_dir}/${getdown_launcher_local}")
+ break
+
+ case "DEVELOP":
+ reportRsyncCommand = true
+ break
+
+ case "TEST-RELEASE":
+ reportRsyncCommand = true
+ break
+
+ case ~/^SCRATCH(|-[-\w]*)$/:
+ getdownChannelName = CHANNEL
+ getdownDir = string("${getdownChannelName}/${JAVA_VERSION}")
+ getdownAppBase = string("${getdown_channel_base}/${getdownDir}")
+ reportRsyncCommand = true
+ break
+
+ case "TEST-LOCAL":
+ if (!file("${LOCALDIR}").exists()) {
+ throw new GradleException("Must provide a LOCALDIR value to produce a local distribution")
+ } else {
+ getdownAppBase = file(file("${LOCALDIR}").getAbsolutePath()).toURI().toString()
+ getdownLauncher = string("${jalviewDir}/${getdown_lib_dir}/${getdown_launcher_local}")
+ }
+ break
+
+ case "LOCAL":
+ getdownAppBase = file(getdownWebsiteDir).toURI().toString()
+ getdownLauncher = string("${jalviewDir}/${getdown_lib_dir}/${getdown_launcher_local}")
+ break
+
+ default: // something wrong specified
+ throw new GradleException("CHANNEL must be one of BUILD, RELEASE, ARCHIVE, DEVELOP, TEST-RELEASE, SCRATCH-..., LOCAL [default]")
+ break
+
+ }
+ // override getdownAppBase if requested
+ if (findProperty("getdown_appbase_override") != null) {
+ getdownAppBase = string(getProperty("getdown_appbase_override"))
+ println("Overriding getdown appbase with '${getdownAppBase}'")
+ }
+ // sanitise file name for jalview launcher file for this channel
+ jvlChannelName = jvlChannelName.replaceAll(/[^\w\-]/,"_")
+
+ getdownAppDir = string("${getdownWebsiteDir}/${getdownAppDistDir}")
+ //getdownJ11libDir = "${getdownWebsiteDir}/${getdown_j11lib_dir}"
+ getdownResourceDir = string("${getdownWebsiteDir}/${getdown_resource_dir}")
+ getdownInstallDir = string("${getdownWebsiteDir}/${getdown_install_dir}")
+ getdownFilesDir = string("${jalviewDir}/${getdown_files_dir}/${JAVA_VERSION}/")
+ getdownFilesInstallDir = string("${getdownFilesDir}/${getdown_install_dir}")
+ /* compile without modules -- using classpath libraries
+ modules_compileClasspath = fileTree(dir: "${jalviewDir}/${j11modDir}", include: ["*.jar"])
+ modules_runtimeClasspath = modules_compileClasspath
+ */
+ gitHash = string("")
+ gitBranch = string("")
+
+ println("Using a ${CHANNEL} profile.")
+
+ additional_compiler_args = []
+ // configure classpath/args for j8/j11 compilation
+ if (JAVA_VERSION.equals("1.8")) {
+ JAVA_INTEGER_VERSION = string("8")
+ //libDir = j8libDir
+ libDir = j11libDir
+ libDistDir = j8libDir
+ compile_source_compatibility = 1.8
+ compile_target_compatibility = 1.8
+ // these are getdown.txt properties defined dependent on the JAVA_VERSION
+ getdownAltJavaMinVersion = string(findProperty("getdown_alt_java8_min_version"))
+ getdownAltJavaMaxVersion = string(findProperty("getdown_alt_java8_max_version"))
+ // this property is assigned below and expanded to multiple lines in the getdown task
+ getdownAltMultiJavaLocation = string(findProperty("getdown_alt_java8_txt_multi_java_location"))
+ // this property is for the Java library used in eclipse
+ eclipseJavaRuntimeName = string("JavaSE-1.8")
+ } else if (JAVA_VERSION.equals("11")) {
+ JAVA_INTEGER_VERSION = string("11")
+ libDir = j11libDir
+ libDistDir = j11libDir
+ compile_source_compatibility = 11
+ compile_target_compatibility = 11
+ getdownAltJavaMinVersion = string(findProperty("getdown_alt_java11_min_version"))
+ getdownAltJavaMaxVersion = string(findProperty("getdown_alt_java11_max_version"))
+ getdownAltMultiJavaLocation = string(findProperty("getdown_alt_java11_txt_multi_java_location"))
+ eclipseJavaRuntimeName = string("JavaSE-11")
+ /* compile without modules -- using classpath libraries
+ additional_compiler_args += [
+ '--module-path', modules_compileClasspath.asPath,