-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.xml
317 lines (294 loc) · 15.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
<project name="OpenAjaxHub" default="help">
<!--
/*******************************************************************************
* build.xml:
* Ant build script for this implementation of the OpenAjax Hub.
*
* Offers build target "OpenAjax.js" for creating the release version of OpenAjax.js
* by concatenating the individual JavaScript files.
*
* Offers build target "tests" for running JSUnit to invoke all of the
* unit tests in the test suite.
* NOTE: To run JSUnit tests, you need to download and install JSUnit.
*
* Copyright 2006 OpenAjax Alliance
*
* 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.
*
******************************************************************************/
-->
<description>OpenAjax Hub build script</description>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- Project specific properties. -->
<!-- NOTE: To run JSUnit tests, you need to download and install JSUnit-->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<property name="jsunitDir" value="./jsunit"/>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- Import other build files. -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- import file="./jsunit/build.xml" / -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- Overrides of ./jsunit/build.xml -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<path id="classpath">
<fileset dir="${jsunitDir}/java/lib">
<include name="*.jar"/>
</fileset>
<fileset dir="${jsunitDir}/java/bin">
<include name="jsunit.jar"/>
</fileset>
<dirset dir="${jsunitDir}/java/config"/>
</path>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- Put Dojo shrinksafe on the path -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<path id="shrinksafe.classpath">
<fileset dir="dojo/util/shrinksafe">
<include name="shrinksafe.jar"/>
</fileset>
</path>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- OpenAjax Hub project specific targets -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<macrodef name="printhelp" description="Prints help">
<sequential>
<echo>
This is the Ant build script for the OpenAjax Hub open source project.
ant help
Prints this message
ant release [-Dnoshrink=1]
Builds all release images into the release/ directory.
You can also build each separate image individually.
ant release_all: Builds the release/all directory
ant release_all_separate_rpc: Builds the release/all_separate_rpc directory
ant release_core: Builds the release/core directory
ant release_core_separate_rpc: Builds the release/core_separate_rpc directory
ant release_unmanaged_hub: Builds the release/unmanaged-hub directory
ant zip -DZIPDIRNAME=string
Builds a ZIP file containing the release.
You must specify command line parameter -DZIPDIRNAME=
The value is the name of the root directory name for the ZIP file.
For example, -DZIPDIRNAME=OpenAjaxHub2.0_build_976
</echo>
</sequential>
</macrodef>
<!-- Attempt at a conditional task. Normally, this will run 'shrinksafe' on a JS file and put
the output where specified. If '-Dnoshrink=1' is specified on the command line, this will
only copy the JS file and NOT run 'shrinksafe'. -->
<target name="-doCopy" if="noshrink">
<copy file="${src}" tofile="${dest}"/>
</target>
<target name="-doShrinkCopy" unless="noshrink">
<java output="${dest}" classpathref="shrinksafe.classpath" classname="org.dojotoolkit.shrinksafe.Main">
<arg file="${src}"/>
</java>
</target>
<macrodef name="copyJsFile">
<attribute name="src"/>
<attribute name="dest"/>
<sequential>
<antcall target="-doCopy">
<param name="src" value="@{src}"/>
<param name="dest" value="@{dest}"/>
</antcall>
<antcall target="-doShrinkCopy">
<param name="src" value="@{src}"/>
<param name="dest" value="@{dest}"/>
</antcall>
</sequential>
</macrodef>
<!-- Packages all src files into a single JS file -->
<target name="release_all" description="Re-builds the release/all/ directory">
<!-- OpenAjaxManagedHub-all.js -->
<concat destfile="release/all/tempfile_oktodelete">
<filelist dir="src" files="OpenAjax-mashup.js"/>
<filelist dir="src/containers/inline" files="inline.js"/>
<filelist dir="src/containers/iframe" files="iframe.js"/>
<filelist dir="src/containers/iframe" files="crypto.js"/>
<filelist dir="src/containers/iframe" files="json2.js"/>
<filelist dir="src/containers/iframe/rpc" files="rpc-dependencies.js"/>
<filelist dir="src/containers/iframe/rpc" files="fe.transport.js"/>
<filelist dir="src/containers/iframe/rpc" files="ifpc.transport.js"/>
<filelist dir="src/containers/iframe/rpc" files="rmr.transport.js"/>
<filelist dir="src/containers/iframe/rpc" files="wpm.transport.js"/>
<filelist dir="src/containers/iframe/rpc" files="rpc.js"/>
<filterchain>
<linecontainsregexp negate="true">
<regexp pattern="\/\/[\ ]*REMOVE ON BUILD"/>
</linecontainsregexp>
</filterchain>
</concat>
<copyJsFile src="release/all/tempfile_oktodelete" dest="release/all/OpenAjaxManagedHub-all.js"/>
<!-- rpc_relay.html -->
<copy todir="release/all" file="src/containers/iframe/rpc/rpc_relay.html"/>
<delete file="release/all/tempfile_oktodelete"/>
</target>
<!-- Like "release_all", except that the RPC code is split off into its own file. -->
<target name="release_all_separate_rpc" description="Re-builds the release/all_separate_rpc/ directory">
<!-- OpenAjaxManagedHub-all-oaa.js -->
<concat destfile="release/all_separate_rpc/tempfile_oktodelete">
<filelist dir="src" files="OpenAjax-mashup.js"/>
<filelist dir="src/containers/inline" files="inline.js"/>
<filelist dir="src/containers/iframe" files="iframe.js"/>
<filelist dir="src/containers/iframe" files="crypto.js"/>
<filelist dir="src/containers/iframe" files="json2.js"/>
<filterchain>
<linecontainsregexp negate="true">
<regexp pattern="\/\/[\ ]*REMOVE ON BUILD"/>
</linecontainsregexp>
</filterchain>
</concat>
<copyJsFile src="release/all_separate_rpc/tempfile_oktodelete" dest="release/all_separate_rpc/OpenAjaxManagedHub-all-oaa.js"/>
<!-- OpenAjaxManagedHub-rpc.js -->
<antcall target="release_rpc"/>
<copy todir="release/all_separate_rpc" file="release/OpenAjaxManagedHub-rpc.js"/>
<!-- rpc_relay.html -->
<copy todir="release/all_separate_rpc" file="src/containers/iframe/rpc/rpc_relay.html"/>
<delete file="release/all_separate_rpc/tempfile_oktodelete"/>
<delete file="release/OpenAjaxManagedHub-rpc.js"/>
</target>
<!-- Packages a "core" JS file consisting only of OpenAjax-mashup.js plus the inline container.
The iframe container (everything under src/containers/iframe) is packaged in a separate file. -->
<target name="release_core" description="Re-builds the release/core/ directory">
<!-- OpenAjaxManagedHub-core.js -->
<concat destfile="release/core/tempfile_oktodelete">
<filelist dir="src" files="OpenAjax-mashup.js"/>
<filelist dir="src/containers/inline" files="inline.js"/>
<filterchain>
<linecontainsregexp negate="true">
<regexp pattern="\/\/[\ ]*REMOVE ON BUILD"/>
</linecontainsregexp>
</filterchain>
</concat>
<copyJsFile src="release/core/tempfile_oktodelete" dest="release/core/OpenAjaxManagedHub-core.js"/>
<!-- OpenAjaxManagedHub-iframe.js -->
<concat destfile="release/core/tempfile_oktodelete">
<filelist dir="src/containers/iframe" files="iframe.js"/>
<filelist dir="src/containers/iframe" files="crypto.js"/>
<filelist dir="src/containers/iframe" files="json2.js"/>
<filelist dir="src/containers/iframe/rpc" files="rpc-dependencies.js"/>
<filelist dir="src/containers/iframe/rpc" files="fe.transport.js"/>
<filelist dir="src/containers/iframe/rpc" files="ifpc.transport.js"/>
<filelist dir="src/containers/iframe/rpc" files="rmr.transport.js"/>
<filelist dir="src/containers/iframe/rpc" files="wpm.transport.js"/>
<filelist dir="src/containers/iframe/rpc" files="rpc.js"/>
<filterchain>
<linecontainsregexp negate="true">
<regexp pattern="\/\/[\ ]*REMOVE ON BUILD"/>
</linecontainsregexp>
</filterchain>
</concat>
<copyJsFile src="release/core/tempfile_oktodelete" dest="release/core/OpenAjaxManagedHub-iframe.js"/>
<!-- rpc_relay.html -->
<copy todir="release/core" file="src/containers/iframe/rpc/rpc_relay.html"/>
<delete file="release/core/tempfile_oktodelete"/>
</target>
<!-- Like "release_core", except that the RPC code is split off from the "iframe" JS file. -->
<target name="release_core_separate_rpc" description="Re-builds the release/core_separate_rpc/ directory">
<!-- OpenAjaxManagedHub-core.js -->
<concat destfile="release/core_separate_rpc/tempfile_oktodelete">
<filelist dir="src" files="OpenAjax-mashup.js"/>
<filelist dir="src/containers/inline" files="inline.js"/>
<filterchain>
<linecontainsregexp negate="true">
<regexp pattern="\/\/[\ ]*REMOVE ON BUILD"/>
</linecontainsregexp>
</filterchain>
</concat>
<copyJsFile src="release/core_separate_rpc/tempfile_oktodelete" dest="release/core_separate_rpc/OpenAjaxManagedHub-core.js"/>
<!-- OpenAjaxManagedHub-iframe-oaa.js -->
<concat destfile="release/core_separate_rpc/tempfile_oktodelete">
<filelist dir="src/containers/iframe" files="iframe.js"/>
<filelist dir="src/containers/iframe" files="crypto.js"/>
<filelist dir="src/containers/iframe" files="json2.js"/>
<filterchain>
<linecontainsregexp negate="true">
<regexp pattern="\/\/[\ ]*REMOVE ON BUILD"/>
</linecontainsregexp>
</filterchain>
</concat>
<copyJsFile src="release/core_separate_rpc/tempfile_oktodelete" dest="release/core_separate_rpc/OpenAjaxManagedHub-iframe-oaa.js"/>
<!-- OpenAjaxManagedHub-rpc.js -->
<antcall target="release_rpc"/>
<copy todir="release/core_separate_rpc" file="release/OpenAjaxManagedHub-rpc.js"/>
<!-- rpc_relay.html -->
<copy todir="release/core_separate_rpc" file="src/containers/iframe/rpc/rpc_relay.html"/>
<delete file="release/core_separate_rpc/tempfile_oktodelete"/>
<delete file="release/OpenAjaxManagedHub-rpc.js"/>
</target>
<!-- Packages all RPC files into a single JS file -->
<target name="release_rpc" description="Re-builds the RPC single JS file">
<concat destfile="release/tempfile_oktodelete">
<filelist dir="src/containers/iframe/rpc" files="rpc-dependencies.js"/>
<filelist dir="src/containers/iframe/rpc" files="fe.transport.js"/>
<filelist dir="src/containers/iframe/rpc" files="ifpc.transport.js"/>
<filelist dir="src/containers/iframe/rpc" files="rmr.transport.js"/>
<filelist dir="src/containers/iframe/rpc" files="wpm.transport.js"/>
<filelist dir="src/containers/iframe/rpc" files="rpc.js"/>
</concat>
<copyJsFile src="release/tempfile_oktodelete" dest="release/OpenAjaxManagedHub-rpc.js"/>
<delete file="release/tempfile_oktodelete"/>
</target>
<!-- Re-builds the release/unmanagedhub/ directory from *.js files in src/ directory -->
<target name="release_unmanagedhub" description="Re-builds the release/unmanagedhub/ directory">
<concat destfile="release/unmanagedhub/tempfile_oktodelete">
<filelist dir="src" files="OpenAjax.js"/>
<filterchain>
<linecontainsregexp negate="true">
<regexp pattern="\/\/[\ ]*REMOVE ON BUILD"/>
</linecontainsregexp>
</filterchain>
</concat>
<copyJsFile src="release/unmanagedhub/tempfile_oktodelete" dest="release/unmanagedhub/OpenAjaxUnmanagedHub.js"/>
<delete file="release/unmanagedhub/tempfile_oktodelete"/>
</target>
<target name="help">
<printhelp/>
</target>
<!-- Re-builds all images for the the release/ directory from *.js files in src/ directory -->
<target name="release" description="Re-builds all images for the the release/ directory"
depends="release_all,release_all_separate_rpc,release_core,release_core_separate_rpc,release_unmanagedhub">
</target>
<!-- Re-builds all images for the the release/ directory from *.js files in src/ directory -->
<!-- (Blame Ant for how difficult this is to follow) -->
<target name="zip" depends="release,zip-true,zip-false"/>
<target name="ZIPDIRNAME_CHECK">
<condition property="ZIPDIRNAME_IS_SET">
<isset property="ZIPDIRNAME"/>
</condition>
</target>
<target name="zip-true" depends="ZIPDIRNAME_CHECK" if="ZIPDIRNAME_IS_SET">
<delete file="${ZIPDIRNAME}.zip" failonerror="false"/>
<delete dir="${ZIPDIRNAME}" failonerror="false"/>
<copy todir="${ZIPDIRNAME}/${ZIPDIRNAME}/src" preservelastmodified="true">
<fileset dir="src"/>
</copy>
<copy todir="${ZIPDIRNAME}/${ZIPDIRNAME}/release" preservelastmodified="true">
<fileset dir="release"/>
</copy>
<copy todir="${ZIPDIRNAME}/${ZIPDIRNAME}/testsrc" preservelastmodified="true">
<fileset dir="testsrc"/>
</copy>
<copy todir="${ZIPDIRNAME}/${ZIPDIRNAME}" file="build.xml"/>
<zip destfile="${ZIPDIRNAME}.zip">
<fileset dir="${ZIPDIRNAME}"/>
</zip>
</target>
<target name="zip-false" depends="ZIPDIRNAME_CHECK" unless="ZIPDIRNAME_IS_SET">
<printhelp/>
<echo message=""/>
<fail message="You must specify -DZIPDIRNAME=whatever when using 'ant zip' command'"/>
</target>
<!-- Runs all JSUnit tests. The standalone_test is defined in the imported -->
<!-- ./jsunit/build.xml that came with jsunit.-->
<!-- NOTE: To run JSUnit tests, you need to download and install JSUnit-->
<target name="tests" description="Runs automated tests" depends="release">
<antcall target="standalone_test"/>
</target>
</project>