From c733fdbd72a04f58a44f4114ab015002b08a80c8 Mon Sep 17 00:00:00 2001 From: Ben Soares Date: Tue, 25 Jun 2019 12:50:35 +0100 Subject: [PATCH] JAL-3289 ARCHIVE now implemented (requires a compiled -PARCHIVEDIST=/path/to/old/jalview/dist). Improved delete file values in uninstaller. Added an ARCHIVELOCAL channel type for testing. --- build.gradle | 82 ++++++++++++++----- gradle.properties | 1 + utils/install4j/install4j_template.install4j | 112 +++++++++++++++++++------- 3 files changed, 146 insertions(+), 49 deletions(-) diff --git a/build.gradle b/build.gradle index 5c6a36c..026ee8f 100644 --- a/build.gradle +++ b/build.gradle @@ -51,11 +51,11 @@ def compile_source_compatibility def compile_target_compatibility ext { - getdownWebsiteDir = jalviewDir + '/' + getdown_website_dir + '/' + JAVA_VERSION getdownDir = "" reportRsyncCmd = false - switch (CHANNEL) { + buildDist = true + switch (CHANNEL) { case "BUILD": // TODO: get bamboo build artifact URL for getdown artifacts @@ -75,6 +75,29 @@ ext { getdownDir = getdown_channel_name + "/" + JAVA_VERSION getdown_app_base = getdown_channel_base + "/" + getdownDir getdown_app_dir = getdown_app_dir_alt + if (!file(ARCHIVEDIST).exists()) { + print "Must provide an ARCHIVEDIST value to produce an archive distribution" + exit(2) + } else { + packageDir = ARCHIVEDIST + buildDist = false + } + reportRsyncCommand = true + break + + case "ARCHIVELOCAL": + getdown_channel_name = CHANNEL.toLowerCase()+"/"+JALVIEW_VERSION + getdownDir = getdown_channel_name + "/" + JAVA_VERSION + //getdown_app_base = getdown_channel_base + "/" + getdownDir + getdown_app_base = file(getdownWebsiteDir).toURI().toString() + getdown_app_dir = getdown_app_dir_alt + if (!file(ARCHIVEDIST).exists()) { + print "Must provide an ARCHIVEDIST value to produce an archive distribution" + exit(2) + } else { + packageDir = ARCHIVEDIST + buildDist = false + } reportRsyncCommand = true break @@ -637,7 +660,9 @@ test { dependsOn cloverInstr } - print("Running tests " + (use_clover?"WITH":"WITHOUT") + " clover [clover="+use_clover+"]\n") + if (use_clover) { + print("Running tests " + (use_clover?"WITH":"WITHOUT") + " clover [clover="+use_clover+"]\n") + } useTestNG() { includeGroups testngGroups @@ -764,20 +789,27 @@ task cleanDist { shadowJar { group = "distribution" - dependsOn makeDist + if (buildDist) { + dependsOn makeDist + } from ("$jalviewDir/$libDistDir") { include("*.jar") } + manifest { + attributes 'Implementation-Version': JALVIEW_VERSION + } mainClassName = shadowJarMainClass mergeServiceFiles() - classifier = "all-"+JAVA_VERSION + classifier = "all-"+JALVIEW_VERSION+"-j"+JAVA_VERSION minimize() } task getdownWebsite() { group = "distribution" description = "Create the getdown minimal app folder, and website folder for this version of jalview. Website folder also used for offline app installer" - dependsOn makeDist + if (buildDist) { + dependsOn makeDist + } def getdownWebsiteResourceFilenames = [] def getdownTextString = "" def getdownResourceDir = project.ext.getdownResourceDir @@ -842,7 +874,7 @@ task getdownWebsite() { } def codeFiles = [] - makeDist.outputs.files.each{ f -> + fileTree(file(packageDir)).each{ f -> if (f.isDirectory()) { def files = fileTree(dir: f, include: ["*"]).getFiles() codeFiles += files @@ -895,14 +927,21 @@ task getdownWebsite() { from getdownLauncher into project.ext.getdownWebsiteDir } - - copy { - from getdown_txt - from getdownLauncher - from getdownWebsiteDir+"/"+getdown_build_properties - into getdownInstallDir - } - + + if (CHANNEL != "ARCHIVE" && CHANNEL != "DEVELOP") { + copy { + from getdown_txt + from getdownLauncher + from getdownWebsiteDir+"/"+getdown_build_properties + into getdownInstallDir + } + + copy { + from getdownInstallDir + into getdownFilesInstallDir + } + } + copy { from getdown_txt from launch_jvl @@ -912,11 +951,6 @@ task getdownWebsite() { } copy { - from getdownInstallDir - into getdownFilesInstallDir - } - - copy { from jalviewDir + '/' + project.getProperty('getdown_txt_ui.background_image') from jalviewDir + '/' + project.getProperty('getdown_txt_ui.error_background') from jalviewDir + '/' + project.getProperty('getdown_txt_ui.progress_image') @@ -926,7 +960,9 @@ task getdownWebsite() { } } - inputs.dir(jalviewDir + '/' + packageDir) + if (buildDist) { + inputs.dir(jalviewDir + '/' + packageDir) + } outputs.dir(project.ext.getdownWebsiteDir) outputs.dir(project.ext.getdownFilesDir) } @@ -950,7 +986,7 @@ task getdown() { if (reportRsyncCommand) { def fromDir = getdownWebsiteDir + (getdownWebsiteDir.endsWith("/")?"":"/") def toDir = getdown_smb_mount + "/" + getdownDir + (getdownDir.endsWith("/")?"":"/") - println "rsync -avh --delete '$fromDir' '$toDir'" + println "LIKELY RSYNC COMMAND:\nrsync -avh --delete '$fromDir' '$toDir'" } } } @@ -1010,7 +1046,9 @@ task copyInstall4jTemplate(type: Copy) { 'INSTALL4JINFOPLISTFILEASSOCIATIONS': install4jInfoPlistFileAssociations, 'COPYRIGHT_MESSAGE': install4jCopyrightMessage, 'MACOS_BUNDLE_ID': install4jMacOSBundleId, + 'GETDOWN_RESOURCE_DIR': getdown_resource_dir, 'GETDOWN_DIST_DIR': getdown_app_dir, + 'GETDOWN_ALT_DIR': getdown_app_dir_alt, 'GETDOWN_INSTALL_DIR': getdown_install_dir ] ) diff --git a/gradle.properties b/gradle.properties index dd6afba..8f9b851 100644 --- a/gradle.properties +++ b/gradle.properties @@ -30,6 +30,7 @@ use_clover = false cloverClassesDir = clover-classes cloverSourcesInstrDir = sources-instr packageDir = dist +ARCHIVEDIST = outputJar = jalview.jar testSourceDir = test diff --git a/utils/install4j/install4j_template.install4j b/utils/install4j/install4j_template.install4j index 02fdf8e..d1c85e9 100644 --- a/utils/install4j/install4j_template.install4j +++ b/utils/install4j/install4j_template.install4j @@ -1,5 +1,5 @@ - + @@ -1125,7 +1125,7 @@ return console.askYesNo(message, true); - + jre @@ -1143,89 +1143,144 @@ return console.askYesNo(message, true); - dist + $$GETDOWN_DIST_DIR$$ - resource + $$GETDOWN_ALT_DIR$$ - getdown-launcher.jar + $$GETDOWN_RESOURCE_DIR$$ - getdown-launcher-old.jar + getdown-launcher.jar - getdown-launcher-new.jar + getdown-launcher-old.jar - *.jarv + getdown-launcher-new.jar - gettingdown.lock + *.jarv - *.log + gettingdown.lock - *.txt + *.log - *_new + *.txt - digest.txt + *_new - digest2.txt + digest.txt - getdown-launcher.jarv + digest2.txt - getdown-launcher-new.jarv + getdown-launcher.jarv - launcher.log + getdown-launcher-new.jarv - proxy.txt + channel_launch.jvl + launcher.log + + + + + proxy.txt + + + + META-INF + + + install/getdown-launcher.jar + + + + + install/getdown.txt + + + + + install/build_properties + + + + + build_properties + + + + + install + + + + + dist + + + + + release + + + + + alt + + + + + resource + + @@ -1554,7 +1609,7 @@ return console.askYesNo(message, true); - + 255 @@ -1584,19 +1639,21 @@ return console.askYesNo(message, true); icon:${installer:sys.installerApplicationMode}_header.png + + - 0 + 5 - 1 - 1 + + - 0 + 20 - 0 + 10 @@ -1678,16 +1735,17 @@ return console.askYesNo(message, true); - + false + 3 - 5 + 8 - 5 + -- 1.7.10.2