JAL-3289 ARCHIVE now implemented (requires a compiled -PARCHIVEDIST=/path/to/old...
authorBen Soares <bsoares@dundee.ac.uk>
Tue, 25 Jun 2019 11:50:35 +0000 (12:50 +0100)
committerBen Soares <bsoares@dundee.ac.uk>
Tue, 25 Jun 2019 11:50:35 +0000 (12:50 +0100)
build.gradle
gradle.properties
utils/install4j/install4j_template.install4j

index 5c6a36c..026ee8f 100644 (file)
@@ -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
                ]
                )
index dd6afba..8f9b851 100644 (file)
@@ -30,6 +30,7 @@ use_clover = false
 cloverClassesDir = clover-classes
 cloverSourcesInstrDir = sources-instr
 packageDir = dist
+ARCHIVEDIST =
 outputJar = jalview.jar
 
 testSourceDir = test
index 02fdf8e..d1c85e9 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<install4j version="7.0.9" transformSequenceNumber="7">
+<install4j version="7.0.11" transformSequenceNumber="7">
   <directoryPresets config="." />
   <application name="Jalview" distributionSourceDir="" applicationId="6595-2347-1923-0725" mediaDir="../../build/install4j" mediaFilePattern="${compiler:sys.shortName}_${compiler:sys.platform}_${compiler:sys.version}" compression="6" lzmaCompression="true" pack200Compression="false" excludeSignedFromPacking="true" commonExternalFiles="false" createMd5Sums="true" shrinkRuntime="true" shortName="Jalview" publisher="University of Dundee" publisherWeb="http://www.jalview.org/" version="$$VERSION$$" allPathsRelative="true" backupOnSave="false" autoSave="false" convertDotsToUnderscores="true" macSignature="????" macVolumeId="5aac4968c304f65" javaMinVersion="9999999999" javaMaxVersion="" allowBetaVM="true" jdkMode="jdk" jdkName="JDK 11.0">
     <languages skipLanguageSelection="false" languageSelectionInPrincipalLanguage="false">
@@ -1125,7 +1125,7 @@ return console.askYesNo(message, true);
                   <java class="java.beans.XMLDecoder">
                     <object class="com.install4j.runtime.beans.actions.files.DeleteFileAction">
                       <void property="files">
-                        <array class="java.io.File" length="20">
+                        <array class="java.io.File" length="31">
                           <void index="0">
                             <object class="java.io.File">
                               <string>jre</string>
@@ -1143,89 +1143,144 @@ return console.askYesNo(message, true);
                           </void>
                           <void index="3">
                             <object class="java.io.File">
-                              <string>dist</string>
+                              <string>$$GETDOWN_DIST_DIR$$</string>
                             </object>
                           </void>
                           <void index="4">
                             <object class="java.io.File">
-                              <string>resource</string>
+                              <string>$$GETDOWN_ALT_DIR$$</string>
                             </object>
                           </void>
                           <void index="5">
                             <object class="java.io.File">
-                              <string>getdown-launcher.jar</string>
+                              <string>$$GETDOWN_RESOURCE_DIR$$</string>
                             </object>
                           </void>
                           <void index="6">
                             <object class="java.io.File">
-                              <string>getdown-launcher-old.jar</string>
+                              <string>getdown-launcher.jar</string>
                             </object>
                           </void>
                           <void index="7">
                             <object class="java.io.File">
-                              <string>getdown-launcher-new.jar</string>
+                              <string>getdown-launcher-old.jar</string>
                             </object>
                           </void>
                           <void index="8">
                             <object class="java.io.File">
-                              <string>*.jarv</string>
+                              <string>getdown-launcher-new.jar</string>
                             </object>
                           </void>
                           <void index="9">
                             <object class="java.io.File">
-                              <string>gettingdown.lock</string>
+                              <string>*.jarv</string>
                             </object>
                           </void>
                           <void index="10">
                             <object class="java.io.File">
-                              <string>*.log</string>
+                              <string>gettingdown.lock</string>
                             </object>
                           </void>
                           <void index="11">
                             <object class="java.io.File">
-                              <string>*.txt</string>
+                              <string>*.log</string>
                             </object>
                           </void>
                           <void index="12">
                             <object class="java.io.File">
-                              <string>*_new</string>
+                              <string>*.txt</string>
                             </object>
                           </void>
                           <void index="13">
                             <object class="java.io.File">
-                              <string>digest.txt</string>
+                              <string>*_new</string>
                             </object>
                           </void>
                           <void index="14">
                             <object class="java.io.File">
-                              <string>digest2.txt</string>
+                              <string>digest.txt</string>
                             </object>
                           </void>
                           <void index="15">
                             <object class="java.io.File">
-                              <string>getdown-launcher.jarv</string>
+                              <string>digest2.txt</string>
                             </object>
                           </void>
                           <void index="16">
                             <object class="java.io.File">
