From a2b926fa1b005192fc6d3436ceac51167fca3e8b Mon Sep 17 00:00:00 2001
From: Norberto Lopez <106690103+nobes888@users.noreply.github.com>
Date: Mon, 13 Jun 2016 23:04:43 +0000
Subject: [PATCH] Added support for hdiutil (alternative to genisoimage) Added
support to properly override various JVM args.
---
script/appleUtils.py | 30 ++++++++++++++++++++----------
1 file changed, 20 insertions(+), 10 deletions(-)
diff --git a/script/appleUtils.py b/script/appleUtils.py
index 779f726..929600b 100644
--- a/script/appleUtils.py
+++ b/script/appleUtils.py
@@ -3,6 +3,7 @@
import copy
import math
import os
+import platform
import shutil
import subprocess
import tempfile
@@ -59,7 +60,11 @@ def buildRelease(args, buildPath):
# Create the DMG image via genisoimage
dmgFile = os.path.join(buildPath, aDistName + '.dmg')
# cmd = ['genisoimage', '-o', dmgFile, '-quiet', '-V', appName, '-max-iso9660-filenames', '-hfs-unlock', '-uid', '501', '-gid', '80', '-r', '-D', '-apple', tmpPath]
- cmd = ['genisoimage', '-o', dmgFile, '-quiet', '-V', appName, '-max-iso9660-filenames', '-hfs-unlock', '-D', '-r', '-apple', tmpPath]
+ if platform.system() == 'Darwin':
+# cmd = ['hdiutil', 'create', '-fs', 'HFS+' '-o', dmgFile, '-quiet', '-volname', appName, '-srcfolder', tmpPath]
+ cmd = ['hdiutil', 'makehybrid', '-hfs', '-o', dmgFile, '-default-volume-name', appName, tmpPath]
+ else:
+ cmd = ['genisoimage', '-o', dmgFile, '-quiet', '-V', appName, '-max-iso9660-filenames', '-hfs-unlock', '-D', '-r', '-apple', tmpPath]
print('\tForming DMG image. File: ' + dmgFile)
proc = miscUtils.executeAndLog(cmd, "\t\tgenisoimage: ")
if proc.returncode != 0:
@@ -398,18 +403,23 @@ def buildPListInfoStatic(destFile, args, jreTarGzFile):
writeln(f, 2, '' + str(val) + '')
# JVM options
+ jvmArgs = list(args.jvmArgs)
+ if any(aStr.startswith("-Dapple.laf.useScreenMenuBar") == False for aStr in jvmArgs) == True:
+ jvmArgs.append('-Dapple.laf.useScreenMenuBar=true')
+ if any(aStr.startswith("-Dcom.apple.macos.useScreenMenuBar") == False for aStr in jvmArgs) == True:
+ jvmArgs.append('-Dcom.apple.macos.useScreenMenuBar=true')
+ if any(aStr.startswith("-Dcom.apple.macos.use-file-dialog-packages") == False for aStr in jvmArgs) == True:
+ jvmArgs.append('-Dcom.apple.macos.use-file-dialog-packages=true')
+ jvmArgs.append('-Dcom.apple.mrj.application.apple.menu.about.name=' + args.name)
+ jvmArgs.append('-Dapple.awt.application.name=' + args.name)
+ jvmArgs.append('-Djava.system.class.loader=appLauncher.RootClassLoader')
+# if icnsStr != None:
+# jvmArgs.append('-Xdock:icon=Contents/Resources/' + icnsStr)
+
writeln(f, 2, 'JVMOptions')
writeln(f, 2, '')
- for aStr in args.jvmArgs:
+ for aStr in jvmArgs:
writeln(f, 3, '' + aStr + '')
-# if icnsStr != None:
-# writeln(f, 3, '-Xdock:icon=Contents/Resources/' + icnsStr + '')
- writeln(f, 3, '-Dapple.laf.useScreenMenuBar=true')
- writeln(f, 3, '-Dcom.apple.macos.useScreenMenuBar=true')
- writeln(f, 3, '-Dcom.apple.macos.use-file-dialog-packages=true')
- writeln(f, 3, '-Dcom.apple.mrj.application.apple.menu.about.name=' + args.name + '')
- writeln(f, 3, '-Dapple.awt.application.name=' + args.name + '')
- writeln(f, 3, '-Djava.system.class.loader=appLauncher.RootClassLoader')
writeln(f, 2, '')
# # App arguments