}
}
+ ////
+ // 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
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"
+ install4jInstallerName = "${jalview_name} Develop Installer"
break
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.png"
+ install4jDMGBackgroundImage = "jalview_dmg_background-TEST.png"
install4jExtraScheme = "jalviewt"
install4jInstallerName = "${jalview_name} Test Installer"
break
JALVIEW_VERSION = "TEST"
install4jSuffix = "Test-Local"
install4jDSStore = "DS_Store-TEST-RELEASE"
- install4jDMGBackgroundImage = "jalview_dmg_background.png"
+ install4jDMGBackgroundImage = "jalview_dmg_background-TEST.png"
install4jExtraScheme = "jalviewt"
install4jInstallerName = "${jalview_name} Test Installer"
break
.replaceAll("[^\\w\\-\\.]", "_") // replace other non [alphanumeric,_,-,.]
.replaceAll("_+", "") // collapse __
//.replaceAll("_*-_*", "-") // collapse _-_
- install4jUnixApplicationFolder = install4jInternalId
+ install4jUnixApplicationFolder = install4jApplicationName
+ .replaceAll(" ","_")
+ .replaceAll("[^\\w\\-\\.]", "_") // replace other non [alphanumeric,_,-,.]
+ .replaceAll("_+", "_") // collapse __
+ .replaceAll("_*-_*", "-") // collapse _-_
.toLowerCase()
getdownAppDir = string("${getdownWebsiteDir}/${getdownAppDistDir}")
// a helper task to allow getdown digest of any dir: `gradle getdownDigestDir -PDIGESTDIR=/path/to/my/random/getdown/dir
task getdownDigestDir(type: JavaExec) {
+ group "Help"
+ description "A task to run a getdown Digest on a dir with getdown.txt. Provide a DIGESTDIR property via -PDIGESTDIR=..."
+
def digestDirPropertyName = "DIGESTDIR"
- description = "Digest a local dir (-P${digestDirPropertyName}=...) for getdown"
doFirst {
classpath = files(getdownLauncher)
def digestDir = findProperty(digestDirPropertyName)
def install4jFileAssociationsFile = file("${install4jDir}/${install4j_installer_file_associations}")
inputs.file(install4jTemplateFile)
inputs.file(install4jFileAssociationsFile)
+ inputs.property("CHANNEL", { CHANNEL })
outputs.file(install4jConfFile)
doLast {
// put file association actions where placeholder action is
def install4jFileAssociationsText = install4jFileAssociationsFile.text
def fileAssociationActions = new XmlParser().parseText("<actions>${install4jFileAssociationsText}</actions>")
- install4jConfigXml.'**'.action.any { a ->
+ install4jConfigXml.'**'.action.any { a -> // .any{} stops after the first one that returns true
if (a.'@name' == 'EXTENSIONS_REPLACED_BY_GRADLE') {
def parent = a.parent()
parent.remove(a)
}
}
+ // use Windows Program Group with Examples folder for RELEASE, and Program Group without Examples for everything else
+ // NB we're deleting the /other/ one!
+ // Also remove the examples subdir from non-release versions
+ def customizedIdToDelete = "PROGRAM_GROUP_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
+ def files = install4jConfigXml.files[0]
+ def fileset = files.filesets.fileset.find { fs -> fs.'@customizedId' == "FULL_FILE_SET" }
+ def root = files.roots.root.find { r -> r.'@fileset' == fileset.'@id' }
+ def mountPoint = files.mountPoints.mountPoint.find { mp -> mp.'@root' == root.'@id' }
+ def dirEntry = files.entries.dirEntry.find { de -> de.'@mountPoint' == mountPoint.'@id' && de.'@subDirectory' == "examples" }
+ dirEntry.parent().remove(dirEntry)
+ }
+ install4jConfigXml.'**'.action.any { a ->
+ if (a.'@customizedId' == customizedIdToDelete) {
+ def parent = a.parent()
+ parent.remove(a)
+ return true
+ }
+ }
+
+ // remove the "Uninstall Old Jalview (optional)" symlink from DMG for non-release DS_Stores
+ if (! (CHANNEL == "RELEASE" || CHANNEL == "TEST-RELEASE" ) ) {
+ def symlink = install4jConfigXml.'**'.topLevelFiles.symlink.find { sl -> sl.'@name' == "Uninstall Old Jalview (optional).app" }
+ symlink.parent().remove(symlink)
+ }
+
// write install4j file
install4jConfFile.text = XmlUtil.serialize(install4jConfigXml)
}
'GETDOWN_INSTALL_DIR': getdown_install_dir,
'INFO_PLIST_FILE_ASSOCIATIONS_FILE': install4j_info_plist_file_associations,
'BUILD_DIR': install4jBuildDir,
- 'UNIX_DESKTOP_ADDITIONS': install4j_unix_desktop_additions,
+ 'APPLICATION_CATEGORIES': install4j_application_categories,
'APPLICATION_FOLDER': install4jApplicationFolder,
'UNIX_APPLICATION_FOLDER': install4jUnixApplicationFolder,
'EXECUTABLE_NAME': install4jExecutableName,