X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=build.gradle;h=e99272c3c997f7bee9ddfd86308ca765de286aee;hb=refs%2Fheads%2Ftrial_merge%2Fdevelop%2Fbug%2FJAL-247autoIdWidthSeqMarker;hp=6129170b0419497df0be26ae39f1a32ead85c02b;hpb=bd0a8a853fe1f782eedf9ffad1913f2321ced0f9;p=jalview.git diff --git a/build.gradle b/build.gradle index 6129170..e99272c 100644 --- a/build.gradle +++ b/build.gradle @@ -202,7 +202,10 @@ ext { case "DEVELOP": reportRsyncCommand = true + install4jDSStore = "DS_Store-DEVELOP" + install4jDMGBackgroundImage = "jalview_dmg_background-DEVELOP.png" install4jExtraScheme = "jalviewd" + install4jInstallerName = "${jalview_name} Develop Installer" break case "TEST-RELEASE": @@ -210,7 +213,7 @@ ext { 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 @@ -233,7 +236,7 @@ ext { 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 @@ -260,21 +263,31 @@ ext { if (install4jSuffix == "") { install4jApplicationName = "${jalview_name}" install4jBundleId = "${install4j_bundle_id}" + install4jWinApplicationId = install4j_release_win_application_id } else { install4jApplicationName = "${jalview_name} ${install4jSuffix}" install4jBundleId = "${install4j_bundle_id}-" + install4jSuffix.toLowerCase() + // add int hash of install4jSuffix to the last part of the application_id + def id = install4j_release_win_application_id + def idsplitreverse = id.split("-").reverse() + idsplitreverse[0] = idsplitreverse[0].toInteger() + install4jSuffix.hashCode() + install4jWinApplicationId = idsplitreverse.reverse().join("-") } // sanitise folder and id names // install4jApplicationFolder = e.g. "Jalview Build" install4jApplicationFolder = install4jApplicationName - .replaceAll("[\"'~:/\\\\]", "_") // replace all awkward filename chars " ' ~ : / \ + .replaceAll("[\"'~:/\\\\\\s]", "_") // replace all awkward filename chars " ' ~ : / \ .replaceAll("_+", "_") // collapse __ - install4jInternalId = install4jApplicationFolder + install4jInternalId = install4jApplicationName + .replaceAll(" ","_") + .replaceAll("[^\\w\\-\\.]", "_") // replace other non [alphanumeric,_,-,.] + .replaceAll("_+", "") // collapse __ + //.replaceAll("_*-_*", "-") // collapse _-_ + install4jUnixApplicationFolder = install4jApplicationName .replaceAll(" ","_") .replaceAll("[^\\w\\-\\.]", "_") // replace other non [alphanumeric,_,-,.] .replaceAll("_+", "_") // collapse __ .replaceAll("_*-_*", "-") // collapse _-_ - install4jUnixApplicationFolder = install4jInternalId .toLowerCase() getdownAppDir = string("${getdownWebsiteDir}/${getdownAppDistDir}") @@ -1337,6 +1350,7 @@ task copyInstall4jTemplate { def install4jFileAssociationsFile = file("${install4jDir}/${install4j_installer_file_associations}") inputs.file(install4jTemplateFile) inputs.file(install4jFileAssociationsFile) + inputs.property("CHANNEL", { CHANNEL }) outputs.file(install4jConfFile) doLast { @@ -1363,7 +1377,7 @@ task copyInstall4jTemplate { // put file association actions where placeholder action is def install4jFileAssociationsText = install4jFileAssociationsFile.text def fileAssociationActions = new XmlParser().parseText("${install4jFileAssociationsText}") - 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) @@ -1375,6 +1389,35 @@ task copyInstall4jTemplate { } } + // 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" + if (CHANNEL=="RELEASE") { + 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) } @@ -1434,6 +1477,7 @@ task installers(type: com.install4j.gradle.Install4jTask) { 'COPYRIGHT_MESSAGE': install4j_copyright_message, 'BUNDLE_ID': install4jBundleId, 'INTERNAL_ID': install4jInternalId, + 'WINDOWS_APPLICATION_ID': install4jWinApplicationId, 'MACOS_DS_STORE': install4jDSStore, 'MACOS_DMG_BG_IMAGE': install4jDMGBackgroundImage, 'INSTALLER_NAME': install4jInstallerName, @@ -1446,15 +1490,15 @@ task installers(type: com.install4j.gradle.Install4jTask) { '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, 'EXTRA_SCHEME': install4jExtraScheme, ] - println("INSTALL4J VARIABLES:") - variables.each{k,v->println("${k}=${v}")} + //println("INSTALL4J VARIABLES:") + //variables.each{k,v->println("${k}=${v}")} destination = "${jalviewDir}/${install4jBuildDir}" buildSelected = true