-
Notifications
You must be signed in to change notification settings - Fork 12
/
build.xml
282 lines (230 loc) · 9.51 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
<?xml version="1.0" encoding="ISO-8859-1"?>
<project name="SenchaTry" basedir="." default="usage">
<description>Just a bunch of Sencha Try scripts</description>
<!-- Global variables -->
<property name="version" value="0.1.0" />
<property name="src.dir" value="." />
<property name="pathsep" value="
" />
<property file="build.properties" />
<property name="buildr.dir" value="../buildr" />
<import file="${buildr.dir}/buildr.xml" />
<target name="usage" description="Usage examples">
<echo>Version: ${version}
$ ant validate
$ ant pretty
For a full list of targets:
$ ant -projecthelp
</echo>
</target>
<!-- Outputs all the app.js files to an external file -->
<target name="listfiles" description="Outputs all the app.js files to an external file.">
<property name="filefilter" value="**/app.js" />
<property name="outfile" value="app.txt" />
<pathconvert pathsep="${pathsep}" property="files">
<fileset dir="${src.dir}" includes="${filefilter}" />
</pathconvert>
<echo file="${outfile}">${files}</echo>
</target>
<!-- Find all those pesky .DS_Store files -->
<target name="ds_store"
description="Find all those pesky .DS_Store files.">
<!--
<echo>${ds_store.cmd}</echo>
<exec executable="sh">
<arg value="-c" />
<arg value="${ds_store.cmd}" />
</exec>
-->
<delete>
<fileset dir="${src.dir}" includes="**/.DS_Store" defaultexcludes="no" />
</delete>
</target>
<!-- Find all HTM (not HTML) files -->
<target name="htmFiles"
description="Find all HTM (not HTML) files.">
<echo>${htmFiles.cmd}</echo>
<exec executable="sh">
<arg value="-c" />
<arg value="${htmFiles.cmd}" />
</exec>
</target>
<!-- Find all HTML files with missing doctypes -->
<target name="missingDoctype"
description="Find all HTML files with missing doctypes.">
<echo>${missingDoctype.cmd}</echo>
<exec executable="sh">
<arg value="-c" />
<arg value="${missingDoctype.cmd}" />
</exec>
</target>
<!-- Find all HTML files with an HTML4 doctype -->
<target name="html4Doctype"
description="Find all HTML files with an HTML4 doctype.">
<echo>${html4Doctype.cmd}</echo>
<exec executable="sh">
<arg value="-c" />
<arg value="${html4Doctype.cmd}" />
</exec>
</target>
<!-- Find all HTML files with empty title tags -->
<target name="emptyTitles"
description="Find all HTML files with empty title tags.">
<echo>${emptyTitles.cmd}</echo>
<exec executable="sh">
<arg value="-c" />
<arg value="${emptyTitles.cmd}" />
</exec>
</target>
<!-- Find all HTML files with missing title tags -->
<target name="missingTitles"
description="Find all HTML files with missing title tags.">
<echo>${missingTitles.cmd}</echo>
<exec executable="sh">
<arg value="-c" />
<arg value="${missingTitles.cmd}" />
</exec>
</target>
<!-- Find all script tags missing type attributes -->
<target name="scriptWithoutType"
description="Find all script tags missing type attributes.">
<echo>${scriptWithoutType.cmd}</echo>
<exec executable="sh">
<arg value="-c" />
<arg value="${scriptWithoutType.cmd}" />
</exec>
</target>
<!-- Find all *.php file references -->
<target name="console"
description="Find all 'console.' references.">
<echo>${console.cmd}</echo>
<exec executable="sh">
<arg value="-c" />
<arg value="${console.cmd}" />
</exec>
</target>
<!-- Find all possible URLs in the examples (helps find potential .php or other external dependencies) -->
<target name="findURLs"
description="Find all possible URLs in the examples (helps find potential .php or other external dependencies).">
<echo>${findURLs1.cmd}</echo>
<exec executable="sh">
<arg value="-c" />
<arg value="${findURLs1.cmd}" />
</exec>
<echo>${findURLs2.cmd}</echo>
<exec executable="sh">
<arg value="-c" />
<arg value="${findURLs2.cmd}" />
</exec>
<echo>${findURLs3.cmd}</echo>
<exec executable="sh">
<arg value="-c" />
<arg value="${findURLs3.cmd}" />
</exec>
</target>
<!-- Find all URLs without `http:` or `https:` prefixes -->
<target name="findNonQualifiedURLs"
description="Find all URLs without `http:` or `https:` prefixes.">
<echo>${findNonQualifiedURLs.cmd}</echo>
<exec executable="sh">
<arg value="-c" />
<arg value="${findNonQualifiedURLs.cmd}" />
</exec>
</target>
<!-- Find all *.php file references -->
<target name="findPHPs"
description="Find all .php file references.">
<echo>${findPHPs.cmd}</echo>
<exec executable="sh">
<arg value="-c" />
<arg value="${findPHPs.cmd}" />
</exec>
</target>
<!-- Find all ux/ references -->
<target name="findUXs"
description="Find all ux/ references">
<echo>${findUXs.cmd}</echo>
<exec executable="sh">
<arg value="-c" />
<arg value="${findUXs.cmd}" />
</exec>
</target>
<!-- Find any "<" or ">" characters in markdown files -->
<target name="readmeMarkup"
description="Find any HTML tags in a Markdown file.">
<echo>${readmeMarkup.cmd}</echo>
<exec executable="sh">
<arg value="-c" />
<arg value="${readmeMarkup.cmd}" />
</exec>
</target>
<!-- Applies some basic code/markup validations -->
<target name="validate"
description="Applies some basic code/markup validations."
depends="showsplash, ds_store, htmFiles, missingDoctype, html4Doctype, findNonQualifiedURLs, emptyTitles, missingTitles, readmeMarkup">
</target>
<target name="showsplash"
description="Display a lovely splash screen while Ant runs.">
<splash displaytext="Validating files..."
imageurl="http://www.sencha.com/img/sencha-large.png"
showduration="500" />
</target>
<!-- Apply some basic code cleanup (tabs to spaces, trailing linefeed) to all JS, JSON, and CSS files -->
<target name="pretty"
description="Applies some general formatting to all *.(js|json|css) files in the project directory.">
<fixcrlf srcdir="${src.dir}"
tab="remove"
tablength="4"
eol="lf">
<include name="**/*.js" />
<include name="**/*.json" />
<include name="**/*.css" />
</fixcrlf>
</target>
<target name="jshint"
description="Validate all the JS files via Buildr's `jshint` task.">
<property name="jshint_opts" value="asi=true,boss=true,browser=true,curly=true,devel=true,eqeqeq=true,eqnull=true,forin=true,lastsemic=true,laxbreak=true,laxcomma=true,nonstandard=true,onecase=true,shadow=true,smarttabs=true,sub=true,undef=false" />
<echo>Note: This will validate all .js/.json files, except those in the /examples/ folders.</echo>
<echo>Using: ${jshint_opts}</echo>
<jshint options="${jshint_opts}">
<fileset dir="${src.dir}"
includes="**/*.js, **/*.json"
excludes="**/examples/**, **/community/**, **/Ext.Array.clean.1/**" />
</jshint>
</target>
<target name="csslint"
description="Validate all the CSS files via Buildr's `csslint` task.">
<csslint format="text" quiet="quiet" warnings="box-model,display-property-grouping,duplicate-properties,empty-rules,known-properties">
<fileset dir="${src.dir}"
includes="**/*.css"
excludes="**/examples/**" />
</csslint>
</target>
<target name="lint"
description=""
depends="jshint, csslint">
<echo>Linting...</echo>
</target>
<!-- Find all those pesky .DS_Store files -->
<target name="example_json"
description="Find all those pesky example.json files.">
<property name="jshint_opts" value="asi=true,boss=true,browser=true,curly=true,devel=true,eqeqeq=true,eqnull=true,forin=true,lastsemic=true,laxbreak=true,laxcomma=true,nonstandard=true,onecase=true,shadow=true,smarttabs=true,sub=true,undef=false" />
<fixcrlf srcdir="${src.dir}"
tab="remove"
tablength="4"
eol="lf">
<include name="**/example.json" />
</fixcrlf>
<jshint options="${jshint_opts}">
<fileset dir="${src.dir}"
includes="**/example.json" />
</jshint>
</target>
<!-- Remove any src.zip files. -->
<target name="srczip"
description="Remove any src.zip files."
depends="ds_store">
<delete>
<fileset dir="${src.dir}" includes="**/src.zip" defaultexcludes="no" />
</delete>
</target>
</project>