From: Jim Procter Date: Mon, 25 May 2020 13:33:39 +0000 (+0100) Subject: JAL-3626 rescue automatic configuration of JALVIEW_VERSION from the RELEASE propertie... X-Git-Tag: Develop-2_11_2_0-d20201215~24^2~63 X-Git-Url: http://source.jalview.org/gitweb/?p=jalview.git;a=commitdiff_plain;h=6650b1dc05cddec8301d52017db0dca93b7a6c95 JAL-3626 rescue automatic configuration of JALVIEW_VERSION from the RELEASE properties file, and exclusion of ‘examples’ from the windows installer.
 --- diff --git a/build.gradle b/build.gradle index 985cc87..4e50b77 100644 --- a/build.gradle +++ b/build.gradle @@ -82,6 +82,26 @@ ext { } } + //// + // Import releaseProps from the RELEASE file + // or a file specified via JALVIEW_RELEASE_FILE if defined + // Expect jalview.version and target release branch in jalview.release + def releaseProps = new Properties(); + def releasePropFile = findProperty("JALVIEW_RELEASE_FILE"); + def defaultReleasePropFile = "${jalviewDirAbsolutePath}/RELEASE"; + try { + (new File(releasePropFile!=null ? releasePropFile : defaultReleasePropFile)).withInputStream { + releaseProps.load(it) + } + } catch (Exception fileLoadError) { + throw new Error("Couldn't load release properties file "+(releasePropFile==null ? defaultReleasePropFile : "from custom location: releasePropFile"),fileLoadError); + } + //// + // Set JALVIEW_VERSION if it is not already set + if (findProperty(JALVIEW_VERSION)==null || "".equals(JALVIEW_VERSION)) { + JALVIEW_VERSION = releaseProps.get("jalview.version") + } + // this property set when running Eclipse headlessly j2sHeadlessBuildProperty = string("net.sf.j2s.core.headlessbuild") // this property set by Eclipse @@ -103,8 +123,7 @@ ext { J2S_ENABLED = (project.hasProperty('j2s.compiler.status') && project['j2s.compiler.status'] != null && project['j2s.compiler.status'] == "enable") if (J2S_ENABLED) { println("J2S ENABLED") - } - + } /* *-/ System.properties.sort { it.key }.each { key, val -> println("SYSTEM PROPERTY ${key}='${val}'") @@ -217,6 +236,11 @@ ext { case "DEVELOP": reportRsyncCommand = true + + // DEVELOP-RELEASE is usually associated with a Jalview release series so set the version + JALVIEW_VERSION=JALVIEW_VERSION+"-develop" + + install4jSuffix = "Develop" install4jDSStore = "DS_Store-DEVELOP" install4jDMGBackgroundImage = "jalview_dmg_background-DEVELOP.png" install4jExtraScheme = "jalviewd" @@ -230,7 +254,7 @@ ext { jalviewjs_ignore_transpile_errors = "false" println("Setting jalviewjs_ignore_transpile_errors to 'false'") } - JALVIEW_VERSION = "TEST" + JALVIEW_VERSION = JALVIEW_VERSION+"-test" install4jSuffix = "Test" install4jDSStore = "DS_Store-TEST-RELEASE" install4jDMGBackgroundImage = "jalview_dmg_background-TEST.png" @@ -240,6 +264,8 @@ ext { case ~/^SCRATCH(|-[-\w]*)$/: getdownChannelName = CHANNEL + JALVIEW_VERSION = JALVIEW_VERSION+"-"+CHANNEL + getdownDir = string("${getdownChannelName}/${JAVA_VERSION}") getdownAppBase = string("${getdown_channel_base}/${getdownDir}") reportRsyncCommand = true @@ -262,6 +288,7 @@ ext { break case "LOCAL": + JALVIEW_VERSION = "TEST" getdownAppBase = file(getdownWebsiteDir).toURI().toString() getdownLauncher = string("${jalviewDir}/${getdown_lib_dir}/${getdown_launcher_local}") install4jExtraScheme = "jalviewl" @@ -804,7 +831,7 @@ task cleanClover { compileJava { - + // JBP->BS should the print statement in doFirst refer to compile_target_compatibility ? sourceCompatibility = compile_source_compatibility targetCompatibility = compile_target_compatibility options.compilerArgs = additional_compiler_args @@ -1499,7 +1526,8 @@ task copyInstall4jTemplate { // NB we're deleting the /other/ one! // Also remove the examples subdir from non-release versions def customizedIdToDelete = "PROGRAM_GROUP_RELEASE" - if (CHANNEL=="RELEASE") { + // 2.11.1.0 NOT releasing with the Examples folder in the Program Group + if (false && CHANNEL=="RELEASE") { // remove 'false && ' to include Examples folder in RELEASE channel customizedIdToDelete = "PROGRAM_GROUP_NON_RELEASE" } else { // remove the examples subdir from Full File Set