-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
366 lines (352 loc) · 12.3 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
361
362
363
364
365
366
<project name="songtickerli" default="test"
description="This buildfile is responsiblle for running tests and publishing songtickerli.">
<property file="build.properties"/>
<!-- -->
<taskdef name="sync" classname="phing.tasks.ext.FileSyncTask" />
<target name="test">
<!-- not implemented :( too late now -->
</target>
<target name="stage" depends="build">
<copy todir="_site" overwrite="true">
<fileset dir="work/">
<include name="index.html"/>
<include name="demo.html"/>
<include name="ticker.php"/>
<include name="rabe.js"/>
<include name="jquery.min.js"/>
<include name="jquery.json.min.js"/>
<include name="jquery.jstore-all-min.js"/>
<include name="jquery.simplemodal.1.4.2.min.js"/>
<include name="copyright.html"/>
<include name="add_artist.html"/>
<include name="*.ico"/>
<include name="*.xml"/>
<include name="songtickerli.js"/>
<include name="fb_xd_receiver.html"/>
<include name="facebook/*"/>
<include name="opensocial/"/>
<!-- jstore support for oldish platforms -->
<include name="jStore.Flash.html"/>
<include name="jStore.swf"/>
</fileset>
<fileset dir=".">
<include name="LICENSE"/>
</fileset>
</copy>
</target>
<target name="build" depends="jquery,jquery-json,jquery-jstore,jquery-simplemodal,fbconnect,fbapp,artistdb,images">
<copy todir="work/" overwrite="true">
<fileset dir="htdocs/">
<include name="*.css"/>
</fileset>
<filterchain>
<striplinebreaks/>
</filterchain>
</copy>
<copy todir="work/" overwrite="true">
<fileset dir="htdocs/">
<include name="*.png"/>
<include name="ticker.php"/>
</fileset>
</copy>
<copy todir="work/" overwrite="true">
<fileset dir="htdocs">
<include name="*.js"/>
<exclude name="songtickerli.js"/>
</fileset>
<filterchain>
<filterreader classname="phing.filters.ReplaceTokensWithFile">
<param name="dir" value="work/"/>
<param name="begintoken" value="png_token[[["/>
<param name="endtoken" value="]]]"/>
<param name="prefix" value=""/>
<param name="postfix" value=".png.txt" />
<param name="translatehtml" value="false"/>
</filterreader>
<!--
<filterreader classname="phing.filters.JSPackerFilter">
<param name="encoding" value="Numeric"/>
<param name="fastDecode" value="false"/>
<param name="specialCharacters" value="false"/>
</filterreader>
-->
</filterchain>
</copy>
<copy todir="work/" overwrite="true">
<fileset dir="work">
<include name="artistdb.js"/>
</fileset>
</copy>
<copy todir="work/" overwrite="true">
<fileset dir=".">
<include name="README"/>
</fileset>
</copy>
<exec command="sed --in-place -f scripts/strip_html.sed work/index.html"/>
<exec command="echo '<!--' > work/README.html.txt"/>
<exec command="cat work/README >> work/README.html.txt"/>
<exec command="echo '-->' >> work/README.html.txt"/>
<exec command="cat work/README > work/README.txt"/>
<copy todir="work/" overwrite="true">
<fileset dir="htdocs/">
<include name="*.html"/>
</fileset>
<filterchain>
<filterreader classname="phing.filters.ReplaceTokensWithFile">
<param name="dir" value="work/"/>
<param name="begintoken" value="css_token{"/>
<param name="endtoken" value="}"/>
<param name="prefix" value=""/>
<param name="postfix" value=".css" />
<param name="translatehtml" value="false"/>
</filterreader>
<filterreader classname="phing.filters.ReplaceTokensWithFile">
<param name="dir" value="work/"/>
<param name="begintoken" value="script_token[[["/>
<param name="endtoken" value="]]]"/>
<param name="prefix" value=""/>
<param name="postfix" value=".js" />
<param name="translatehtml" value="false"/>
</filterreader>
<filterreader classname="phing.filters.ReplaceTokensWithFile">
<param name="dir" value="work/"/>
<param name="begintoken" value="png_token[[["/>
<param name="endtoken" value="]]]"/>
<param name="prefix" value=""/>
<param name="postfix" value=".png.txt" />
<param name="translatehtml" value="false"/>
</filterreader>
<filterreader classname="phing.filters.ReplaceTokensWithFile">
<param name="dir" value="work/"/>
<param name="begintoken" value="text_token[[["/>
<param name="endtoken" value="]]]"/>
<param name="prefix" value=""/>
<param name="postfix" value=".txt" />
<param name="translatehtml" value="false"/>
</filterreader>
</filterchain>
</copy>
</target>
<!--
<target name="flxhr">
<untar file="packages/flXHR-1.0.5.tar.gz" todir="temp/"/>
<copy todir="work/flensed" overwrite="true">
<fileset dir="temp/flensed-1.0/deploy">
<include name="*"/>
</fileset>
</copy>
</target>
<target name="jxhr">
<unzip file="packages/jXHR-0.1.zip" todir="temp/"/>
<copy todir="work/jxhr" overwrite="true">
<fileset dir="temp/">
<include name="*min.js"/>
</fileset>
</copy>
</target>
-->
<target name="jquery">
<copy todir="work" overwrite="true">
<fileset dir="../jquery/dist/">
<include name="*.js"/>
</fileset>
<!--
<filterchain>
<filterreader classname="phing.filters.JSPackerFilter">
<param name="encoding" value="Normal"/>
<param name="fastDecode" value="true"/>
<param name="specialCharacters" value="false"/>
</filterreader>
</filterchain>
-->
</copy>
</target>
<target name="jquery-json">
<copy todir="work" overwrite="true">
<fileset dir="../jquery-json/src">
<include name="*.js"/>
</fileset>
<!--
<filterchain>
<filterreader classname="phing.filters.JSPackerFilter">
<param name="encoding" value="Normal"/>
<param name="fastDecode" value="true"/>
<param name="specialCharacters" value="false"/>
</filterreader>
</filterchain>
-->
</copy>
</target>
<target name="jquery-jstore">
<exec command="wget http://jquery-jstore.googlecode.com/files/jStore-1.2.0-production.tar.gz -O work/jStore-1.2.0-production.tar.gz"/>
<exec command="tar zxvf work/jStore-1.2.0-production.tar.gz -C work"/>
<!--
<copy tofile="work/jquery.jstore.js" file="../jquery-jstore/src/class.js" overwrite="true"/>
<filterchain>
<filterreader classname="phing.filters.JSPackerFilter">
<param name="encoding" value="Normal"/>
<param name="fastDecode" value="true"/>
<param name="specialCharacters" value="false"/>
</filterreader>
</filterchain>
<append destFile="work/jquery.jstore.js">
<fileset dir="../jquery-jstore/src/">
<include name="jquery.jstore.js"/>
</fileset>
</append>
-->
</target>
<target name="jquery-simplemodal">
<copy todir="work" overwrite="true">
<fileset dir="../jquery-simplemodal/simplemodal/dist/">
<include name="*.js"/>
</fileset>
</copy>
</target>
<target name="fbconnect">
</target>
<target name="fbapp">
<copy todir="work/facebook" overwrite="true">
<fileset dir="htdocs/facebook">
<include name="index.html"/>
</fileset>
<filterchain>
<filterreader classname="phing.filters.ReplaceTokensWithFile">
<param name="dir" value="work/"/>
<param name="begintoken" value="png_token[[["/>
<param name="endtoken" value="]]]"/>
<param name="prefix" value=""/>
<param name="postfix" value=".png.txt" />
<param name="translatehtml" value="false"/>
</filterreader>
</filterchain>
</copy>
</target>
<target name="artistdb">
<exec command="wget '${artistdb.couchview}' -O work/artistdb-raw.js"/>
<exec command="php scripts/couch2plain.php > work/artistdb-plain.js"/>
<move file="work/artistdb-plain.js" tofile="work/artistdb.js">
<filterchain>
<filterreader classname="phing.filters.JSPackerFilter">
<param name="encoding" value="Normal"/>
<param name="fastDecode" value="true"/>
<param name="specialCharacters" value="false"/>
</filterreader>
</filterchain>
</move>
<exec command="tail -n +2 work/artistdb.csv | wc -l > work/artistdb.count.txt "/>
</target>
<target name="images">
<property name="source" value=""/>
<property name="resize" value=""/>
<phingcall target="convert_image">
<property name="file" value="logo_rabe_mono"/>
<property name="resize" value="111x150"/>
</phingcall>
<phingcall target="convert_image">
<property name="file" value="logo_rabe_blau"/>
<property name="resize" value="111x150"/>
</phingcall>
<phingcall target="convert_image">
<property name="file" value="logo_rabe_gruen_weiss"/>
<property name="resize" value="111x150"/>
</phingcall>
<phingcall target="convert_image">
<property name="file" value="logo_rabe_orange_weiss"/>
<property name="resize" value="111x150"/>
</phingcall>
<phingcall target="convert_image">
<property name="file" value="logo_rabe_rot_weiss"/>
<property name="resize" value="111x150"/>
</phingcall>
<phingcall target="convert_image">
<property name="file" value="website_logo_64"/>
</phingcall>
<phingcall target="convert_image">
<property name="file" value="wikipedia_logo_64"/>
</phingcall>
<phingcall target="convert_image">
<property name="source" value="lastfm_64_0.png"/>
<property name="file" value="lastfm_logo_64"/>
</phingcall>
<phingcall target="convert_image">
<property name="source" value="myspace_64_0.png"/>
<property name="file" value="myspace_logo_64"/>
</phingcall>
<phingcall target="convert_image">
<property name="source" value="facebook_64_0.png"/>
<property name="file" value="facebook_logo_64"/>
</phingcall>
<phingcall target="convert_image">
<property name="source" value="twitter_64_0.png"/>
<property name="file" value="twitter_logo_64"/>
</phingcall>
<phingcall target="convert_image">
<property name="source" value="discogs_64_0.png"/>
<property name="file" value="discogs_logo_64"/>
</phingcall>
<phingcall target="convert_image">
<property name="source" value="youtube_64_0.png"/>
<property name="file" value="youtube_logo_64"/>
</phingcall>
<phingcall target="convert_image">
<property name="file" value="facebook_connect"/>
</phingcall>
<phingcall target="convert_image">
<property name="file" value="herz"/>
</phingcall>
<phingcall target="convert_image">
<property name="file" value="info"/>
</phingcall>
<phingcall target="convert_image">
<property name="file" value="gear"/>
</phingcall>
<phingcall target="convert_image">
<property name="file" value="hist"/>
</phingcall>
<phingcall target="convert_image">
<property name="file" value="initial_info_overlay_songtickerli"/>
</phingcall>
</target>
<target name="convert_image">
<if>
<equals arg1="${source}" arg2=""/>
<then/>
<else>
<exec command="unzip -u packages/find_me_on_icons_style_0.zip 'style 0/${source}'"/>
<exec command="mv 'style 0/${source}' work/${file}.png" />
</else>
</if>
<if>
<equals arg1="${resize}" arg2=""/>
<then/>
<else>
<exec command="convert -transparent white -resize ${resize} packages/rabe/${file}.jpg work/${file}.png"/>
</else>
</if>
<exec command="base64 -w 0 work/${file}.png > work/${file}.png.txt"/>
</target>
<target name="build-lib-tarball" depends="stage">
<exec command="sh build.libjs.sh > _site/rabe.lib.js && mv _site/rabe.lib.js _site/rabe.js"/>
<tar destfile="rabe-songticker-${build.version}.tar.gz" compression="gzip" basedir="_site" prefix="rabe-songticker-${build.version}">
<fileset dir="_site/">
<include name="LICENSE"/>
<include name="rabe.js"/>
<include name="jquery.min.js"/>
<include name="jquery.json.min.js"/>
<include name="demo.html"/>
<include name="ticker.php"/>
</fileset>
</tar>
</target>
<target name="publish" depends="stage">
<!-- takes the current checkout and uses the FileSyncTask from my portage overlay
to publish it to a location defined in build.properties -->
<sync sourcedir="_site/"
destinationdir="${publish.destination}htdocs/"
excludefile="build.publish.exclude"
listonly="false"
verbose="true"
delete="true"/>
</target>
</project>