-
Notifications
You must be signed in to change notification settings - Fork 26
/
bundler.py
62 lines (55 loc) · 2.34 KB
/
bundler.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
__author__ = 'eamonnmaguire'
import os
# first create the app, should externalise some names to make it a bit nicer
print 'Packaging up jars to run within a native MacOS container'
os.makedirs('ISAcreator.app/Contents/Resources/Java')
os.makedirs('ISAcreator.app/Contents/MacOS')
os.chdir('ISAcreator.app/Contents/')
f = open('Info.plist', 'w')
f.write('<?xml version="1.0" encoding="UTF-8"?>')
f.write('<dict>'\
'<key>CFBundleName</key>'\
'<string>ISAcreator</string>'\
'<key>CFBundleIdentifier</key>'\
'<string>org.isatools.isacreator.launch.ISAcreatorApplication</string>'\
'<key>CFBundleVersion</key>'\
'<string>1.7</string>'\
'<key>CFBundleAllowMixedLocalizations</key>'\
'<string>true</string>'\
'<key>CFBundleExecutable</key>'\
'<string>JavaApplicationStub</string>'\
'<key>CFBundleDevelopmentRegion</key>'\
'<string>English</string>'\
'<key>CFBundlePackageType</key>'\
'<string>APPL</string>'\
'<key>CFBundleShortVersionString</key>'\
'<string>1.7</string>'\
'<key>CFBundleSignature</key>'\
'<string>????</string>'\
'<key>CFBundleGetInfoString</key>'\
'<string>ISAcreator</string>'\
'<key>CFBundleInfoDictionaryVersion</key>'\
'<string>6.0</string>'\
'<key>CFBundleIconFile</key>'\
'<string>isacreator_icon.icns</string>'\
'<key>Java</key>'\
'<dict>'\
'<key>VMOptions</key>'\
'<string>-Xms256mm -Xmx1024mm</string>'\
'<key>MainClass</key>'\
'<string>org.isatools.isacreator.launch.ISAcreatorApplication</string>'\
'<key>JVMVersion</key>'\
'<string>1.5+</string>'\
'<key>ClassPath</key>'\
'<string>$JAVAROOT/ISAcreator.jar</string>'\
'</dict>'\
'</dict>')
f.close()
os.chdir('../../')
#os.system("cp %s %s" % ('Resources/Info.plist', 'ISAcreator.app/Contents/'))
os.system("cp %s %s" % ('ISAcreator.jar', 'ISAcreator.app/Contents/Resources/Java/'))
os.system("cp %s %s" % ('../src/main/resources/images/icon/isacreator_icon.icns', 'ISAcreator.app/Contents/Resources/'))
os.system(
"ln -s /System/Library/Frameworks/JavaVM.framework/Resources/MacOS/JavaApplicationStub ISAcreator.app/Contents/MacOS/JavaApplicationStub")
os.system("chmod -R 755 ISAcreator.app")
# then create a disk image (dmg)