-
Notifications
You must be signed in to change notification settings - Fork 12
/
bundler.py
63 lines (55 loc) · 2.55 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
63
__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('ISAcreatorConfigurator.app/Contents/Resources/Java')
os.makedirs('ISAcreatorConfigurator.app/Contents/MacOS')
os.chdir('ISAcreatorConfigurator.app/Contents/')
f = open('Info.plist', 'w')
f.write('<?xml version="1.0" encoding="UTF-8"?>')
f.write('<dict>'\
'<key>CFBundleName</key>'\
'<string>ISAcreator Configurator</string>'\
'<key>CFBundleIdentifier</key>'\
'<string>org.isatools.isacreatorconfigurator.configui.ISAcreatorConfigurator</string>'\
'<key>CFBundleVersion</key>'\
'<string>1.6</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.6</string>'\
'<key>CFBundleSignature</key>'\
'<string>????</string>'\
'<key>CFBundleGetInfoString</key>'\
'<string>ISAcreatorConfigurator</string>'\
'<key>CFBundleInfoDictionaryVersion</key>'\
'<string>6.0</string>'\
'<key>CFBundleIconFile</key>'\
'<string>isaconfigurator-icon.icns</string>'\
'<key>Java</key>'\
'<dict>'\
'<key>VMOptions</key>'\
'<string>-Xms256mm -Xmx1024mm</string>'\
'<key>MainClass</key>'\
'<string>org.isatools.isacreatorconfigurator.configui.ISAcreatorConfigurator</string>'\
'<key>JVMVersion</key>'\
'<string>1.5+</string>'\
'<key>ClassPath</key>'\
'<string>$JAVAROOT/ISACreatorConfigurator.jar</string>'\
'</dict>'\
'</dict>')
f.close()
os.chdir('../../')
os.system("mv %s %s" % ('ISACreatorConfigurator-1.6-jar-with-dependencies.jar', 'ISACreatorConfigurator.jar'))
os.system("cp %s %s" % ('ISACreatorConfigurator.jar', 'ISAcreatorConfigurator.app/Contents/Resources/Java/'))
os.system("cp %s %s" % ('../src/main/resources/images/icon/isaconfigurator-icon.icns', 'ISAcreatorConfigurator.app/Contents/Resources/'))
os.system(
"ln -s /System/Library/Frameworks/JavaVM.framework/Resources/MacOS/JavaApplicationStub ISAcreatorConfigurator.app/Contents/MacOS/JavaApplicationStub")
os.system("chmod -R 755 ISACreatorConfigurator.app")
# then create a disk image (dmg)