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