-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
260 lines (220 loc) · 6.44 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
<project name="IzPack Js Builder" default="build" basedir=".">
<target name="build"
depends="load.properties, clean, check, minify"
description="Release builder">
</target>
<target name="quickbuild"
depends="load.properties, clean, minify"
description="Release builder">
</target>
<!-- -->
<!-- init -->
<!-- -->
<target name="load.properties">
<!-- source files -->
<path id="js.srcFiles">
<!-- first, the class plugin and the compatibility check !-->
<fileset dir="js/src">
<include name="jQuery.class.js" />
<include name="CompatibilityCheck.js" />
</fileset>
<fileset dir="js/src">
<include name="*.js" />
<exclude name="jQuery.class.js" />
<exclude name="CompatibilityCheck.js" />
</fileset>
<fileset dir="js/src/zip">
<include name="*.js" />
</fileset>
<fileset dir="js/src/xml">
<include name="*.js" />
</fileset>
<fileset dir="js/src/xml/w3c">
<include name="*.js" />
</fileset>
<fileset dir="js/src/xml/ie">
<include name="*.js" />
</fileset>
<!-- we want first the mother class -->
<fileset dir="js/src/generator">
<include name="GenericGenerator.js" />
</fileset>
<fileset dir="js/src/generator">
<include name="*.js" />
<exclude name="GenericGenerator.js" />
</fileset>
<fileset dir="js/src/generator/panel">
<include name="GenericPanel.js" />
</fileset>
<fileset dir="js/src/generator/panel">
<include name="*.js" />
<exclude name="GenericPanel.js" />
</fileset>
<fileset dir="js/src/model">
<include name="*.js" />
</fileset>
<!-- we want first the mother class -->
<fileset dir="js/src/controller">
<include name="GenericController.js" />
</fileset>
<fileset dir="js/src/controller">
<include name="*.js" />
<exclude name="GenericController.js" />
</fileset>
<!-- we want first the mother class -->
<fileset dir="js/src/view">
<include name="GenericView.js" />
</fileset>
<fileset dir="js/src/view">
<include name="*.js" />
<exclude name="GenericView.js" />
</fileset>
<!-- we want first the mother class -->
<fileset dir="js/src/controller/panelConfig">
<include name="GenericPanel.js" />
</fileset>
<fileset dir="js/src/controller/panelConfig">
<include name="*.js" />
<exclude name="GenericPanel.js" />
</fileset>
<!-- we want first the mother class -->
<fileset dir="js/src/view/panelConfig">
<include name="GenericPanel.js" />
</fileset>
<fileset dir="js/src/view/panelConfig">
<include name="*.js" />
<exclude name="GenericPanel.js" />
</fileset>
</path>
<!-- lib files -->
<path id="js.libFiles">
<fileset dir="js/lib">
<include name="jQuery.validity/jquery.validity.js" />
<include name="Class.js" />
<include name="jQuery.namespace.js" />
<include name="jQuery.base64.js" />
<include name="jQuery.crc32.js" />
<include name="downloadify/downloadify.min.js" />
</fileset>
</path>
<property name="target" value="target"/>
<property name="target.concatFile.path" value="${target}/graoupack.js"/>
<property name="target.minFile.path" value="${target}/graoupack.min.js"/>
<path id="target.concatFile">
<fileset dir=".">
<include name="${target.concatFile.path}"/>
</fileset>
</path>
<path id="target.minFile">
<fileset dir=".">
<include name="${target.minFile.path}"/>
</fileset>
</path>
<!-- compressor -->
<property name="lib.dir"
value="build"
description="compression librairies dir" />
<property
name="yui.compressor"
value="${lib.dir}/yuicompressor-2.4.2.jar"
description="YUI compressor" />
<!-- syntax check -->
<property
name="rhino.jar"
value="${lib.dir}/rhino-1.7R2.jar"
description="Rhino javascript engine" />
<property
name="syntax.check"
value="${lib.dir}/jslint/syntaxcheck.js"
description="syntax check file" />
</target>
<!-- -->
<!-- concatenation -->
<!-- -->
<target
description="JavaScript concatenation"
name="concat"
depends="load.properties">
<mkdir dir="${target}" />
<concat destfile="${target.concatFile.path}">
<path refid="js.libFiles" />
<path refid="js.srcFiles" />
</concat>
</target>
<!-- -->
<!-- syntax check -->
<!-- -->
<target
description="JavaScript each file syntax check"
name="check"
depends="load.properties">
<apply executable="java" parallel="false">
<path refid="js.srcFiles" />
<arg line="-jar" />
<arg path="${rhino.jar}" />
<arg line="${syntax.check}" />
<srcfile />
</apply>
<resourcecount property="count.srcFiles">
<path refid="js.srcFiles" />
</resourcecount>
<echo>${count.srcFiles} files checked</echo>
</target>
<!-- -->
<!-- delete debug statements -->
<!-- -->
<target
description="remove the debug statements"
name="delete.debug"
depends="concat">
<replaceregexp
file="${target.concatFile.path}"
match="DEBUG_(BEGIN|START).*?DEBUG_(END|STOP)"
replace="debug statement removed"
flags="gs"
/>
</target>
<!-- -->
<!-- minification -->
<!-- -->
<target
description="JavaScript minification"
name="minify"
depends="load.properties, delete.debug">
<apply executable="java" parallel="false">
<path refid="target.concatFile" />
<arg line="-jar" />
<arg path="${yui.compressor}" />
<!--<arg line="${target.concatFile}" />-->
<!--<arg line="-v" />-->
<srcfile />
<arg line="-o" />
<mapper type="glob"
from="*.js"
to="*.min.js" />
<targetfile />
</apply>
<length property="length.uncompressed">
<path refid="target.concatFile" />
</length>
<echo>uncompressed : ${length.uncompressed}</echo>
<length property="length.compressed">
<path refid="target.minFile" />
</length>
<echo>compressed : ${length.compressed}</echo>
<!--
<delete>
<path refid="target.concatFile" />
</delete>
-->
</target>
<!-- -->
<!-- clean -->
<!-- -->
<target
description="Clean all built files."
name="clean"
depends="load.properties">
<delete dir="${target}" />
</target>
</project>