From: Ben Soares Date: Fri, 17 Jan 2020 17:19:54 +0000 (+0000) Subject: JAL-3252 Don't add java_location until we've got a working mechanism X-Git-Tag: Develop-2_11_2_0-d20201215~80^2~26 X-Git-Url: http://source.jalview.org/gitweb/?p=jalview.git;a=commitdiff_plain;h=81c6bf0e55097404d820686252f13e51863718f7 JAL-3252 Don't add java_location until we've got a working mechanism --- diff --git a/build.gradle b/build.gradle index a8315c2..916d1d0 100644 --- a/build.gradle +++ b/build.gradle @@ -38,7 +38,7 @@ dependencies { // in ext the values are cast to Object. Ensure string values are cast as String (and not GStringImpl) for later use def string(Object o) { - return o.toString() + return o == null ? "" : o.toString() } @@ -246,22 +246,22 @@ ext { compile_source_compatibility = 1.8 compile_target_compatibility = 1.8 // these are getdown.txt properties defined dependent on the JAVA_VERSION - getdown_alt_java_min_version = getdown_alt_java8_min_version - getdown_alt_java_max_version = getdown_alt_java8_max_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 - getdown_alt_multi_java_location = getdown_alt_java8_txt_multi_java_location + getdownAltMultiJavaLocation = string(findProperty("getdown_alt_java8_txt_multi_java_location")) // this property is for the Java library used in eclipse - eclipse_java_runtime_name = string("JavaSE-1.8") + 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 - 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 = string("JavaSE-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, @@ -274,10 +274,10 @@ ext { 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 = string("JavaSE-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, @@ -524,7 +524,7 @@ eclipse { // for the IDE, use java 11 compatibility sourceCompatibility = compile_source_compatibility targetCompatibility = compile_target_compatibility - javaRuntimeName = eclipse_java_runtime_name + javaRuntimeName = eclipseJavaRuntimeName // add in jalview project specific properties/preferences into eclipse core preferences file { @@ -1005,13 +1005,15 @@ task getdownWebsite() { // go through properties looking for getdown_txt_... def props = project.properties.sort { it.key } - if (getdown_alt_java_min_version.length() > 0) { - props.put("getdown_txt_java_min_version", getdown_alt_java_min_version) + if (getdownAltJavaMinVersion != null && getdownAltJavaMinVersion.length() > 0) { + props.put("getdown_txt_java_min_version", getdownAltJavaMinVersion) } - if (getdown_alt_java_max_version.length() > 0) { - props.put("getdown_txt_java_max_version", getdown_alt_java_max_version) + if (getdownAltJavaMaxVersion != null && getdownAltJavaMaxVersion.length() > 0) { + props.put("getdown_txt_java_max_version", getdownAltJavaMaxVersion) + } + if (getdownAltMultiJavaLocation != null && getdownAltMultiJavaLocation.length() > 0) { + props.put("getdown_txt_multi_java_location", getdownAltMultiJavaLocation) } - props.put("getdown_txt_multi_java_location", getdown_alt_multi_java_location) props.put("getdown_txt_appbase", getdown_app_base) props.each{ prop, val -> diff --git a/gradle.properties b/gradle.properties index 7337984..2bac743 100644 --- a/gradle.properties +++ b/gradle.properties @@ -98,8 +98,8 @@ getdown_alt_java8_min_version = 01080000 getdown_alt_java8_max_version = 01089999 getdown_alt_java11_min_version = 11000000 getdown_alt_java11_max_version = -getdown_alt_java11_txt_multi_java_location = [windows-amd64] /getdown/jre/windows-jre11.jar,[linux-amd64] /getdown/jre/linux-jre11.tgz,[mac os x] /getdown/jre/macos-jre11.tgz -getdown_alt_java8_txt_multi_java_location = [windows-amd64] /getdown/jre/windows-jre1.8.tgz,[linux-amd64] /getdown/jre/linux-jre1.8.tgz,[mac os x] /getdown/jre/macos-jre1.8.tgz +#getdown_alt_java11_txt_multi_java_location = [windows-amd64] /getdown/jre/windows-jre11.jar,[linux-amd64] /getdown/jre/linux-jre11.tgz,[mac os x] /getdown/jre/macos-jre11.tgz +#getdown_alt_java8_txt_multi_java_location = [windows-amd64] /getdown/jre/windows-jre1.8.tgz,[linux-amd64] /getdown/jre/linux-jre1.8.tgz,[mac os x] /getdown/jre/macos-jre1.8.tgz JRE_installs = /Users/bsoares/Java/installs Windows_JRE8 = OpenJDK8U-jdk_x64_windows_hotspot_8u202b08/jdk8u202-b08 Mac_JRE8 = OpenJDK8U-jre_x64_mac_hotspot_8u202b08/jdk8u202-b08-jre/Contents/Home