]>
Commit | Line | Data |
---|---|---|
6527f429 DM |
1 | <project name="init-impl">\r |
2 | <!--\r | |
3 | Init-Local\r | |
4 | -->\r | |
5 | <target name="-before-init-local"/>\r | |
6 | <target name="-init-local">\r | |
7 | <!--\r | |
8 | ${basedir} is actually the basedir of build.xml, in the app root\r | |
9 | so this imports ${app.dir}/local.properties, if present\r | |
10 | -->\r | |
11 | <property file="${basedir}/local.properties"/>\r | |
12 | \r | |
13 | <!--\r | |
14 | This will traverse upwards in the file system, starting at the\r | |
15 | app root directory, looking for the workspace. Once found, \r | |
16 | ${workspace.dir}/local.properties will be imported into this\r | |
17 | project\r | |
18 | -->\r | |
19 | <script language="javascript">\r | |
20 | <![CDATA[\r | |
21 | var f = new java.io.File(project.getProperty("basedir"));\r | |
22 | var sub = ".sencha/workspace/sencha.cfg";\r | |
23 | \r | |
24 | for (var p = f; p; p = p.getParentFile()) {\r | |
25 | var t = new java.io.File(p, sub);\r | |
26 | if (t.exists()) {\r | |
27 | // we found the workspace folder!\r | |
28 | \r | |
29 | t = new java.io.File(p, "local.properties");\r | |
30 | if (t.exists()) {\r | |
31 | var loader = project.createTask("property");\r | |
32 | loader.setFile(new java.io.File(t.getCanonicalPath()));\r | |
33 | loader.execute();\r | |
34 | }\r | |
35 | \r | |
36 | break;\r | |
37 | }\r | |
38 | }\r | |
39 | ]]>\r | |
40 | </script>\r | |
41 | \r | |
42 | </target>\r | |
43 | <target name="-after-init-local"/>\r | |
44 | <target name="init-local"\r | |
45 | depends="-before-init-local,-init-local,-after-init-local"/>\r | |
46 | \r | |
47 | <target name="-before-init"/>\r | |
48 | <target name="-init" unless="internal.x-sencha-initialized">\r | |
49 | <!--\r | |
50 | Now, apply various project updates, such as ant class loader path\r | |
51 | updates, as well as loading Sencha Cmd config system properties\r | |
52 | into ant property space\r | |
53 | -->\r | |
54 | <x-sencha-init prefix=""/>\r | |
55 | \r | |
56 | <!-- \r | |
57 | default the build environment to production if it is unset by this point \r | |
58 | -->\r | |
59 | <property name="build.environment" value="production"/>\r | |
60 | <property name="CR" value=" "/>\r | |
61 | \r | |
62 | <tstamp>\r | |
63 | <!-- sets DSTAMP=yyyyMMdd, TSTAMP=hhmm -->\r | |
64 | <format property="build.year" pattern="yyyy"/>\r | |
65 | <format property="build.datetime" pattern="yyyy-MM-dd HH:mm:ss"/>\r | |
66 | <format property="build.date" pattern="MMMM d, yyyy"/>\r | |
67 | <format property="build.timestamp" pattern="yyyyMMddHHmmss"/>\r | |
68 | </tstamp>\r | |
69 | \r | |
70 | <x-load-properties>\r | |
71 | <!-- If available, load user-defined properties for this build identifier -->\r | |
72 | <file path="${app.config.dir}/${build.id}.properties" required="false"/>\r | |
73 | <file path="${app.config.dir}/${app.locale}.properties" required="false"/>\r | |
74 | <file path="${app.config.dir}/${app.theme}.properties" required="false"/>\r | |
75 | <file path="${app.config.dir}/${build.name}.properties" required="false"/>\r | |
76 | <file path="${app.config.dir}/multi-build.properties" required="false"/>\r | |
77 | <!-- Load user-defined properties for environment then general: -->\r | |
78 | <file path="${app.config.dir}/${build.environment}.properties" required="false"/>\r | |
79 | <file path="${app.config.dir}/build.properties" required="false"/>\r | |
80 | <!-- Pick up the defaults by framework/environment followed by general: -->\r | |
81 | <file path="${app.config.dir}/${framework.name}.properties" required="true"/>\r | |
82 | <file path="${app.config.dir}/${app.packager}.defaults.properties" required="false"/>\r | |
83 | <file path="${app.config.dir}/${build.environment}.defaults.properties" required="true"/>\r | |
84 | <file path="${app.config.dir}/defaults.properties" required="true"/>\r | |
85 | </x-load-properties>\r | |
86 | \r | |
87 | <!--\r | |
88 | calculate the appropriate build.compression value\r | |
89 | -->\r | |
90 | <condition property="build.compression" value="-yui">\r | |
91 | <or>\r | |
92 | <x-is-true value="${build.compression.yui}"/>\r | |
93 | <equals arg1="yui" arg2="${app.compressor.type}"/>\r | |
94 | </or>\r | |
95 | </condition>\r | |
96 | \r | |
97 | <condition property="build.compression" value="-closure">\r | |
98 | <or>\r | |
99 | <x-is-true value="${build.compression.closure}"/>\r | |
100 | <equals arg1="closure" arg2="${app.compressor.type}"/>\r | |
101 | </or>\r | |
102 | </condition>\r | |
103 | \r | |
104 | <condition property="build.compression" value="-uglify">\r | |
105 | <or>\r | |
106 | <x-is-true value="${build.compression.uglify}"/>\r | |
107 | <equals arg1="uglify" arg2="${app.compressor.type}"/>\r | |
108 | </or>\r | |
109 | </condition>\r | |
110 | \r | |
111 | <property name="build.compression" value=""/>\r | |
112 | \r | |
113 | <!--\r | |
114 | this id string is used to share a common compiler instance\r | |
115 | for all x-compile calls in this project\r | |
116 | -->\r | |
117 | <property name="compiler.ref.id" value="app-compiler"/>\r | |
118 | \r | |
119 | <!--\r | |
120 | this property is set indicating we've reached the end of the\r | |
121 | core init phase. it's presence will indicate that we've already\r | |
122 | executed this target, and will bypass firing the init code\r | |
123 | repeatedly in sub projects (antcall, x-ant-call)\r | |
124 | See the above 'unless' attribute on the -init target\r | |
125 | -->\r | |
126 | <property name="internal.x-sencha-initialized" value="true"/>\r | |
127 | \r | |
128 | <!-- \r | |
129 | this is a helper property that is the relative path prefix from the \r | |
130 | application's root directory to the root of the build directory\r | |
131 | -->\r | |
132 | <x-get-relative-path from="${app.dir}"\r | |
133 | to="${build.out.base.path}"\r | |
134 | property="build.dir.relative"/>\r | |
135 | \r | |
136 | \r | |
137 | <if>\r | |
138 | <isset property="app.toolkit"/>\r | |
139 | <then>\r | |
140 | <property name="app.sass.fashion" value="true"/>\r | |
141 | </then>\r | |
142 | </if>\r | |
143 | \r | |
144 | <property name="app.sass.fashion" value="false"/>\r | |
145 | <property name="app.sass.rhino" value="false"/>\r | |
146 | <property name="app.sass.dynamic" value="false"/>\r | |
147 | </target>\r | |
148 | <target name="-after-init"/>\r | |
149 | \r | |
150 | <target name="-before-init-defaults"/>\r | |
151 | <target name="-init-defaults">\r | |
152 | <!--\r | |
153 | This property can be modified to change general build options\r | |
154 | such as excluding files from the set. The format expects newlines\r | |
155 | for each argument, for example:\r | |
156 | \r | |
157 | <property name="build.operations"/>\r | |
158 | exclude\r | |
159 | -namespace=Ext\r | |
160 | </property>\r | |
161 | -->\r | |
162 | <property name="build.operations" value=""/>\r | |
163 | \r | |
164 | <!--\r | |
165 | This property can be modified to change concatenation\r | |
166 | specific options\r | |
167 | \r | |
168 | -strip-comments: comment suppression\r | |
169 | -remove-text-references: transform string literal class references to objects\r | |
170 | -beautify: unpack the source\r | |
171 | \r | |
172 | <property name="build.concat.options"/>\r | |
173 | -strip-comments\r | |
174 | -remove-text-references\r | |
175 | -beautify\r | |
176 | </property>\r | |
177 | -->\r | |
178 | <property name="build.concat.options" value=""/>\r | |
179 | \r | |
180 | <!--\r | |
181 | This property can be modified to change page compilation options\r | |
182 | \r | |
183 | -scripts: inject the given script path into the generated markup ahead of the all classes file\r | |
184 | \r | |
185 | <property name="build.page.options"/>\r | |
186 | -scripts=framework.js\r | |
187 | </property>\r | |
188 | -->\r | |
189 | <property name="build.page.options" value=""/>\r | |
190 | \r | |
191 | \r | |
192 | <dirname property="build.out.page.dir" file="${build.out.page.path}"/>\r | |
193 | <dirname property="build.out.js.dir" file="${build.out.js.path}"/>\r | |
194 | <dirname property="build.out.framework.dir" file="${build.out.framework.path}"/>\r | |
195 | <dirname property="build.out.css.dir" file="${build.out.css.path}"/>\r | |
196 | <dirname property="build.out.microloader.dir" file="${build.out.microloader.path}"/>\r | |
197 | <dirname property="build.out.manifest.dir" file="${build.out.manifest.path}"/>\r | |
198 | <dirname property="build.out.metadata.dir" file="${build.out.metadata.path}"/>\r | |
199 | \r | |
200 | <dirname property="build.bootstrap.page.dir" file="${build.bootstrap.page.path}"/>\r | |
201 | <dirname property="build.bootstrap.css.dir" file="${build.bootstrap.css.path}"/>\r | |
202 | <dirname property="build.bootstrap.microloader.dir" file="${build.bootstrap.microloader.path}"/>\r | |
203 | <dirname property="build.bootstrap.manifest.dir" file="${build.bootstrap.manifest.path}"/>\r | |
204 | <dirname property="build.bootstrap.metadata.dir" file="${build.bootstrap.metadata.path}"/>\r | |
205 | \r | |
206 | <x-get-relative-path from="${build.out.base.path}" to="${build.out.js.path}" property="build.classes.name"/>\r | |
207 | <x-get-relative-path from="${build.out.page.dir}" to="${build.out.microloader.path}" property="build.microloader.name"/>\r | |
208 | <x-get-relative-path from="${build.out.page.dir}" to="${build.out.manifest.path}" property="app.manifest.name"/>\r | |
209 | <x-get-relative-path from="${build.out.page.dir}" to="${build.out.appCache.path}" property="build.out.appCache.name"/>\r | |
210 | \r | |
211 | <if>\r | |
212 | <x-is-true value="${app.output.microloader.enable}"/>\r | |
213 | <then>\r | |
214 | <property name="build.output.markuponly" value="false"/>\r | |
215 | </then>\r | |
216 | <else>\r | |
217 | <property name="build.output.markuponly" value="true"/>\r | |
218 | </else>\r | |
219 | </if>\r | |
220 | \r | |
221 | <if>\r | |
222 | <equals arg1="${app.toolkit}" arg2="modern"/>\r | |
223 | <then>\r | |
224 | <property name="skip.slice" value="1"/>\r | |
225 | </then>\r | |
226 | </if>\r | |
227 | \r | |
228 | <if>\r | |
229 | <!--If AppCache is FALSE or non-existent skip it-->\r | |
230 | <or>\r | |
231 | <x-is-false value="${app.output.appCache.enable}"/>\r | |
232 | <not>\r | |
233 | <isset property="app.output.appCache.enable"/>\r | |
234 | </not>\r | |
235 | </or>\r | |
236 | <then>\r | |
237 | <property name="skip.appCache" value="1"/>\r | |
238 | </then>\r | |
239 | </if>\r | |
240 | \r | |
241 | <if>\r | |
242 | <!--If Deltas are FALSE, deltas do not exist, or caching is disabled then skip delta patching-->\r | |
243 | <or>\r | |
244 | <x-is-false value="${app.cache.enable}"/>\r | |
245 | <!-- This was done because deltas is possibly a boolean OR a string. x-is-false on any normal string appears a falsey value-->\r | |
246 | <equals arg1="${app.cache.deltas}" arg2="false"/>\r | |
247 | <not>\r | |
248 | <isset property="app.cache.deltas"/>\r | |
249 | </not>\r | |
250 | </or>\r | |
251 | <then>\r | |
252 | <property name="skip.deltas" value="1"/>\r | |
253 | </then>\r | |
254 | </if>\r | |
255 | \r | |
256 | <!-- If Deltas are True, 'yes' or 'on' default to 'deltas' otherwise set the appropriate delta path -->\r | |
257 | <if>\r | |
258 | <x-is-true value="${app.cache.deltas}"/>\r | |
259 | <then>\r | |
260 | <property name="build.out.deltas.path" location="${build.out.base.path}/deltas"/>\r | |
261 | </then>\r | |
262 | <else>\r | |
263 | <property name="build.out.deltas.path" location="${build.out.base.path}/${app.cache.deltas}"/>\r | |
264 | </else>\r | |
265 | </if>\r | |
266 | \r | |
267 | <!--<if>-->\r | |
268 | <!--<not>-->\r | |
269 | <!--<equals arg1="${build.environment}" arg2="development"/>-->\r | |
270 | <!--</not>-->\r | |
271 | <!--<then>-->\r | |
272 | <!--<property name="skip.refresh" value="true"/>-->\r | |
273 | <!--</then>-->\r | |
274 | <!--</if>-->\r | |
275 | \r | |
276 | </target>\r | |
277 | <target name="-after-init-defaults"/>\r | |
278 | \r | |
279 | <!--\r | |
280 | Initializes the compiler instances, reading in the app.json and package.json\r | |
281 | definitions, as well as scanning and parsing all js files found on the\r | |
282 | various classpath entries for the framework, workspace, packages, and app\r | |
283 | -->\r | |
284 | <target name="-init-compiler" depends="-init">\r | |
285 | <local name="include.versions.file"/>\r | |
286 | <local name="include.versions.file.command"/>\r | |
287 | \r | |
288 | <condition property="internal.app.css.rel" value="${app.out.css.rel}">\r | |
289 | <x-is-true value="${enable.ext42.themes}"/>\r | |
290 | </condition>\r | |
291 | <property name="internal.app.css.rel" value=""/>\r | |
292 | \r | |
293 | <property name="include.versions.file.command">\r | |
294 | <![CDATA[\r | |
295 | meta\r | |
296 | +packages\r | |
297 | -out=${build.out.package.versions}\r | |
298 | and\r | |
299 | classpath\r | |
300 | -path=${build.out.package.versions}\r | |
301 | -name=framework\r | |
302 | and\r | |
303 | require\r | |
304 | -scopeName=framework\r | |
305 | -source=Ext.Base\r | |
306 | -requires=${build.out.package.versions}\r | |
307 | -allow-unmet=false\r | |
308 | and\r | |
309 | ]]>\r | |
310 | </property>\r | |
311 | \r | |
312 | <property name="exclude.boot.command">\r | |
313 | <![CDATA[\r | |
314 | exclude\r | |
315 | -class=Ext.Boot\r | |
316 | and\r | |
317 | ]]>\r | |
318 | </property>\r | |
319 | \r | |
320 | <condition property="include.versions.file" value="${include.versions.file.command}">\r | |
321 | <x-is-false value="${build.skip.versions.file}"/>\r | |
322 | </condition>\r | |
323 | \r | |
324 | <property name="include.versions.file" value="#skip"/>\r | |
325 | \r | |
326 | <condition property="exclude.boot" value="${exclude.boot.command}">\r | |
327 | <not>\r | |
328 | <x-is-true value="${build.output.markuponly}"/>\r | |
329 | </not>\r | |
330 | </condition>\r | |
331 | \r | |
332 | <property name="exclude.boot" value="#skip"/>\r | |
333 | \r | |
334 | <x-compile refid="${compiler.ref.id}"\r | |
335 | dir="${app.dir}"\r | |
336 | initOnly="true"\r | |
337 | inheritAll="true">\r | |
338 | <![CDATA[\r | |
339 | # base build command\r | |
340 | -tempDir=${build.compile.temp.dir}\r | |
341 | -keepTempDir=${build.compile.temp.dir.keep}\r | |
342 | -options=${build.options}\r | |
343 | load-app\r | |
344 | -splitFramework=${enable.split.mode}\r | |
345 | -frameworkFile=${build.framework.name}\r | |
346 | -jsBundleFile=${build.classes.name}\r | |
347 | -cssBundleFile=${internal.app.css.rel}\r | |
348 | -tempDir=${build.app.temp.dir}\r | |
349 | -tag=${build.tag.name}\r | |
350 | and\r | |
351 | restore\r | |
352 | ${build.tag.name} \r | |
353 | and\r | |
354 | ${include.versions.file}\r | |
355 | union\r | |
356 | -recursive\r | |
357 | -tag=${build.tag.name}\r | |
358 | and\r | |
359 | save\r | |
360 | ${build.tag.name}-overrides\r | |
361 | and\r | |
362 | ${build.operations}\r | |
363 | and\r | |
364 | ${exclude.boot}\r | |
365 | save\r | |
366 | page\r | |
367 | ]]>\r | |
368 | </x-compile>\r | |
369 | </target>\r | |
370 | \r | |
371 | <target name="-init-app-js-files" depends="-init-compiler">\r | |
372 | <x-compile refid="${compiler.ref.id}">\r | |
373 | <![CDATA[\r | |
374 | union\r | |
375 | -recursive\r | |
376 | -tag=${build.tag.name}\r | |
377 | and\r | |
378 | save\r | |
379 | ${build.tag.name}-overrides\r | |
380 | and\r | |
381 | ${build.operations}\r | |
382 | and\r | |
383 | ${exclude.boot}\r | |
384 | save\r | |
385 | page\r | |
386 | ]]>\r | |
387 | </x-compile>\r | |
388 | </target>\r | |
389 | \r | |
390 | <target name="-init-web-server">\r | |
391 | <x-server port="${build.web.port}" \r | |
392 | portPropertyName="build.web.port"\r | |
393 | defaultSassFile="${app.out.scss}"\r | |
394 | defaultCssFile="${app.out.css}"\r | |
395 | refid="app.web.server"\r | |
396 | saveVariablesProp="app.sass.save">\r | |
397 | <mapping name="~cmd" path="${cmd.dir}"/>\r | |
398 | <mapping name="" path="${build.web.root}"/>\r | |
399 | </x-server>\r | |
400 | <x-echo>Application available at http://localhost:${build.web.port}</x-echo>\r | |
401 | </target>\r | |
402 | \r | |
403 | </project>\r |