JAL-3830 improved bash scripts. Added powershell script. Needs testing
[jalview.git] / build.gradle
index 1443a85..0a27370 100644 (file)
@@ -1572,6 +1572,18 @@ task getdownWebsite() {
         into getdownResourceDir
       }
     }
+    
+    def getdownWrapperScripts = [ getdown_mac_wrapper_script, getdown_unix_wrapper_script, getdown_windows_wrapper_script ]
+    getdownWrapperScripts.each{ script ->
+      def s = file( "${jalviewDir}/utils/getdown/${script}" )
+      if (s.exists()) {
+        copy {
+          from s
+          into getdownWebsiteDir
+        }
+        getdownTextString += "resource = ${script}\n"
+      }
+    }
 
     def codeFiles = []
     fileTree(file(package_dir)).each{ f ->
@@ -1877,6 +1889,8 @@ task installers(type: com.install4j.gradle.Install4jTask) {
     'JALVIEW_APPLICATION_NAME': install4jApplicationName,
     'JALVIEW_DIR': "../..",
     'OSX_KEYSTORE': OSX_KEYSTORE,
+    'OSX_APPLEID': OSX_APPLEID,
+    'OSX_ALTOOLPASS': OSX_ALTOOLPASS,
     'JSIGN_SH': JSIGN_SH,
     'JRE_DIR': getdown_app_dir_java,
     'INSTALLER_TEMPLATE_VERSION': install4jTemplateVersion,
@@ -1898,6 +1912,8 @@ task installers(type: com.install4j.gradle.Install4jTask) {
     'WINDOWS_APPLICATION_ID': install4jWinApplicationId,
     'MACOS_DMG_DS_STORE': install4jDMGDSStore,
     'MACOS_DMG_BG_IMAGE': install4jDMGBackgroundImage,
+    'MACOS_DMG_WRAPPER_LINK': install4j_dmg_wrapper_link,
+    'MACOS_WRAPPER_SCRIPT': getdown_mac_wrapper_script,
     'INSTALLER_NAME': install4jInstallerName,
     'INSTALL4J_UTILS_DIR': install4j_utils_dir,
     'GETDOWN_WEBSITE_DIR': getdown_website_dir,
@@ -1929,15 +1945,25 @@ task installers(type: com.install4j.gradle.Install4jTask) {
   if (install4j_faster.equals("true") || CHANNEL.startsWith("LOCAL")) {
     faster = true
     disableSigning = true
+    disableNotarization = true
   }
 
   if (OSX_KEYPASS) {
     macKeystorePassword = OSX_KEYPASS
+  } 
+  
+  if (OSX_ALTOOLPASS) {
+    appleIdPassword = OSX_ALTOOLPASS
+    disableNotarization = false
+  } else {
+    disableNotarization = true
   }
 
   doFirst {
     println("Using projectFile "+projectFile)
+    if (!disableNotarization) { println("Will notarize OSX App DMG") }
   }
+  verbose=true
 
   inputs.dir(getdownWebsiteDir)
   inputs.file(install4jConfFile)
@@ -1958,7 +1984,8 @@ spotless {
 task sourceDist(type: Tar) {
   group "distribution"
   description "Create a source .tar.gz file for distribution"
-  
+
+  dependsOn createBuildProperties
   dependsOn convertMdFiles
 
   def VERSION_UNDERSCORES = JALVIEW_VERSION.replaceAll("\\.", "_")
@@ -2046,6 +2073,15 @@ task sourceDist(type: Tar) {
 //    exclude(EXCLUDE_FILES)
 //    exclude(PROCESS_FILES)
 //  }
+
+  from(file(buildProperties).getParent()) {
+    include(file(buildProperties).getName())
+    rename(file(buildProperties).getName(), "build_properties")
+    filter({ line ->
+      line.replaceAll("^INSTALLATION=.*\$","INSTALLATION=Source Release"+" git-commit\\\\:"+gitHash+" ["+gitBranch+"]")
+    })
+  }
+
 }