- getdownWebsiteDir = jalviewDir + '/' + getdown_website_dir + '/' + JAVA_VERSION
- getdownDir = ""
- reportRsyncCmd = false
- buildDist = true
- switch (CHANNEL) {
-
- case "BUILD":
- // TODO: get bamboo build artifact URL for getdown artifacts
- getdown_app_dir = getdown_app_dir_alt
- 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
- 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(ARCHIVEDIST).exists()) {
- print "Must provide an ARCHIVEDIST value to produce an archive distribution"
- exit(2)
- } else {
- packageDir = ARCHIVEDIST
- buildDist = false
- }
- reportRsyncCommand = true
- break
-
- case "ARCHIVELOCAL":
- getdown_channel_name = CHANNEL.toLowerCase()+"/"+JALVIEW_VERSION
- getdownDir = getdown_channel_name + "/" + JAVA_VERSION
- //getdown_app_base = getdown_channel_base + "/" + getdownDir
- getdown_app_base = file(getdownWebsiteDir).toURI().toString()
- getdown_app_dir = getdown_app_dir_alt
- if (!file(ARCHIVEDIST).exists()) {
- print "Must provide an ARCHIVEDIST value to produce an archive distribution"
- exit(2)
- } else {
- packageDir = ARCHIVEDIST
- buildDist = false
- }
- reportRsyncCommand = true
- 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
- 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
- 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
- reportRsyncCommand = true
- break
-
- case "LOCAL":
- getdown_app_base = file(getdownWebsiteDir).toURI().toString()
- getdown_app_dir = getdown_app_dir_alt
- break
-
- default: // something wrong specified
- print("CHANNEL must be one of BUILD, RELEASE, ARCHIVE, DEVELOP, TEST-RELEASE, SCRATCH-..., LOCAL [default]")
- exit(1)
- 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
- getdownLauncher = jalviewDir + '/' + getdown_launcher
- getdownFilesDir = jalviewDir + '/' + getdown_files_dir + '/' + JAVA_VERSION + '/'
- getdownFilesInstallDir = getdownFilesDir+"/"+getdown_install_dir
- modules_compileClasspath = fileTree(dir: "$jalviewDir/$j11modDir", include: ["*.jar"])
- modules_runtimeClasspath = modules_compileClasspath
- gitHash = ""
- gitBranch = ""
+ jalviewDirAbsolutePath = file(jalviewDir).getAbsolutePath()
+ jalviewDirRelativePath = jalviewDir
+
+ // local build environment properties
+ def localProps = "${jalviewDirAbsolutePath}/local.properties"
+ if (file(localProps).exists()) {
+ try {
+ def p = new Properties()
+ def localPropsFIS = new FileInputStream(localProps)
+ p.load(localPropsFIS)
+ localPropsFIS.close()
+ p.each {
+ key, val ->
+ def oldval = findProperty(key)
+ setProperty(key, val)
+ if (oldval != null) {
+ println("Overriding property '${key}' ('${oldval}') with local.properties value '${val}'")
+ } else {
+ println("Setting unknown property '${key}' with local.properties value '${val}'")
+ }
+ }
+ } catch (Exception e) {
+ System.out.println("Exception reading local.properties")
+ }
+ }
+
+ // this property set when running Eclipse headlessly
+ j2sHeadlessBuildProperty = string("net.sf.j2s.core.headlessbuild")
+ // this property set by Eclipse
+ eclipseApplicationProperty = string("eclipse.application")
+ // CHECK IF RUNNING FROM WITHIN ECLIPSE
+ def eclipseApplicationPropertyVal = System.properties[eclipseApplicationProperty]
+ IN_ECLIPSE = eclipseApplicationPropertyVal != null && eclipseApplicationPropertyVal.startsWith("org.eclipse.ui.")
+ // BUT WITHOUT THE HEADLESS BUILD PROPERTY SET
+ if (System.properties[j2sHeadlessBuildProperty].equals("true")) {
+ println("Setting IN_ECLIPSE to ${IN_ECLIPSE} as System.properties['${j2sHeadlessBuildProperty}'] == '${System.properties[j2sHeadlessBuildProperty]}'")
+ IN_ECLIPSE = false
+ }
+ if (IN_ECLIPSE) {
+ println("WITHIN ECLIPSE IDE")
+ } else {
+ println("HEADLESS BUILD")
+ }
+ /* *-/
+ System.properties.sort { it.key }.each {
+ key, val -> println("SYSTEM PROPERTY ${key}='${val}'")
+ }
+ /-* *-/
+ if (false && IN_ECLIPSE) {
+ jalviewDir = jalviewDirAbsolutePath
+ }
+ */
+
+ // essentials
+ bareSourceDir = string(source_dir)
+ sourceDir = string("${jalviewDir}/${bareSourceDir}")
+ resourceDir = string("${jalviewDir}/${resource_dir}")
+ bareTestSourceDir = string(test_source_dir)
+ testSourceDir = string("${jalviewDir}/${bareTestSourceDir}")
+
+ // clover
+ cloverInstrDir = file("${buildDir}/${cloverSourcesInstrDir}")
+ classesDir = string("${jalviewDir}/${classes_dir}")
+ if (clover.equals("true")) {
+ use_clover = true
+ classesDir = string("${buildDir}/${cloverClassesDir}")
+ } else {
+ use_clover = false
+ classesDir = string("${jalviewDir}/${classes_dir}")
+ }
+
+ classes = classesDir
+
+ getdownWebsiteDir = string("${jalviewDir}/${getdown_website_dir}/${JAVA_VERSION}")
+ getdownDir = string("")
+ reportRsyncCmd = false
+ buildDist = true
+ buildProperties = build_properties_file
+ getdownLauncher = string("${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 = string("${bamboo_planKey}/${JAVA_VERSION}")
+ getdown_app_base = string("${bamboo_channelbase}/${bamboo_planKey}${bamboo_getdown_channel_suffix}/${JAVA_VERSION}")
+ getdown_app_dir = getdown_app_dir_alt
+ buildProperties = string("${classesDir}/${build_properties_file}")
+ break
+
+ case "RELEASE":
+ getdown_channel_name = CHANNEL.toLowerCase()
+ getdownDir = string("${getdown_channel_name}/${JAVA_VERSION}")
+ getdown_app_base = string("${getdown_channel_base}/${getdownDir}")
+ getdown_app_dir = getdown_app_dir_release
+ buildProperties = string("${classesDir}/${build_properties_file}")
+ reportRsyncCommand = true
+ break
+
+ case "ARCHIVE":
+ getdown_channel_name = CHANNEL.toLowerCase()+"/${JALVIEW_VERSION}"
+ getdownDir = string("${getdown_channel_name}/${JAVA_VERSION}")
+ getdown_app_base = string("${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 = string("${ARCHIVEDIR}/${packageDir}")
+ buildProperties = string("${ARCHIVEDIR}/${classes_dir}/${build_properties_file}")
+ buildDist = false
+ }
+ reportRsyncCommand = true
+ break
+
+ case "ARCHIVELOCAL":
+ getdown_channel_name = string("archive/${JALVIEW_VERSION}")
+ getdownDir = string("${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 = 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":
+ getdown_channel_name = CHANNEL.toLowerCase()
+ getdownDir = string("${getdown_channel_name}/${JAVA_VERSION}")
+ getdown_app_base = string("${getdown_channel_base}/${getdownDir}")
+ getdown_app_dir = getdown_app_dir_alt
+ buildProperties = string("${classesDir}/${build_properties_file}")
+ reportRsyncCommand = true
+ break
+
+ case "TEST-RELEASE":
+ getdown_channel_name = CHANNEL.toLowerCase()
+ getdownDir = string("${getdown_channel_name}/${JAVA_VERSION}")
+ getdown_app_base = string("${getdown_channel_base}/${getdownDir}")
+ getdown_app_dir = getdown_app_dir_alt
+ buildProperties = string("${classesDir}/${build_properties_file}")
+ reportRsyncCommand = true
+ break
+
+ case ~/^SCRATCH(|-[-\w]*)$/:
+ getdown_channel_name = CHANNEL
+ getdownDir = string("${getdown_channel_name}/${JAVA_VERSION}")
+ getdown_app_base = string("${getdown_channel_base}/${getdownDir}")
+ getdown_app_dir = getdown_app_dir_alt
+ buildProperties = string("${classesDir}/${build_properties_file}")
+ reportRsyncCommand = true
+ break
+
+ case "LOCAL":
+ getdown_app_base = file(getdownWebsiteDir).toURI().toString()
+ getdown_app_dir = getdown_app_dir_alt
+ buildProperties = string("${classesDir}/${build_properties_file}")
+ getdownLauncher = string("${jalviewDir}/${getdown_lib_dir}/${getdown_launcher_local}")
+ break
+
+ default: // something wrong specified
+ println("CHANNEL must be one of BUILD, RELEASE, ARCHIVE, DEVELOP, TEST-RELEASE, SCRATCH-..., LOCAL [default]")
+ exit
+ break
+
+ }
+ // override getdown_app_base if requested
+ if (findProperty("getdown_appbase_override") != null) {
+ getdown_app_base = string(getProperty("getdown_appbase_override"))
+ println("Overriding getdown appbase with '${getdown_app_base}'")
+ }
+
+ getdownAppDir = string("${getdownWebsiteDir}/${getdown_app_dir}")
+ //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,
+ '--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
+ 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,
+ '--add-modules', j11modules
+ ]
+ */
+ } else {
+ throw new GradleException("JAVA_VERSION=${JAVA_VERSION} not currently supported by Jalview")
+ }
+
+
+ // for install4j
+ JAVA_MIN_VERSION = JAVA_VERSION
+ JAVA_MAX_VERSION = JAVA_VERSION
+ def jreInstallsDir = string(jre_installs_dir)
+ if (jreInstallsDir.startsWith("~/")) {
+ jreInstallsDir = System.getProperty("user.home") + jreInstallsDir.substring(1)
+ }
+ macosJavaVMDir = string("${jreInstallsDir}/jre-${JAVA_INTEGER_VERSION}-mac-x64/jre")
+ macosJavaVMTgz = string("${jreInstallsDir}/tgz/jre-${JAVA_INTEGER_VERSION}-mac-x64.tar.gz")
+ windowsJavaVMDir = string("${jreInstallsDir}/jre-${JAVA_INTEGER_VERSION}-windows-x64/jre")
+ windowsJavaVMTgz = string("${jreInstallsDir}/tgz/jre-${JAVA_INTEGER_VERSION}-windows-x64.tar.gz")
+ linuxJavaVMDir = string("${jreInstallsDir}/jre-${JAVA_INTEGER_VERSION}-linux-x64/jre")
+ linuxJavaVMTgz = string("${jreInstallsDir}/tgz/jre-${JAVA_INTEGER_VERSION}-linux-x64.tar.gz")
+ install4jDir = string("${jalviewDir}/${install4j_utils_dir}")
+ install4jConfFileName = string("jalview-install4j-conf.install4j")
+ install4jConfFile = file("${install4jDir}/${install4jConfFileName}")
+ install4jHomeDir = install4j_home_dir
+ if (install4jHomeDir.startsWith("~/")) {
+ install4jHomeDir = System.getProperty("user.home") + install4jHomeDir.substring(1)
+ }
+
+
+
+ buildingHTML = string("${jalviewDir}/${docDir}/building.html")
+ helpFile = string("${classesDir}/${help_dir}/help.jhm")
+ helpParentDir = string("${jalviewDir}/${help_parent_dir}")
+ helpSourceDir = string("${helpParentDir}/${help_dir}")
+
+
+ relativeBuildDir = file(jalviewDirAbsolutePath).toPath().relativize(buildDir.toPath())
+ jalviewjsBuildDir = string("${relativeBuildDir}/jalviewjs")
+ jalviewjsSiteDir = string("${jalviewjsBuildDir}/${jalviewjs_site_dir}")
+ if (IN_ECLIPSE) {
+ jalviewjsTransferSiteJsDir = string(jalviewjsSiteDir)
+ } else {
+ jalviewjsTransferSiteJsDir = string("${jalviewjsBuildDir}/tmp/${jalviewjs_site_dir}_js")
+ }
+ jalviewjsTransferSiteLibDir = string("${jalviewjsBuildDir}/tmp/${jalviewjs_site_dir}_lib")
+ jalviewjsTransferSiteSwingJsDir = string("${jalviewjsBuildDir}/tmp/${jalviewjs_site_dir}_swingjs")
+ jalviewjsTransferSiteCoreDir = string("${jalviewjsBuildDir}/tmp/${jalviewjs_site_dir}_core")
+ jalviewjsJalviewCoreHtmlFile = string("")
+ jalviewjsJalviewCoreName = string(jalviewjs_core_name)
+ jalviewjsCoreClasslists = []
+ jalviewjsJalviewTemplateName = string(jalviewjs_name)
+ jalviewjsJ2sSettingsFileName = string("${jalviewDir}/${jalviewjs_j2s_settings}")
+ jalviewjsJ2sProps = null
+
+ eclipseWorkspace = null
+ eclipseBinary = string("")
+ eclipseVersion = string("")
+ eclipseDebug = false
+ // ENDEXT