]>
Commit | Line | Data |
---|---|---|
c4685c84 TL |
1 | <?xml version="1.0" encoding="utf-8"?> |
2 | <!-- | |
3 | ********************************** DO NOT EDIT ********************************** | |
4 | ||
5 | This file will be replaced during upgrades so DO NOT EDIT this file. If you need to | |
6 | adjust the process, reading and understanding this file is the first step. | |
7 | ||
8 | In most cases, the adjustments can be achieved by setting properties or providing one | |
9 | of the "hooks" in the form of a "-before-" or "-after-" target. Whenever possible, look | |
10 | for one of these solutions. | |
11 | ||
12 | Failing that, you can copy whole targets to your build.xml file and it will overrride | |
13 | the target provided here. Doing that can create problems for upgrading to newer | |
14 | versions of Cmd so it is not recommended but it will be easier to manage than editing | |
15 | this file in most cases. | |
16 | --> | |
17 | <project name="app-build-impl"> | |
18 | <!-- | |
19 | =============================================================== | |
20 | helper targets for ant integrations with IDE's | |
21 | (human readable target names) | |
22 | =============================================================== | |
23 | --> | |
24 | <target name="-before-build-testing"/> | |
25 | <target name="-build-testing" depends="testing,build"/> | |
26 | <target name="-after-build-testing"/> | |
27 | <target name="build-testing" | |
28 | depends="-before-build-testing, | |
29 | -build-testing, | |
30 | -after-build-testing"/> | |
31 | ||
32 | <target name="Build - Testing" | |
33 | description="Create a Testing build of this project" | |
34 | depends="build-testing"/> | |
35 | ||
36 | <target name="-before-build-production"/> | |
37 | <target name="-build-production" depends="production,build"/> | |
38 | <target name="-after-build-production"/> | |
39 | <target name="build-production" | |
40 | depends="-before-build-production, | |
41 | -build-production, | |
42 | -after-build-production"/> | |
43 | ||
44 | <target name="Build - Production" | |
45 | description="Create a Production build of this project" | |
46 | depends="build-production"/> | |
47 | ||
48 | <target name="-before-build-native"/> | |
49 | <target name="-build-native" depends="native,build"/> | |
50 | <target name="-after-build-native"/> | |
51 | <target name="build-native" | |
52 | depends="-before-build-native, | |
53 | -build-native, | |
54 | -after-build-native"/> | |
55 | ||
56 | <target name="Build - Native" | |
57 | description="Create a Native build of this project" | |
58 | depends="build-native"/> | |
59 | ||
60 | <target name="-before-start-local-webserver"/> | |
61 | <target name="-start-local-webserver" depends="init"> | |
62 | <x-launch-terminal> | |
63 | <![CDATA[ | |
64 | ${cmd.dir}/sencha fs web -port=${build.web.port} start -map=${build.web.root} | |
65 | ]]> | |
66 | </x-launch-terminal> | |
67 | </target> | |
68 | <target name="-after-start-local-webserver"/> | |
69 | <target name="start-local-webserver" | |
70 | depends="-before-start-local-webserver, | |
71 | -start-local-webserver, | |
72 | -after-start-local-webserver"/> | |
73 | ||
74 | <target name="WebServer - Start Local" | |
75 | description="Starts a local webserver for this project" | |
76 | depends="start-local-webserver"/> | |
77 | ||
78 | <target name="-before-compass-watch"/> | |
79 | <target name="-compass-watch" depends="init"> | |
80 | <x-launch-terminal> | |
81 | compass watch ${app.sass.dir} | |
82 | </x-launch-terminal> | |
83 | </target> | |
84 | <target name="-after-compass-watch"/> | |
85 | <target name="compass-watch" | |
86 | depends="-before-compass-watch, | |
87 | -compass-watch, | |
88 | -after-compass-watch"/> | |
89 | ||
90 | <target name="Compass - Watch" | |
91 | description="Opens terminal and watches for SASS updates" | |
92 | depends="compass-watch"/> | |
93 | ||
94 | <!-- | |
95 | =============================================================== | |
96 | environment setters | |
97 | =============================================================== | |
98 | --> | |
99 | <target name="production" | |
100 | description="Sets the build environment to production."> | |
101 | <property name="build.environment" value="production"/> | |
102 | </target> | |
103 | ||
104 | <target name="testing" | |
105 | description="Sets the build environment to testing."> | |
106 | <property name="build.environment" value="testing"/> | |
107 | </target> | |
108 | ||
109 | <target name="native" | |
110 | description="Sets the build environment to native."> | |
111 | <property name="build.environment" value="native"/> | |
112 | </target> | |
113 | ||
114 | <target name="package" | |
115 | description="Sets the build environment to package."> | |
116 | <property name="build.environment" value="package"/> | |
117 | </target> | |
118 | ||
119 | ||
120 | <!-- | |
121 | =============================================================== | |
122 | Find Cmd | |
123 | uses targets from find-cmd-impl.xml to detect the current | |
124 | install of Sencha Cmd | |
125 | =============================================================== | |
126 | --> | |
127 | <import file="${basedir}/.sencha/app/find-cmd-impl.xml"/> | |
128 | <target name="init-cmd" | |
129 | depends="find-cmd-in-path, | |
130 | find-cmd-in-environment, | |
131 | find-cmd-in-shell"> | |
132 | <echo>Using Sencha Cmd from ${cmd.dir} for ${ant.file}</echo> | |
133 | ||
134 | <!-- | |
135 | load the sencha.jar ant task definitions. | |
136 | ||
137 | NOTE: the 'loaderref' attribute stores this task def's class loader | |
138 | on the project by that name, so it will be sharable across sub-projects. | |
139 | This fixes out-of-memory issues, as well as increases performance. | |
140 | ||
141 | To supoprt this, it is recommended that any customizations that use | |
142 | 'ant' or 'antcall' tasks set 'inheritrefs=true' on those tasks, in order | |
143 | to propagate the senchaloader reference to those subprojects. | |
144 | ||
145 | The sencha 'x-ant-call' task, which extends 'antcall' and defaults | |
146 | 'inheritrefs' to true, may be used in place of antcall in | |
147 | build process customizations. | |
148 | --> | |
149 | <taskdef resource="com/sencha/ant/antlib.xml" | |
150 | classpath="${cmd.dir}/sencha.jar" | |
151 | loaderref="senchaloader"/> | |
152 | ||
153 | <!-- | |
154 | Some operations require sencha.jar in the current java classpath, | |
155 | so this will extend the java.lang.Thread#contextClassLoader with the | |
156 | specified java classpath entries | |
157 | --> | |
158 | <x-extend-classpath> | |
159 | <jar path="${cmd.dir}/sencha.jar"/> | |
160 | </x-extend-classpath> | |
161 | </target> | |
162 | ||
163 | <!-- | |
164 | =============================================================== | |
165 | Init | |
166 | uses targets from init-impl.xml to load Sencha Cmd config | |
167 | system properties and ant task definitions | |
168 | =============================================================== | |
169 | --> | |
170 | <import file="${basedir}/.sencha/app/init-impl.xml"/> | |
171 | <target name="init" | |
172 | depends="init-local, | |
173 | init-cmd, | |
174 | -before-init, | |
175 | -init, | |
176 | -after-init, | |
177 | -before-init-defaults, | |
178 | -init-defaults, | |
179 | -after-init-defaults, | |
180 | -init-compiler"/> | |
181 | ||
182 | <!-- | |
183 | =============================================================== | |
184 | Build | |
185 | this is the starting point for the build process. The 'depends' | |
186 | attribute on the -build target controls the ordering of the | |
187 | different build phases | |
188 | =============================================================== | |
189 | --> | |
190 | <target name="-before-build"/> | |
191 | <target name="-build" | |
192 | depends="refresh, | |
193 | resolve, | |
194 | js, | |
195 | resources, | |
196 | sass, | |
197 | slice, | |
198 | page, | |
199 | native-package"/> | |
200 | <target name="-after-build"/> | |
201 | <target name="build" | |
202 | depends="init,-before-build,-build,-after-build" | |
203 | description="Builds the application"/> | |
204 | ||
205 | <!-- | |
206 | =============================================================== | |
207 | Clean | |
208 | removes all artifacts from the output build directories | |
209 | =============================================================== | |
210 | --> | |
211 | <target name="-before-clean"/> | |
212 | <target name="-clean"> | |
213 | <delete dir="${build.dir}"/> | |
214 | <delete dir="${build.temp.dir}"/> | |
215 | </target> | |
216 | <target name="-after-clean"/> | |
217 | <target name="clean" | |
218 | depends="init" | |
219 | description="Removes all build output produced by the 'build' target"> | |
220 | <x-ant-call unless="skip.clean"> | |
221 | <target name="-before-clean"/> | |
222 | <target name="-clean"/> | |
223 | <target name="-after-clean"/> | |
224 | </x-ant-call> | |
225 | </target> | |
226 | ||
227 | <!-- | |
228 | =============================================================== | |
229 | Watch | |
230 | uses targets from watch-impl.xml to initiate the application | |
231 | watch process using instrumented state from the compiler | |
232 | =============================================================== | |
233 | --> | |
234 | <import file="${basedir}/.sencha/app/watch-impl.xml"/> | |
235 | <target name="watch"> | |
236 | <property name="build.optimize" value=""/> | |
237 | <x-ant-call> | |
238 | <target name="-before-watch"/> | |
239 | <target name="-watch"/> | |
240 | <target name="-after-watch"/> | |
241 | </x-ant-call> | |
242 | </target> | |
243 | ||
244 | <!-- | |
245 | =============================================================== | |
246 | JS | |
247 | uses targets from js-impl.xml to produce the output js files | |
248 | containing needed application and framework js classes | |
249 | =============================================================== | |
250 | --> | |
251 | <import file="${basedir}/.sencha/app/js-impl.xml"/> | |
252 | <target name="js" | |
253 | depends="init" | |
254 | description="Builds the output javascript file(s)"> | |
255 | <x-ant-call unless="skip.js"> | |
256 | <target name="-before-js"/> | |
257 | <target name="-js"/> | |
258 | <target name="-after-js"/> | |
259 | </x-ant-call> | |
260 | </target> | |
261 | ||
262 | <!-- | |
263 | =============================================================== | |
264 | Sass | |
265 | uses targets from sass-impl.xml to produce the output css | |
266 | files for the application's styling | |
267 | =============================================================== | |
268 | --> | |
269 | <import file="${basedir}/.sencha/app/sass-impl.xml"/> | |
270 | <target name="sass" | |
271 | depends="init" | |
272 | description="Builds the Sass files using Compass."> | |
273 | <x-ant-call unless="skip.sass"> | |
274 | <target name="-before-sass"/> | |
275 | <target name="-sass"/> | |
276 | <target name="-after-sass"/> | |
277 | </x-ant-call> | |
278 | </target> | |
279 | ||
280 | <!-- | |
281 | =============================================================== | |
282 | Resources | |
283 | uses targets from resources-impl.xml to copy resources from | |
284 | the application and required packages to the output directory | |
285 | =============================================================== | |
286 | --> | |
287 | <import file="${basedir}/.sencha/app/resources-impl.xml"/> | |
288 | <target name="resources" | |
289 | depends="init" | |
290 | description="Copy resources to build folder."> | |
291 | <x-ant-call unless="skip.resources"> | |
292 | <target name="-before-resources"/> | |
293 | ||
294 | <!-- Legacy targets: --> | |
295 | <target name="-before-inherit-resources"/> | |
296 | <target name="-before-copy-resources"/> | |
297 | ||
298 | <target name="-resources"/> | |
299 | ||
300 | <!-- Legacy targets: --> | |
301 | <target name="-after-copy-resources"/> | |
302 | <target name="-after-inherit-resources"/> | |
303 | ||
304 | <target name="-after-resources"/> | |
305 | </x-ant-call> | |
306 | </target> | |
307 | ||
308 | ||
309 | <!-- | |
310 | =============================================================== | |
311 | Slice | |
312 | uses targets from slice-impl.xml to extract theme images from | |
313 | the application for use with older browsers that don't | |
314 | support modern css features | |
315 | =============================================================== | |
316 | --> | |
317 | <import file="${basedir}/.sencha/app/slice-impl.xml"/> | |
318 | <target name="slice" | |
319 | depends="init" | |
320 | description="Slices CSS3 theme to produce non-CSS3 images and sprites."> | |
321 | <x-ant-call unless="skip.slice"> | |
322 | <target name="-before-slice"/> | |
323 | <target name="-slice"/> | |
324 | <target name="-after-slice"/> | |
325 | </x-ant-call> | |
326 | </target> | |
327 | ||
328 | <!-- | |
329 | Theme - this is a legacy support target for extjs 4.1 apps. It redirects | |
330 | to the "slice" ant target | |
331 | --> | |
332 | <target name="theme" | |
333 | depends="init" | |
334 | description="Builds the application's theme(s) images using the slicer (Ext JS 4.1 only)."> | |
335 | <x-ant-call unless="skip.theme"> | |
336 | <target name="-before-theme"/> | |
337 | <target name="slice"/> | |
338 | <target name="-after-theme"/> | |
339 | </x-ant-call> | |
340 | </target> | |
341 | ||
342 | <!-- | |
343 | Refresh Theme - uses targets from refresh-impl.xml to rebuild the current | |
344 | theme | |
345 | --> | |
346 | <target name="refresh-theme" | |
347 | depends="init" | |
348 | description="Rebuilds the currently enabled app theme (Ext JS 4.1 only)."> | |
349 | <x-ant-call unless="skip.theme"> | |
350 | <target name="-before-refresh-theme"/> | |
351 | <target name="-refresh-theme"/> | |
352 | <target name="-after-refresh-theme"/> | |
353 | </x-ant-call> | |
354 | </target> | |
355 | ||
356 | <!-- | |
357 | =============================================================== | |
358 | Refresh | |
359 | uses targets from refresh-impl.xml to generate bootstrapping | |
360 | information for the application | |
361 | =============================================================== | |
362 | --> | |
363 | <import file="${basedir}/.sencha/app/refresh-impl.xml"/> | |
364 | <target name="refresh" | |
365 | depends="init" | |
366 | description="Refreshes the application bootstrap data."> | |
367 | <x-ant-call unless="skip.refresh"> | |
368 | <target name="-before-refresh"/> | |
369 | <target name="-refresh"/> | |
370 | <target name="-after-refresh"/> | |
371 | </x-ant-call> | |
372 | </target> | |
373 | ||
374 | <!-- | |
375 | =============================================================== | |
376 | Page | |
377 | uses targets from page-impl.xml to generate the output markup | |
378 | file and associated microloader / app manifest | |
379 | =============================================================== | |
380 | --> | |
381 | <import file="${basedir}/.sencha/app/page-impl.xml"/> | |
382 | <target name="page" | |
383 | depends="init" | |
384 | description="Builds the application's HTML page."> | |
385 | <x-ant-call unless="skip.page"> | |
386 | <target name="-before-page"/> | |
387 | <target name="-page"/> | |
388 | <target name="-after-page"/> | |
389 | </x-ant-call> | |
390 | </target> | |
391 | ||
392 | <!-- | |
393 | =============================================================== | |
394 | Resolve | |
395 | uses targets from resolve-impl.xml to detect dynamic app | |
396 | dependencies using phantomjs | |
397 | =============================================================== | |
398 | --> | |
399 | <import file="${basedir}/.sencha/app/resolve-impl.xml"/> | |
400 | <target name="resolve" | |
401 | depends="init" | |
402 | description="Resolve application dependencies dynamically."> | |
403 | <x-ant-call unless="skip.resolve"> | |
404 | <target name="-before-resolve"/> | |
405 | <target name="-resolve"/> | |
406 | <target name="-after-resolve"/> | |
407 | </x-ant-call> | |
408 | </target> | |
409 | ||
410 | <!-- | |
411 | =============================================================== | |
412 | Native Package | |
413 | uses targets from packager-impl.xml to run native packager | |
414 | applications to produce stand-alone installable web apps from | |
415 | this built Cmd application | |
416 | =============================================================== | |
417 | --> | |
418 | <import file="${basedir}/.sencha/app/packager-impl.xml"/> | |
419 | <target name="native-package" | |
420 | depends="init" | |
421 | description="Builds native packages of the application"> | |
422 | <x-ant-call unless="skip.native-package"> | |
423 | <target name="-before-native-package"/> | |
424 | <target name="-native-package"/> | |
425 | <target name="-after-native-package"/> | |
426 | </x-ant-call> | |
427 | </target> | |
428 | ||
429 | <!-- | |
430 | =============================================================== | |
431 | Help - properties | |
432 | displays all current ant properties | |
433 | =============================================================== | |
434 | --> | |
435 | <target name=".props" depends="init" | |
436 | description="Lists all properties defined for the build"> | |
437 | <echoproperties/> | |
438 | </target> | |
439 | ||
440 | <!-- | |
441 | =============================================================== | |
442 | Help - docs | |
443 | displays the help message | |
444 | =============================================================== | |
445 | --> | |
446 | <target name=".help" depends="init" | |
447 | description="Provides help on the build script"> | |
448 | <x-get-project-targets property="help.message"/> | |
449 | ||
450 | <echo><![CDATA[${help.message} | |
451 | This is the main build script for your application. | |
452 | ||
453 | The following properties can be used to disable certain steps in the build | |
454 | process. | |
455 | ||
456 | * skip.page Do not build the HTML page. | |
457 | * skip.js Do not build the output js code file(s) | |
458 | * skip.resources Do not copy resources to the build directory | |
459 | * skip.sass Do not build the SASS. | |
460 | * skip.slice Do not build the theme image slicer. | |
461 | * skip.theme Do not build the theme images. | |
462 | ||
463 | The following properties can be used to modify the build process. | |
464 | ||
465 | * build.compression.yui Specify yui compression for the build | |
466 | ||
467 | * build.compression.closure Specify closure compression for the build | |
468 | ||
469 | * build.compression.uglify Specify uglify compression for the build | |
470 | ||
471 | * build.options Set general options for the build | |
472 | (eg: enable a debug build) | |
473 | ||
474 | To modify any of the previous build specific options, see: | |
475 | ${basedir}/.sencha/app/${build.environment}.properties | |
476 | ||
477 | * build.operations Insert commands into the compile command | |
478 | for the build. | |
479 | ||
480 | * app.page.name Set the input and output page file | |
481 | for the compile command. | |
482 | ||
483 | * build.classes.name Specify the compiled js file | |
484 | ||
485 | ||
486 | For details about how these options affect your build, see | |
487 | ||
488 | ${basedir}/.sencha/app/build-impl.xml | |
489 | ||
490 | These options can be stored in a local.properties file in this folder or in the | |
491 | local.properties file in the workspace. | |
492 | ||
493 | Alternatively, these can be supplied on the command line. For example: | |
494 | ||
495 | ant -Dskip.sass=1 build | |
496 | ||
497 | To see all currently defined properties, do this: | |
498 | ||
499 | ant .props | |
500 | ]]></echo> | |
501 | </target> | |
502 | ||
503 | </project> |