-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.xml
360 lines (305 loc) · 15 KB
/
build.xml
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
<?xml version="1.0" encoding="UTF-8"?>
<project name="musecontroller" default="all">
<!-- Set this property value to your application name.
Do not include the .app extension -->
<property name="app.name" value="Muse Controller"/>
<property name="BUILD_NUMBER" value="3.13.3"/>
<property name="image_name" value="${app.name} ${BUILD_NUMBER}"/>
<property file="applescriptifier.properties"/>
<echo message="basedir = ${basedir}"/>
<property name="module.applescriptifier.basedir" value="${basedir}"/>
<echo message="module basedir = ${module.applescriptifier.basedir}"/>
<property name="compiler.debug" value="on"/>
<property name="compiler.generate.no.warnings" value="off"/>
<property name="compiler.args" value=""/>
<property name="compiler.max.memory" value="128m"/>
<property name="compiler.args.applescriptifier" value="${compiler.args}"/>
<property name="applescriptifier.output.dir"
value="${module.applescriptifier.basedir}/out/production/applescriptifier"/>
<property name="applescriptifier.testoutput.dir"
value="${module.applescriptifier.basedir}/out/test/applescriptifier"/>
<property name="applescriptifier.release.dir" value="${module.applescriptifier.basedir}/release"/>
<property name="scala.home" value="lib-dev/scala"/>
<!-- Set this property value to the directory where your
application package has been created (when you invoked
the "ant macosx" target -->
<property name="macosx.app" value="release"/>
<!-- Set this property value to your application resource
directory (where is located your Sparkle jar, the
Zip of the Sparkle framework and the public key) -->
<property name="app.resrc" value="resources"/>
<!-- Set this property value to your native library
directory (where is located your Sparkle JNI library,
e.g. lib/native/) -->
<property name="app.native" value="lib/native"/>
<!-- This property is set to the path where are stored
the files inside the .app package. You should not need
to change it -->
<property name="app.internal" value="Contents/Resources/Java"/>
<!-- Uncomment the following property if no tests compilation is needed -->
<!--
<property name="skip.tests" value="true"/>
-->
<!-- Compiler options -->
<patternset id="ignored.files">
<exclude name="**/CVS/**"/>
<exclude name="**/SCCS/**"/>
<exclude name="**/RCS/**"/>
<exclude name="**/rcs/**"/>
<exclude name="**/.DS_Store/**"/>
<exclude name="**/.svn/**"/>
<exclude name="**/.pyc/**"/>
<exclude name="**/.pyo/**"/>
<exclude name="**/*.pyc/**"/>
<exclude name="**/*.pyo/**"/>
<exclude name="**/.git/**"/>
<exclude name="**/*.hprof/**"/>
<exclude name="**/_svn/**"/>
<exclude name="**/.hg/**"/>
<exclude name="**/*.lib/**"/>
<exclude name="**/*~/**"/>
<exclude name="**/*.scala/**"/>
</patternset>
<patternset id="library.patterns">
<include name="*.zip"/>
<include name="*.war"/>
<include name="*.egg"/>
<include name="*.ear"/>
<include name="*.swc"/>
<include name="*.jar"/>
</patternset>
<patternset id="compiler.resources">
<include name="**/?*.properties"/>
<include name="**/?*.xml"/>
<include name="**/?*.gif"/>
<include name="**/?*.png"/>
<include name="**/?*.jpeg"/>
<include name="**/?*.jpg"/>
<include name="**/?*.html"/>
<include name="**/?*.dtd"/>
<include name="**/?*.tld"/>
<include name="**/?*.ftl"/>
</patternset>
<!-- JDK definitions -->
<!-- Project Libraries -->
<path id="library.aslib.classpath">
<fileset dir="${basedir}/lib">
<patternset refid="library.patterns"/>
</fileset>
</path>
<!-- Global Libraries -->
<!-- Modules -->
<target name="init" description="Build initialization">
<!-- Perform any build initialization in this target -->
</target>
<target name="clean" depends="clean.module.applescriptifier" description="cleanup all"/>
<target name="build.modules" depends="init, clean, bundle-and-sign" description="build all modules"/>
<target name="build.cloudbees" depends="init, clean, bundle-sparkle"
description="build without code signing (for cloudbees)"/>
<target name="all" depends="build.modules, dmg" description="build all"/>
<target name="dmg" description="create the dmg for distribution">
<exec executable="ln">
<arg value="-s"/>
<arg value="/Applications"/>
<arg value="release/Applications"/>
</exec>
<exec executable="hdiutil">
<arg value="create"/>
<arg value="-volname"/>
<arg value="${image_name}"/>
<arg value="-srcfolder"/>
<arg value="release"/>
<arg value="release/${image_name}.dmg"/>
</exec>
<exec executable="src/sign.sh">
<arg value="release/${image_name}.dmg"/>
</exec>
<!--`openssl dgst -sha1 -binary < "#{ARGV[0]}" | openssl dgst -dss1 -sign "#{ARGV[1]}" | openssl enc -base64`-->
<!--hdiutil create -volname foo -srcfolder ~/projects/Muse-Controller/release foo.dmg-->
</target>
<path id="applescriptifier.module.bootclasspath">
<!-- Paths to be included in compilation bootclasspath -->
</path>
<path id="applescriptifier.module.production.classpath">
<pathelement location="/System/Library/Java/Extensions/dns_sd.jar"/>
<path refid="library.aslib.classpath"/>
<pathelement location="${basedir}/resources"/>
</path>
<path id="applescriptifier.runtime.production.module.classpath">
<pathelement location="${applescriptifier.output.dir}"/>
<pathelement location="/System/Library/Java/Extensions/dns_sd.jar"/>
<path refid="library.aslib.classpath"/>
<pathelement location="${basedir}/resources"/>
</path>
<path id="applescriptifier.module.classpath">
<pathelement location="${applescriptifier.output.dir}"/>
<pathelement location="/System/Library/Java/Extensions/dns_sd.jar"/>
<path refid="library.aslib.classpath"/>
<pathelement location="${basedir}/resources"/>
</path>
<path id="applescriptifier.runtime.module.classpath">
<pathelement location="${applescriptifier.testoutput.dir}"/>
<pathelement location="${applescriptifier.output.dir}"/>
<pathelement location="/System/Library/Java/Extensions/dns_sd.jar"/>
<path refid="library.aslib.classpath"/>
<pathelement location="${basedir}/resources"/>
</path>
<patternset id="excluded.from.module.applescriptifier">
<patternset refid="ignored.files"/>
</patternset>
<patternset id="excluded.from.compilation.applescriptifier">
<patternset refid="excluded.from.module.applescriptifier"/>
</patternset>
<path id="applescriptifier.module.sourcepath">
<dirset dir="${module.applescriptifier.basedir}">
<include name="src"/>
</dirset>
</path>
<target name="compile.module.applescriptifier"
depends="compile.module.applescriptifier.production.scala, compile.module.applescriptifier.tests"
description="Compile module applescriptifier"/>
<taskdef resource="scala/tools/ant/antlib.xml">
<classpath>
<pathelement location="lib-dev/scala/scala-compiler.jar"/>
<pathelement location="lib/scala-library.jar"/>
</classpath>
</taskdef>
<target name="compile.module.applescriptifier.production.scala">
<mkdir dir="${applescriptifier.output.dir}"/>
<scalac srcref="applescriptifier.module.sourcepath"
destdir="${applescriptifier.output.dir}"
classpathref="applescriptifier.module.production.classpath"/>
</target>
<target name="compile.module.applescriptifier.production" depends="compile.module.applescriptifier.production.scala"
description="Compile module applescriptifier; production classes">
<mkdir dir="${applescriptifier.output.dir}"/>
<javac destdir="${applescriptifier.output.dir}" debug="${compiler.debug}" target="1.6" srcdir="src"
nowarn="${compiler.generate.no.warnings}" memorymaximumsize="${compiler.max.memory}" fork="true">
<compilerarg line="${compiler.args.applescriptifier}"/>
<!--<bootclasspath refid="applescriptifier.module.bootclasspath"/>-->
<classpath refid="applescriptifier.module.production.classpath"/>
<src refid="applescriptifier.module.sourcepath"/>
<patternset refid="excluded.from.compilation.applescriptifier"/>
</javac>
<copy todir="${applescriptifier.output.dir}">
<fileset dir="${module.applescriptifier.basedir}/src">
<patternset refid="compiler.resources"/>
<type type="file"/>
</fileset>
</copy>
</target>
<target name="compile.module.applescriptifier.tests" depends="compile.module.applescriptifier.production"
description="compile module applescriptifier; test classes" unless="skip.tests"/>
<target name="clean.module.applescriptifier" description="cleanup module">
<delete dir="${applescriptifier.output.dir}"/>
<delete dir="${applescriptifier.testoutput.dir}"/>
<delete dir="${applescriptifier.release.dir}" followsymlinks="false" removenotfollowedsymlinks="true"/>
<delete dir="${applescriptifier.release.dir}/Muse Controller.app"/>
</target>
<target name="jar" depends="compile.module.applescriptifier">
<jar basedir="${applescriptifier.output.dir}" jarfile="applescriptifier.jar">
<fileset dir="resources"/>
<fileset dir="icons"/>
</jar>
</target>
<taskdef name="jarbundler" classname="net.sourceforge.jarbundler.JarBundler">
<classpath refid="library.aslib.classpath"/>
</taskdef>
<target name="bundle" depends="jar">
<mkdir dir="release"/>
<jarbundler dir="release"
name="Muse Controller"
mainclass="com.sleazyweasel.applescriptifier.ScalaMain"
icon="icons/AppIcon.icns"
bundleid="com.sleazyweasel.MuseController"
build="${BUILD_NUMBER}"
version="${BUILD_NUMBER}"
jvmversion="1.6+"
>
<jarfilelist id="mainjar" dir="." files="applescriptifier.jar"/>
<jarfileset dir="lib"/>
<javaproperty name="apple.laf.useScreenMenuBar" value="true"/>
<javafileset dir="icons"/>
</jarbundler>
</target>
<target name="bundle-and-sign" depends="bundle-sparkle">
<exec executable="codesign">
<arg value="-f"/>
<arg value="-s"/>
<arg value="John Watson Code Signing"/>
<arg value="release/Muse Controller.app/Contents/Frameworks/Sparkle.framework/Versions/A"/>
</exec>
<exec executable="codesign">
<arg value="-f"/>
<arg value="-s"/>
<arg value="John Watson Code Signing"/>
<arg value="release/Muse Controller.app"/>
</exec>
</target>
<!-- Create a MacOSX application package with Sparkle support,
invoked with "ant macosx-sparkle" -->
<target name="bundle-sparkle" depends="bundle"
description="Create an .app package for MacOSX with Sparkle support">
<!-- This property is set to the path where are the
Sparkle framework will be stored inside the package.
You should not need to change it -->
<property name="sparkle.path"
value="Contents/Frameworks/Sparkle.framework"/>
<!-- Create the native library directory in the package -->
<mkdir dir="${macosx.app}/${app.name}.app/${app.internal}/${app.native}"/>
<!-- Add the Sparkle bundle and JNI to the application package -->
<!--<copy file="${app.resrc}/sparkle.jar"-->
<!--todir="${macosx.app}/${app.name}.app/${app.internal}/${app.resrc}"/>-->
<!--<copy file="${app.native}/libsparkle_init.dylib" todir="${macosx.app}/${app.name}.app/${app.internal}/${app.native}"/>-->
<copy file="${app.native}/libsparkle_init.dylib" todir="${macosx.app}/${app.name}.app/${app.internal}/"/>
<!-- Add the public key file to the application bundle -->
<copy file="${app.resrc}/dsa_pub.pem"
todir="${macosx.app}/${app.name}.app/Contents/Resources/"/>
<!-- The Info.plist file inside the .app package must be updated
with several Sparkle properties. Set the SUFeedURL property
to the URL where your appcast XML file is located -->
<replace file="${macosx.app}/${app.name}.app/Contents/Info.plist">
<replacetoken><![CDATA[<key>CFBundleName</key>]]></replacetoken>
<replacevalue><![CDATA[<key>SUCheckAtStartup</key>
<string>YES</string>
<key>SUScheduledCheckInterval</key>
<string>86400</string>
<key>SUPublicDSAKeyFile</key>
<string>dsa_pub.pem</string>
<key>SUFeedURL</key>
<string>http://downloads.musecontrol.com/appcast.xml</string>
<key>SUShowReleaseNotes</key>
<string>YES</string>
<key>CFBundleName</key>]]></replacevalue>
</replace>
<!-- The Sparkle Framework must also be copied in the
application package -->
<mkdir dir="${macosx.app}/${app.name}.app/Contents/Frameworks"/>
<unzip src="${app.resrc}/Sparkle.framework.zip"
dest="${macosx.app}/${app.name}.app/Contents/Frameworks"/>
<delete file="${macosx.app}/${app.name}.app/${sparkle.path}/Versions/Current"/>
<delete file="${macosx.app}/${app.name}.app/${sparkle.path}/Headers"/>
<delete file="${macosx.app}/${app.name}.app/${sparkle.path}/Resources"/>
<delete file="${macosx.app}/${app.name}.app/${sparkle.path}/Sparkle"/>
<delete dir="${macosx.app}/${app.name}.app/Contents/Frameworks/__MACOSX"/>
<!-- The Ant unzip task does not preserve symlinks, so we
recreate them -->
<symlink link="${macosx.app}/${app.name}.app/${sparkle.path}/Versions/Current"
resource="./A"/>
<symlink
link="${macosx.app}/${app.name}.app/${sparkle.path}/Headers"
resource="./Versions/Current/Headers"/>
<symlink
link="${macosx.app}/${app.name}.app/${sparkle.path}/Resources"
resource="./Versions/Current/Resources"/>
<symlink
link="${macosx.app}/${app.name}.app/${sparkle.path}/Sparkle"
resource="./Versions/Current/Sparkle"/>
<!--<symlink-->
<!--link="${macosx.app}/${app.name}.app/${sparkle.path}/Resources/fr_CA.lproj"-->
<!--resource="./fr.lproj"/>-->
<!-- Restore the file permissions to the Sparkle relaunch tool -->
<chmod file="${macosx.app}/${app.name}.app/${sparkle.path}/Resources/relaunch" perm="ugo+rx">
</chmod>
</target>
</project>