forked from MarcoFleres/tinyMediaManager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathant-package.xml
333 lines (302 loc) · 13.6 KB
/
ant-package.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
<project name="Tiny Media Manager">
<!-- build directories -->
<property name="build.dir" value="target/ant" />
<property name="lib.dir" value="${build.dir}/lib" />
<property name="dist.dir" value="target/dist" />
<!-- set as property to override in jenkins -->
<property name="getdown" value="getdown.txt" />
<path id="classpath.default">
<fileset dir="${lib.dir}">
<include name="*.jar" />
</fileset>
</path>
<target name="setNightly" if="nightly">
<property name="rev" value="nightly" />
</target>
<target name="setPreRelease" if="prerelease">
<property name="rev" value="prerelease" />
</target>
<target name="downloadLocale">
<get src="https://www.transifex.com/api/2/project/tinymediamanager/resource/messagesproperties/translation/${lang}/?file" dest="locale/messages_${lang}.properties" username="tmm" password="tmm" ignoreerrors="true" />
</target>
<target name="downloadLocales">
<!--<antcall target="downloadLocale"><param name="lang" value="ar_SA" /></antcall>-->
<!--<antcall target="downloadLocale"><param name="lang" value="ca" /></antcall>-->
<antcall target="downloadLocale">
<param name="lang" value="cs" />
</antcall>
<antcall target="downloadLocale">
<param name="lang" value="da" />
</antcall>
<antcall target="downloadLocale">
<param name="lang" value="de" />
</antcall>
<antcall target="downloadLocale">
<param name="lang" value="es" />
</antcall>
<antcall target="downloadLocale">
<param name="lang" value="el" />
</antcall>
<!--<antcall target="downloadLocale"><param name="lang" value="fa" /></antcall>-->
<antcall target="downloadLocale">
<param name="lang" value="fr" />
</antcall>
<antcall target="downloadLocale">
<param name="lang" value="hu" />
</antcall>
<antcall target="downloadLocale">
<param name="lang" value="it" />
</antcall>
<antcall target="downloadLocale">
<param name="lang" value="ko" />
</antcall>
<antcall target="downloadLocale">
<param name="lang" value="nl" />
</antcall>
<antcall target="downloadLocale">
<param name="lang" value="no" />
</antcall>
<antcall target="downloadLocale">
<param name="lang" value="pl" />
</antcall>
<antcall target="downloadLocale">
<param name="lang" value="pt" />
</antcall>
<antcall target="downloadLocale">
<param name="lang" value="pt_BR" />
</antcall>
<antcall target="downloadLocale">
<param name="lang" value="ru" />
</antcall>
<!--<antcall target="downloadLocale"><param name="lang" value="ro"/></antcall>-->
<antcall target="downloadLocale">
<param name="lang" value="sk" />
</antcall>
<antcall target="downloadLocale">
<param name="lang" value="sv" />
</antcall>
<!--<antcall target="downloadLocale"><param name="lang" value="tk" /></antcall>-->
<antcall target="downloadLocale">
<param name="lang" value="tr" />
</antcall>
<antcall target="downloadLocale">
<param name="lang" value="vi" />
</antcall>
<!--<antcall target="downloadLocale"><param name="lang" value="uk" /></antcall>-->
<antcall target="downloadLocale">
<param name="lang" value="zh" />
</antcall>
</target>
<target name="package-app" description="builds the packages" depends="setNightly, setPreRelease, downloadLocales">
<delete dir="${build.dir}" />
<mkdir dir="${build.dir}" />
<delete dir="${dist.dir}" />
<mkdir dir="${dist.dir}/win" />
<!-- set SVN revision here - is not set anymore since nightly/prerel -->
<!-- Only works, if rev is not set to nightly/prerel - so should be fine for release build -->
<echo message="Rev: ${rev}" />
<property name="rev" value="${tmmRevision}" />
<echo message="Rev: ${rev}" />
<!-- buildinfo -->
<propertyfile file="${build.dir}/version" comment="This file is automatically generated - DO NOT EDIT">
<entry key="version" value="${tmmVersion}" />
<entry key="build" value="${rev}" />
<entry key="date" value="${tmmTimestamp}" />
</propertyfile>
<!-- ===================================================== -->
<!-- default files, to include in DIST and GD -->
<!-- ===================================================== -->
<copy file="changelog.txt" todir="${build.dir}" />
<copy file="AppBundler/${getdown}" tofile="${build.dir}/getdown.txt" />
<copy file="LICENSE" todir="${build.dir}" />
<copy file="AppBundler/splashscreen.png" todir="${build.dir}" />
<copy file="AppBundler/tmm.png" todir="${build.dir}" />
<copy file="AppBundler/env.txt" todir="${build.dir}" />
<copy file="target/${tmmName}-${tmmVersion}.jar" tofile="${build.dir}/tmm.jar" />
<copy todir="${build.dir}/native">
<fileset dir="native" />
</copy>
<copy todir="${build.dir}/templates">
<fileset dir="templates" />
</copy>
<copy todir="${build.dir}/locale">
<fileset dir="locale" />
</copy>
<copy todir="${build.dir}/lib">
<fileset dir="target/dependency" />
</copy>
<copy todir="${build.dir}/plugins">
<fileset dir="target/dependency-plugins" />
</copy>
<!-- ===================================================== -->
<!-- replace classpath -->
<!-- ===================================================== -->
<pathconvert property="gd.code" refid="classpath.default" pathsep="">
<mapper>
<chainedmapper>
<flattenmapper />
<!-- remove absolute path -->
<!-- add GD + lib/ prefix + newline ;) -->
<globmapper from="*" to="code = lib/*${line.separator}" />
</chainedmapper>
</mapper>
</pathconvert>
<!--echo message="${gd.code}" /-->
<replace file="${build.dir}/getdown.txt" token="%CODELIBS%" value="${gd.code}" />
<!-- ===================================================== -->
<!-- replace message properties -->
<!-- ===================================================== -->
<pathconvert property="gd.locale" pathsep="">
<mapper>
<chainedmapper>
<flattenmapper />
<globmapper from="*" to="resource = locale/*${line.separator}" />
</chainedmapper>
</mapper>
<path>
<fileset dir="locale">
<include name="**/*.properties" />
</fileset>
</path>
</pathconvert>
<!-- echo message="${gd.locale}" /-->
<replace file="${build.dir}/getdown.txt" token="%LOCALES%" value="${gd.locale}" />
<!-- ===================================================== -->
<!-- replace plugins -->
<!-- ===================================================== -->
<pathconvert property="gd.plugins" pathsep="">
<mapper>
<chainedmapper>
<flattenmapper />
<globmapper from="*" to="resource = plugins/*${line.separator}" />
</chainedmapper>
</mapper>
<path>
<fileset dir="${build.dir}/plugins">
<include name="*.jar" />
</fileset>
</path>
</pathconvert>
<!-- echo message="${gd.plugins}" /-->
<replace file="${build.dir}/getdown.txt" token="%PLUGINS%" value="${gd.plugins}" />
<!-- ===================================================== -->
<!-- prepare build for MacOS X -->
<!-- ===================================================== -->
<copy todir="${dist.dir}/mac/tinyMediaManager.app/Contents">
<fileset dir="AppBundler/dist-mac" />
</copy>
<replace file="${dist.dir}/mac/tinyMediaManager.app/Contents/Info.plist" token="%VERSION%" value="${tmmVersion}" />
<replace file="${dist.dir}/mac/tinyMediaManager.app/Contents/Info.plist" token="%SVNREV%" value="${tmmRevision}" />
<chmod file="${dist.dir}/mac/tinyMediaManager.app/Contents/MacOS/JavaApplicationStub" perm="ugo+rx" />
<chmod file="${dist.dir}/mac/tinyMediaManager.app/Contents/Resources/Java/tinyMediaManagerOSX.sh" perm="ugo+rx" />
<copy todir="${dist.dir}/mac/tinyMediaManager.app/Contents/Resources/Java/">
<fileset dir="${build.dir}">
<include name="**/*" />
<exclude name="native/windows*/**" />
<exclude name="native/linux*/**" />
</fileset>
</copy>
<copy file="AppBundler/getdown.jar" todir="${dist.dir}/mac/tinyMediaManager.app/Contents/Resources/Java/" />
<!-- ===================================================== -->
<!-- prepare build for Windows -->
<!-- ===================================================== -->
<taskdef name="launch4j" classname="net.sf.launch4j.ant.Launch4jTask" classpath="AppBundler/launch4j/launch4j.jar:AppBundler/launch4j/lib/xstream.jar" />
<launch4j configFile="./AppBundler/launch4j.xml" txtProductVersion="${tmmVersion}_${tmmRevision}" outfile="${dist.dir}/win/tinyMediaManager.exe" />
<launch4j configFile="./AppBundler/launch4jUpdater.xml" txtProductVersion="${tmmVersion}_${tmmRevision}" outfile="${dist.dir}/win/tinyMediaManagerUpd.exe" />
<launch4j configFile="./AppBundler/launch4jcmd.xml" txtProductVersion="${tmmVersion}_${tmmRevision}" outfile="${dist.dir}/win/tinyMediaManagerCMD.exe" />
<copy todir="${dist.dir}/win">
<fileset dir="${build.dir}">
<include name="**/*" />
<exclude name="native/mac*/**" />
<exclude name="native/linux*/**" />
</fileset>
</copy>
<copy file="AppBundler/getdown.jar" todir="${dist.dir}/win" />
<!-- ===================================================== -->
<!-- prepare build for Linux -->
<!-- ===================================================== -->
<copy todir="${dist.dir}/linux">
<fileset dir="AppBundler/dist-linux" />
</copy>
<chmod file="${dist.dir}/linux/tinyMediaManager.sh" perm="ugo+rx" />
<chmod file="${dist.dir}/linux/tinyMediaManagerUpdater.sh" perm="ugo+rx" />
<chmod file="${dist.dir}/linux/tinyMediaManagerCMD.sh" perm="ugo+rx" />
<copy todir="${dist.dir}/linux">
<fileset dir="${build.dir}">
<include name="**/*" />
<exclude name="native/mac*/**" />
<exclude name="native/windows*/**" />
</fileset>
</copy>
<copy file="AppBundler/getdown.jar" todir="${dist.dir}/linux" />
<!-- ===================================================== -->
<!-- default files, NOT to include in DIST, but in GD -->
<!-- ===================================================== -->
<copy file="${dist.dir}/win/tinyMediaManager.exe" tofile="${build.dir}/tinyMediaManager.new" />
<copy file="${dist.dir}/win/tinyMediaManagerUpd.exe" tofile="${build.dir}/tinyMediaManagerUpd.new" />
<copy file="${dist.dir}/win/tinyMediaManagerCMD.exe" tofile="${build.dir}/tinyMediaManagerCMD.new" />
<copy file="${dist.dir}/linux/tinyMediaManager.sh" todir="${build.dir}" />
<copy file="${dist.dir}/linux/tinyMediaManagerUpdater.sh" todir="${build.dir}" />
<copy file="${dist.dir}/linux/tinyMediaManagerCMD.sh" todir="${build.dir}" />
<copy file="${dist.dir}/mac/tinyMediaManager.app/Contents/Resources/Java/tinyMediaManagerOSX.sh" todir="${build.dir}" />
<copy file="${dist.dir}/mac/tinyMediaManager.app/Contents/MacOS/JavaApplicationStub" tofile="${build.dir}/JavaApplicationStub.new" />
<copy file="${dist.dir}/mac/tinyMediaManager.app/Contents/Info.plist" todir="${build.dir}" />
<copy file="AppBundler/getdown.jar" tofile="${build.dir}/getdown-new.jar" />
<!-- create webstart file (currently w/o plugins) -->
<copy file="AppBundler/webstart.php" tofile="${build.dir}/webstart.php" />
<pathconvert property="webstart" refid="classpath.default" pathsep="">
<mapper>
<chainedmapper>
<flattenmapper />
<globmapper from="*" to=" <jar href="lib/*" />${line.separator}" />
</chainedmapper>
</mapper>
</pathconvert>
<!-- echo message="${webstart}" /-->
<replace file="${build.dir}/webstart.php" token="%WEBSTARTLIBS%" value="${webstart}" />
<!-- finally create checksums -->
<taskdef name="digest" classname="com.threerings.getdown.tools.DigesterTask" classpath="AppBundler/getdown.jar" />
<digest appdir="${build.dir}" />
<!-- ===================================================== -->
<!-- package for MacOS X -->
<!-- ===================================================== -->
<copy file="${build.dir}/digest.txt" todir="${dist.dir}/mac/tinyMediaManager.app/Contents/Resources/Java/" />
<zip destfile="${dist.dir}/tmm_${tmmVersion}_${tmmRevision}_mac.zip" level="9">
<zipfileset dir="${dist.dir}/mac" excludes="**/JavaApplicationStub,**/tinyMediaManagerOSX.sh" />
<zipfileset filemode="755" dir="${dist.dir}/mac" includes="**/JavaApplicationStub,**/tinyMediaManagerOSX.sh" />
</zip>
<!-- ===================================================== -->
<!-- package for Windows -->
<!-- ===================================================== -->
<copy file="${build.dir}/digest.txt" todir="${dist.dir}/win" />
<zip destfile="${dist.dir}/tmm_${tmmVersion}_${tmmRevision}_win.zip" level="9">
<zipfileset filemode="755" dir="${dist.dir}/win" />
</zip>
<!-- ===================================================== -->
<!-- package for Linux -->
<!-- ===================================================== -->
<copy file="${build.dir}/digest.txt" todir="${dist.dir}/linux" />
<tar compression="gzip" destfile="${dist.dir}/tmm_${tmmVersion}_${tmmRevision}_linux.tar.gz">
<tarfileset dir="${dist.dir}/linux" excludes="*.sh" />
<tarfileset filemode="755" dir="${dist.dir}/linux" includes="*.sh" />
</tar>
<!-- ===================================================== -->
<!-- create a whole archive of /build for transfer to mirrors -->
<!-- ===================================================== -->
<tar compression="gzip" destfile="${build.dir}/build.tar.gz">
<tarfileset dir="${build.dir}" />
<tarfileset filemode="755" dir="${build.dir}" includes="JavaApplicationStub" />
<tarfileset filemode="755" dir="${build.dir}" includes="*.exe" />
<tarfileset filemode="755" dir="${build.dir}" includes="*.sh" />
</tar>
<!-- done, move build dir -->
<delete dir="build" />
<move file="${build.dir}" tofile="build" />
<!-- cleanup dist -->
<delete dir="dist" />
<delete dir="${dist.dir}/win" />
<delete dir="${dist.dir}/mac" />
<delete dir="${dist.dir}/linux" />
<move file="${dist.dir}" tofile="dist" />
</target>
</project>