From: Jim Procter Date: Thu, 9 Apr 2020 11:04:07 +0000 (+0100) Subject: JAL-3577 automatically configure JALVIEW_VERSION for builds using jalview.version... X-Git-Tag: Develop-2_11_2_0-d20201215~38^2 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Ftesting%2FJAL-3577_jalviewversion_autoset_fixed;p=jalview.git JAL-3577 automatically configure JALVIEW_VERSION for builds using jalview.version property in RELEASE file --- diff --git a/build.gradle b/build.gradle index e99272c..4bb52b0 100644 --- a/build.gradle +++ b/build.gradle @@ -78,6 +78,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 = "${jalviewDir}/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 @@ -202,6 +222,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" @@ -210,7 +235,10 @@ ext { case "TEST-RELEASE": reportRsyncCommand = true - JALVIEW_VERSION = "TEST" + + // TEST-RELEASE is usually associated with a Jalview release series so set the version + JALVIEW_VERSION=JALVIEW_VERSION+"-test" + install4jSuffix = "Test" install4jDSStore = "DS_Store-TEST-RELEASE" install4jDMGBackgroundImage = "jalview_dmg_background-TEST.png" diff --git a/doc/building.md b/doc/building.md index 398181a..ad19979 100644 --- a/doc/building.md +++ b/doc/building.md @@ -165,6 +165,7 @@ Within the `jalview` folder you will find (of possible interest): `utils/install4j/` | files used by the packaging tool, install4j `build.gradle` | the build file used by gradle `gradle.properties` | configurable properties for the build process + `RELEASE` | propertyfile configuring JALVIEW_VERSION (from jalview.version) and the release branch (from jalview.release). An alternative file can be specified via JALVIEW_RELEASE_FILE property Note that you need a Java 11 JDK to compile Jalview whether your target build is Java 1.8 or Java 11. @@ -422,7 +423,7 @@ There are several values of `CHANNEL` that can be chosen, with a default of `LOC Note that bamboo_planKey should be set by the build plan with `-Pbamboo_planKey=${bamboo.planKey}` - application subdir as `alt` - Getdown launcher cannot use a `file://` scheme appbase. -* `DEVELOP`: This is for creating a `develop` appbase channel on the main web server. This won't become live until the actual getdown artefact is synced to the web server. +* `DEVELOP`: This is for creating a `develop` appbase channel on the main web server. This won't become live until the actual getdown artefact is synced to the web server. It will set - `appbase` as `http://www.jalview.org/getdown/develop/JAVA_VERSION` - application subdir as `alt` @@ -465,6 +466,13 @@ e.g. gradle getdown -PCHANNEL=SCRATCH-my_test_version ``` +#### JALVIEW_VERSION and the RELEASE file +Any Jalview build will include the value of JALVIEW_VERSION in various places, including the 'About' and Jalview Desktop window title, and in filenames for the stand-alone executable jar. You can specify a custom version for a build via the JALVIEW_VERSION property, but for most situations, JALVIEW_VERSION will be automatically configured according to the value of the CHANNEL property, using the `jalview.version` property specified in the RELEASE file: + - `CHANNEL=RELEASE` will set version to jalview.version + - `CHANNEL=TEST or DEVELOP` will append '-test' or '-develop' to jalview.version + +It is also possible to specify a custom location for the RELEASE file via an optional JALVIEW_RELEASE_FILE property. + #### `install4jMediaTypes` If you are building *install4j* installers (requires *install4j* to be installed) then this property specifies a comma-separated list of media types (i.e. platform specific installers) *install4j* should actually build.