-                              <string>getdown-launcher-new.jarv</string>
+                              <string>getdown-launcher.jarv</string>
                             </object>
                           </void>
                           <void index="17">
                             <object class="java.io.File">
-                              <string>launcher.log</string>
+                              <string>getdown-launcher-new.jarv</string>
                             </object>
                           </void>
                           <void index="18">
                             <object class="java.io.File">
-                              <string>proxy.txt</string>
+                              <string>channel_launch.jvl</string>
                             </object>
                           </void>
                           <void index="19">
                             <object class="java.io.File">
+                              <string>launcher.log</string>
+                            </object>
+                          </void>
+                          <void index="20">
+                            <object class="java.io.File">
+                              <string>proxy.txt</string>
+                            </object>
+                          </void>
+                          <void index="21">
+                            <object class="java.io.File">
                               <string>META-INF</string>
                             </object>
                           </void>
+                          <void index="22">
+                            <object class="java.io.File">
+                              <string>install/getdown-launcher.jar</string>
+                            </object>
+                          </void>
+                          <void index="23">
+                            <object class="java.io.File">
+                              <string>install/getdown.txt</string>
+                            </object>
+                          </void>
+                          <void index="24">
+                            <object class="java.io.File">
+                              <string>install/build_properties</string>
+                            </object>
+                          </void>
+                          <void index="25">
+                            <object class="java.io.File">
+                              <string>build_properties</string>
+                            </object>
+                          </void>
+                          <void index="26">
+                            <object class="java.io.File">
+                              <string>install</string>
+                            </object>
+                          </void>
+                          <void index="27">
+                            <object class="java.io.File">
+                              <string>dist</string>
+                            </object>
+                          </void>
+                          <void index="28">
+                            <object class="java.io.File">
+                              <string>release</string>
+                            </object>
+                          </void>
+                          <void index="29">
+                            <object class="java.io.File">
+                              <string>alt</string>
+                            </object>
+                          </void>
+                          <void index="30">
+                            <object class="java.io.File">
+                              <string>resource</string>
+                            </object>
+                          </void>
                         </array>
                       </void>
                       <void property="recursive">
@@ -1554,7 +1609,7 @@ return console.askYesNo(message, true);
               <group name="" id="49" customizedId="" beanClass="com.install4j.runtime.beans.groups.VerticalFormComponentGroup" enabled="true" commentSet="false" comment="" actionElevationType="inherit" useExternalParametrization="true" externalParametrizationName="Customize title bar" externalParametrizationMode="include">
                 <serializedBean>
                   <java class="java.beans.XMLDecoder">
-                    <object class="com.install4j.runtime.beans.groups.VerticalFormComponentGroup">
+                    <object class="com.install4j.runtime.beans.groups.VerticalFormComponentGroup" id="VerticalFormComponentGroup0">
                       <void property="backgroundColor">
                         <object class="java.awt.Color">
                           <int>255</int>
@@ -1584,19 +1639,21 @@ return console.askYesNo(message, true);
                           <string>icon:${installer:sys.installerApplicationMode}_header.png</string>
                         </object>
                       </void>
+                      <void id="Integer0" property="cellSpacing" />
+                      <void id="Integer1" property="borderWidth" />
                       <void property="imageInsets">
                         <object class="java.awt.Insets">
-                          <int>0</int>
+                          <object idref="Integer0" />
                           <int>5</int>
-                          <int>1</int>
-                          <int>1</int>
+                          <object idref="Integer1" />
+                          <object idref="Integer1" />
                         </object>
                       </void>
                       <void property="insets">
                         <object class="java.awt.Insets">
-                          <int>0</int>
+                          <object idref="Integer0" />
                           <int>20</int>
-                          <int>0</int>
+                          <object idref="Integer0" />
                           <int>10</int>
                         </object>
                       </void>
@@ -1678,16 +1735,17 @@ return console.askYesNo(message, true);
               <group name="" id="53" customizedId="" beanClass="com.install4j.runtime.beans.groups.HorizontalFormComponentGroup" enabled="true" commentSet="false" comment="" actionElevationType="inherit" useExternalParametrization="false" externalParametrizationName="" externalParametrizationMode="all">
                 <serializedBean>
                   <java class="java.beans.XMLDecoder">
-                    <object class="com.install4j.runtime.beans.groups.HorizontalFormComponentGroup">
+                    <object class="com.install4j.runtime.beans.groups.HorizontalFormComponentGroup" id="HorizontalFormComponentGroup0">
                       <void property="alignFirstLabel">
                         <boolean>false</boolean>
                       </void>
+                      <void id="Integer0" property="cellSpacing" />
                       <void property="insets">
                         <object class="java.awt.Insets">
                           <int>3</int>
-                          <int>5</int>
+                          <object idref="Integer0" />
                           <int>8</int>
-                          <int>5</int>
+                          <object idref="Integer0" />
                         </object>
                       </void>
                     </object>