-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.xml
357 lines (322 loc) · 12.1 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
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="./ant2html.xsl"?>
<!--
- Copyright (c) 2009 Mark Birbeck
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-->
<project name="backplanejs" default="help" basedir=".">
<description>
Ant project for building and managing the backplanejs library.
</description>
<import file="tools/tools.xml" />
<!--
T A S K S
=========
-->
<target name="jslint">
<description>
Run JSLint on the scripts.
</description>
<jslint options="{ browser: true, devel: true, debug: true, evil: true, laxbreak: true, forin: true, sub: true, css: true, cap: true, on: true, fragment: true }">
<!-- jslint options="{passfail: false, white: false, laxbreak: true, browser: true, debug: false, devel: true, eqeqeq: false, evi: true, fragment: true, immed: false, nomen: false, on: true, onevar: false, plusplus: false, regexp: false, sub: true}" -->
<fileset dir="${src.dir}">
<!-- This collection is the same as in 'tidy-js' -->
<include name="**/*.js" />
<exclude name="_samples/**/*.js" />
<exclude name="build/**/*.js" />
<exclude name="deploy/**/*.js" />
<exclude name="drupal/**/*.js" />
<exclude name="rdfa/_unit-tests/**/*.js" />
<exclude name="smil/**/*.js" />
<exclude name="third-party/uxf/build/**/*.js" />
<exclude name="third-party/uxf/samples/**/*.js" />
<exclude name="third-party/uxf/src/lib/ajaxslt/**/*.js" />
<exclude name="third-party/uxf/src/lib/backplane/_unit-tests/**/*.js" />
<exclude name="third-party/uxf/src/lib/backplane/notify/assets/**/*.js" />
<exclude name="third-party/uxf/src/lib/third-party/**/*.js" />
<exclude name="third-party/uxf/testsuite/**/*.js" />
<exclude name="third-party/uxf/unit-tests/**/*.js" />
<exclude name="third-party/${platform.name}/**/*.js" />
<exclude name="_samples/**/*.js" />
<exclude name="tools/**/*.js" />
</fileset>
</jslint>
</target>
<target name="jslint-deploy">
<description>
Run JSLint on the scripts.
</description>
<jslint options="{ browser: true, devel: true, debug: true, evil: true, laxbreak: true, forin: true, sub: true, css: true, cap: true, on: true, fragment: true }">
<!-- jslint options="{passfail: false, white: false, laxbreak: true, browser: true, debug: false, devel: true, eqeqeq: false, evi: true, fragment: true, immed: false, nomen: false, on: true, onevar: false, plusplus: false, regexp: false, sub: true}" -->
<fileset dir="${deploy.dir}">
<include name="backplane.js" />
</fileset>
</jslint>
</target>
<target name="tidy-js">
<description>
Do some basic tidying up of JS files ready for JSLint.
</description>
<fixcrlf srcdir="${src.dir}" eol="crlf" eof="remove">
<!-- This collection is the same as in 'jslint' -->
<include name="**/*.js" />
<exclude name="_samples/**/*.js" />
<exclude name="build/**/*.js" />
<exclude name="deploy/**/*.js" />
<exclude name="drupal/**/*.js" />
<exclude name="rdfa/_unit-tests/**/*.js" />
<exclude name="smil/**/*.js" />
<exclude name="third-party/uxf/build/**/*.js" />
<exclude name="third-party/uxf/samples/**/*.js" />
<exclude name="third-party/uxf/src/lib/ajaxslt/**/*.js" />
<exclude name="third-party/uxf/src/lib/backplane/notify/assets/**/*.js" />
<exclude name="third-party/uxf/src/lib/backplane/_unit-tests/**/*.js" />
<exclude name="third-party/uxf/src/lib/third-party/**/*.js" />
<exclude name="third-party/uxf/testsuite/**/*.js" />
<exclude name="third-party/uxf/unit-tests/**/*.js" />
<exclude name="third-party/${platform.name}/**/*.js" />
<exclude name="_samples/**/*.js" />
<exclude name="tools/**/*.js" />
</fixcrlf>
</target>
<target name="-prime-deploy" depends="compile, test-compile">
<description>
Create a set of deployment files, for testing or distribution.
</description>
<copy todir="${deploy.dir}" failonerror="true">
<fileset dir="${tmp.dir}">
<include name="${product.name}.js" />
</fileset>
</copy>
<copy todir="${deploy.dir}/assets" failonerror="true">
<fileset dir="${build.dir}/assets" />
<fileset dir="${tmp.dir}">
<include name="${product.name}.css" />
</fileset>
<fileset dir="${tmp.dir}/assets">
<include name="bg-fader.gif" />
<include name="decorator.xml" />
<include name="decorate.htc" />
<include name="instance.htc" />
<include name="onload.xml" />
<include name="select-deselected.png" />
<include name="select-selected.png" />
<include name="select1-deselected.png" />
<include name="select1-selected.png" />
<include name="thumb-n.gif" />
<include name="lens/*" />
</fileset>
</copy>
</target>
<target name="-min-css" depends="-prime-deploy">
<description>
Minify the CSS file.
</description>
<java
classname="com.yahoo.platform.yui.compressor.YUICompressor"
classpathref="ant.tasks.classpath"
fork="true"
failonerror="true"
>
<arg value="-o" />
<arg value="${deploy.dir}/assets/${product.name}-min.css" />
<arg value="${deploy.dir}/assets/${product.name}.css" />
</java>
<!--
Browsers seem to be unable to use the compressed CSS file, so as
a temporary workaround we just copy the uncompressed file back over
the compressed one.
See issue 8.
-->
<copy
file="${deploy.dir}/assets/${product.name}.css"
tofile="${deploy.dir}/assets/${product.name}-min.css"
failonerror="true"
overwrite="true"
/>
</target>
<target name="-min-js" depends="-prime-deploy">
<description>
Minify the JS file.
</description>
<java
classname="com.yahoo.platform.yui.compressor.YUICompressor"
classpathref="ant.tasks.classpath"
fork="true"
failonerror="true"
>
<arg value="-o" />
<arg value="${deploy.dir}/${product.name}-min.js" />
<arg value="${deploy.dir}/${product.name}.js" />
</java>
</target>
<target name="create-drupal-package">
<tar destfile="${drupal.output.dir}/${drupal.package.name}.tar">
<tarfileset dir="${drupal.dir}" prefix="${drupal.package.name}/" preserveLeadingSlashes="true" />
</tar>
<gzip destfile="${deploy.root.dir}/drupal/${drupal.package.name}.tar.gz" src="${drupal.output.dir}/${drupal.package.name}.tar"/>
</target>
<target name="release-drupal" depends="create-drupal-package">
<description>
Create a Drupal release by uploading the package to Google Code.
</description>
<fail unless="gc.username" message="Missing property 'gc.username' from file 'my.ant.properties'." />
<fail unless="gc.password" message="Missing property 'gc.password' from file 'my.ant.properties'." />
<gcupload
username="${gc.username}"
password="${gc.password}"
projectname="${project.name}"
filename="${deploy.root.dir}/drupal/${drupal.package.name}.tar.gz"
targetfilename="${drupal.package.name}.tar.gz"
summary="${project.name} Drupal module, version ${drupal.version.number}"
labels="Type-Archive, OpSys-All"
/>
</target>
<target name="-copy-testsuite-to-local-app-engine">
<copy todir="${deploy.root.dir}/testsuite" failonerror="true">
<fileset dir="${third-party.dir}/uxf/testsuite" />
</copy>
<replace dir="${deploy.root.dir}/testsuite"
token="/src/ubiquity-loader.js" value="${runtime.js.path}"
>
<include name="**/*.xhtml"/>
<include name="**/*.html"/>
</replace>
<replace dir="${deploy.root.dir}/testsuite/xforms" token="../../xforms/html" value="html" />
</target>
<!--
C A L L B A C K S
=================
-->
<target name="pre-site" description="Executes processes needed prior to the actual project site generation.">
<copy todir="${tmp.dir}/site-in/docs" failonerror="true" filtering="true">
<fileset dir="${rdfa.src.dir}" />
</copy>
</target>
<target
name="post-site"
description="Executes processes needed to finalize the site generation, and to prepare for site deployment."
>
<copy todir="${tmp.dir}/site-out/samples" failonerror="true">
<fileset dir="_samples" />
</copy>
<replace dir="${tmp.dir}/site-out/samples" token="../../deploy/backplanejs" value="/backplanejs">
<include name="**/*.html"/>
</replace>
</target>
<target name="-compile" description="Create combined JS and CSS files from sources.">
<!--
Created a combined JS file.
-->
<exec executable="${sprocketize.app.name}" output="${tmp.dir}/${product.name}.js" failonerror="true" logError="true">
<arg value="-I" />
<arg value="." />
<arg value="-I" />
<arg value="build" />
<arg value="-I" />
<arg value="third-party" />
<arg value="-I" />
<arg value="third-party/uxf/src" />
<arg value="-I" />
<arg value="third-party/uxf/src/lib" />
<arg value="-I" />
<arg value="third-party/uxf/src/lib/backplane" />
<arg value="copyright.txt" />
<arg value="${build.dir}/platform-${platform.name}.js" />
<arg value="${build.dir}/platform-ui-${platform.name}.js" />
<arg value="${build.dir}/${product.name}.js" />
<arg value="-a${output.dir}/assets" />
</exec>
<copy file="${tmp.dir}/${product.name}.js" tofile="${output.dir}/${product.name}.js" failonerror="true" filtering="true" />
<!--
Created a combined CSS file.
-->
<concat destfile="${output.dir}/assets/${product.name}.css" force="no" eol="crlf">
<fileset dir="${output.dir}/assets">
<include name="**/*.css" />
<exclude name="lens/*.css" />
<exclude name="${product.name}.css" />
</fileset>
</concat>
</target>
<target name="unit-test-compile">
<description>
Create the unit test files, by concatenating the individual
unit tests.
</description>
<!--
YUI Unit Test Runner
-->
<concat destfile="${unit-tests.dir}/unit-test-runner.js" eol="crlf">
<fileset dir="${src.dir}/third-party/yui">
<include name="yuitest.js" />
</fileset>
<fileset dir="${build.dir}/test">
<include name="unit-test-runner.js" />
</fileset>
</concat>
<!--
Backplane
-->
<concat destfile="${unit-tests.dir}/backplane/unit-tests.js" force="yes" eol="crlf">
<fileset dir="${src.dir}/third-party/uxf/src/lib/backplane/_unit-tests">
<include name="**/*.js" />
<exclude name="**/ut-dom3ls.js" />
<exclude name="**/ut-file.js" />
<exclude name="**/ut-fileio.js" />
<exclude name="**/ut-scheme-handler.js" />
</fileset>
<fileset dir="${src.dir}/third-party/uxf/src/lib/backplane/dom">
<include name="**/ut-*.js" />
</fileset>
</concat>
<copy file="${build.dir}/test/unit.html" tofile="${unit-tests.dir}/backplane/main.html" failonerror="true" />
<!--
Knowledgebase
-->
<concat destfile="${unit-tests.dir}/kb/unit-tests.js" eol="crlf">
<fileset dir="${src.dir}/kb/_unit-tests">
<include name="**/*.js" />
</fileset>
</concat>
<copy file="${build.dir}/test/unit.html" tofile="${unit-tests.dir}/kb/main.html" failonerror="true" />
<!--
RDFa
-->
<concat destfile="${unit-tests.dir}/rdfa/unit-tests.js" eol="crlf">
<fileset dir="${src.dir}/rdfa/_unit-tests">
<include name="**/*.js" />
</fileset>
</concat>
<copy file="${build.dir}/test/unit.html" tofile="${unit-tests.dir}/rdfa/main.html" failonerror="true" />
<!--
XForms
-->
<concat destfile="${unit-tests.dir}/xforms/unit-tests.js" eol="crlf">
<fileset dir="${src.dir}/third-party/uxf/unit-tests">
<include name="**/*.js" />
<exclude name="unit-test-loader.js" />
</fileset>
<fileset dir="${src.dir}/third-party/uxf/src/lib/functions">
<include name="**/ut-*.js" />
</fileset>
</concat>
<copy file="${build.dir}/test/unit.html" tofile="${unit-tests.dir}/xforms/main.html" failonerror="true" />
</target>
<target name="-pre-start-local-gae">
<copy todir="${gae.application.root}" failonerror="true" filtering="true">
<fileset dir="${backplanejs.tools.base.dir}/GoogleAppEngine" includes="app.yaml"/>
</copy>
</target>
</project>