1 <project name=
"init-impl">
5 <target name=
"-before-init-local"/>
6 <target name=
"-init-local">
8 ${basedir} is actually the basedir of build.xml, in the app root
9 so this imports ${app.dir}/local.properties, if present
11 <property file=
"${basedir}/local.properties"/>
14 This will traverse upwards in the file system, starting at the
15 app root directory, looking for the workspace. Once found,
16 ${workspace.dir}/local.properties will be imported into this
19 <script language=
"javascript">
21 var f = new java.io.File(project.getProperty(
"basedir"));
22 var sub =
".sencha/workspace/sencha.cfg";
24 for (var p = f; p; p = p.getParentFile()) {
25 var t = new java.io.File(p, sub);
27 // we found the workspace folder!
29 t = new java.io.File(p,
"local.properties");
31 var loader = project.createTask(
"property");
32 loader.setFile(new java.io.File(t.getCanonicalPath()));
43 <target name=
"-after-init-local"/>
44 <target name=
"init-local"
45 depends=
"-before-init-local,-init-local,-after-init-local"/>
47 <target name=
"-before-init"/>
48 <target name=
"-init" unless=
"internal.x-sencha-initialized">
50 Now, apply various project updates, such as ant class loader path
51 updates, as well as loading Sencha Cmd config system properties
52 into ant property space
54 <x-sencha-init prefix=
""/>
57 default the build environment to production if it is unset by this point
59 <property name=
"build.environment" value=
"production"/>
60 <property name=
"CR" value=
" "/>
63 <!-- sets DSTAMP=yyyyMMdd, TSTAMP=hhmm -->
64 <format property=
"build.year" pattern=
"yyyy"/>
65 <format property=
"build.datetime" pattern=
"yyyy-MM-dd HH:mm:ss"/>
66 <format property=
"build.date" pattern=
"MMMM d, yyyy"/>
67 <format property=
"build.timestamp" pattern=
"yyyyMMddHHmmss"/>
71 <!-- If available, load user-defined properties for this build identifier -->
72 <file path=
"${app.config.dir}/${build.id}.properties" required=
"false"/>
73 <file path=
"${app.config.dir}/${app.locale}.properties" required=
"false"/>
74 <file path=
"${app.config.dir}/${app.theme}.properties" required=
"false"/>
75 <file path=
"${app.config.dir}/${build.name}.properties" required=
"false"/>
76 <file path=
"${app.config.dir}/multi-build.properties" required=
"false"/>
77 <!-- Load user-defined properties for environment then general: -->
78 <file path=
"${app.config.dir}/${build.environment}.properties" required=
"false"/>
79 <file path=
"${app.config.dir}/build.properties" required=
"false"/>
80 <!-- Pick up the defaults by framework/environment followed by general: -->
81 <file path=
"${app.config.dir}/${framework.name}.properties" required=
"true"/>
82 <file path=
"${app.config.dir}/${app.packager}.defaults.properties" required=
"false"/>
83 <file path=
"${app.config.dir}/${build.environment}.defaults.properties" required=
"true"/>
84 <file path=
"${app.config.dir}/defaults.properties" required=
"true"/>
88 calculate the appropriate build.compression value
90 <condition property=
"build.compression" value=
"-yui">
92 <x-is-true value=
"${build.compression.yui}"/>
93 <equals arg1=
"yui" arg2=
"${app.compressor.type}"/>
97 <condition property=
"build.compression" value=
"-closure">
99 <x-is-true value=
"${build.compression.closure}"/>
100 <equals arg1=
"closure" arg2=
"${app.compressor.type}"/>
104 <condition property=
"build.compression" value=
"-uglify">
106 <x-is-true value=
"${build.compression.uglify}"/>
107 <equals arg1=
"uglify" arg2=
"${app.compressor.type}"/>
111 <property name=
"build.compression" value=
""/>
114 this id string is used to share a common compiler instance
115 for all x-compile calls in this project
117 <property name=
"compiler.ref.id" value=
"app-compiler"/>
120 this property is set indicating we've reached the end of the
121 core init phase. it's presence will indicate that we've already
122 executed this target, and will bypass firing the init code
123 repeatedly in sub projects (antcall, x-ant-call)
124 See the above 'unless' attribute on the -init target
126 <property name=
"internal.x-sencha-initialized" value=
"true"/>
129 this is a helper property that is the relative path prefix from the
130 application's root directory to the root of the build directory
132 <x-get-relative-path from=
"${app.dir}"
133 to=
"${build.out.base.path}"
134 property=
"build.dir.relative"/>
138 <isset property=
"app.toolkit"/>
140 <property name=
"app.sass.fashion" value=
"true"/>
144 <property name=
"app.sass.fashion" value=
"false"/>
145 <property name=
"app.sass.rhino" value=
"false"/>
146 <property name=
"app.sass.dynamic" value=
"false"/>
148 <target name=
"-after-init"/>
150 <target name=
"-before-init-defaults"/>
151 <target name=
"-init-defaults">
153 This property can be modified to change general build options
154 such as excluding files from the set. The format expects newlines
155 for each argument, for example:
157 <property name="build.operations"/>
162 <property name=
"build.operations" value=
""/>
165 This property can be modified to change concatenation
168 -strip-comments: comment suppression
169 -remove-text-references: transform string literal class references to objects
170 -beautify: unpack the source
172 <property name="build.concat.options"/>
174 -remove-text-references
178 <property name=
"build.concat.options" value=
""/>
181 This property can be modified to change page compilation options
183 -scripts: inject the given script path into the generated markup ahead of the all classes file
185 <property name="build.page.options"/>
186 -scripts=framework.js
189 <property name=
"build.page.options" value=
""/>
192 <dirname property=
"build.out.page.dir" file=
"${build.out.page.path}"/>
193 <dirname property=
"build.out.js.dir" file=
"${build.out.js.path}"/>
194 <dirname property=
"build.out.framework.dir" file=
"${build.out.framework.path}"/>
195 <dirname property=
"build.out.css.dir" file=
"${build.out.css.path}"/>
196 <dirname property=
"build.out.microloader.dir" file=
"${build.out.microloader.path}"/>
197 <dirname property=
"build.out.manifest.dir" file=
"${build.out.manifest.path}"/>
198 <dirname property=
"build.out.metadata.dir" file=
"${build.out.metadata.path}"/>
200 <dirname property=
"build.bootstrap.page.dir" file=
"${build.bootstrap.page.path}"/>
201 <dirname property=
"build.bootstrap.css.dir" file=
"${build.bootstrap.css.path}"/>
202 <dirname property=
"build.bootstrap.microloader.dir" file=
"${build.bootstrap.microloader.path}"/>
203 <dirname property=
"build.bootstrap.manifest.dir" file=
"${build.bootstrap.manifest.path}"/>
204 <dirname property=
"build.bootstrap.metadata.dir" file=
"${build.bootstrap.metadata.path}"/>
206 <x-get-relative-path from=
"${build.out.base.path}" to=
"${build.out.js.path}" property=
"build.classes.name"/>
207 <x-get-relative-path from=
"${build.out.page.dir}" to=
"${build.out.microloader.path}" property=
"build.microloader.name"/>
208 <x-get-relative-path from=
"${build.out.page.dir}" to=
"${build.out.manifest.path}" property=
"app.manifest.name"/>
209 <x-get-relative-path from=
"${build.out.page.dir}" to=
"${build.out.appCache.path}" property=
"build.out.appCache.name"/>
212 <x-is-true value=
"${app.output.microloader.enable}"/>
214 <property name=
"build.output.markuponly" value=
"false"/>
217 <property name=
"build.output.markuponly" value=
"true"/>
222 <equals arg1=
"${app.toolkit}" arg2=
"modern"/>
224 <property name=
"skip.slice" value=
"1"/>
229 <!--If AppCache is FALSE or non-existent skip it-->
231 <x-is-false value=
"${app.output.appCache.enable}"/>
233 <isset property=
"app.output.appCache.enable"/>
237 <property name=
"skip.appCache" value=
"1"/>
242 <!--If Deltas are FALSE, deltas do not exist, or caching is disabled then skip delta patching-->
244 <x-is-false value=
"${app.cache.enable}"/>
245 <!-- This was done because deltas is possibly a boolean OR a string. x-is-false on any normal string appears a falsey value-->
246 <equals arg1=
"${app.cache.deltas}" arg2=
"false"/>
248 <isset property=
"app.cache.deltas"/>
252 <property name=
"skip.deltas" value=
"1"/>
256 <!-- If Deltas are True, 'yes' or 'on' default to 'deltas' otherwise set the appropriate delta path -->
258 <x-is-true value=
"${app.cache.deltas}"/>
260 <property name=
"build.out.deltas.path" location=
"${build.out.base.path}/deltas"/>
263 <property name=
"build.out.deltas.path" location=
"${build.out.base.path}/${app.cache.deltas}"/>
269 <!--<equals arg1="${build.environment}" arg2="development"/>-->
272 <!--<property name="skip.refresh" value="true"/>-->
277 <target name=
"-after-init-defaults"/>
280 Initializes the compiler instances, reading in the app.json and package.json
281 definitions, as well as scanning and parsing all js files found on the
282 various classpath entries for the framework, workspace, packages, and app
284 <target name=
"-init-compiler" depends=
"-init">
285 <local name=
"include.versions.file"/>
286 <local name=
"include.versions.file.command"/>
288 <condition property=
"internal.app.css.rel" value=
"${app.out.css.rel}">
289 <x-is-true value=
"${enable.ext42.themes}"/>
291 <property name=
"internal.app.css.rel" value=
""/>
293 <property name=
"include.versions.file.command">
297 -out=${build.out.package.versions}
300 -path=${build.out.package.versions}
306 -requires=${build.out.package.versions}
312 <property name=
"exclude.boot.command">
320 <condition property=
"include.versions.file" value=
"${include.versions.file.command}">
321 <x-is-false value=
"${build.skip.versions.file}"/>
324 <property name=
"include.versions.file" value=
"#skip"/>
326 <condition property=
"exclude.boot" value=
"${exclude.boot.command}">
328 <x-is-true value=
"${build.output.markuponly}"/>
332 <property name=
"exclude.boot" value=
"#skip"/>
334 <x-compile refid=
"${compiler.ref.id}"
340 -tempDir=${build.compile.temp.dir}
341 -keepTempDir=${build.compile.temp.dir.keep}
342 -options=${build.options}
344 -splitFramework=${enable.split.mode}
345 -frameworkFile=${build.framework.name}
346 -jsBundleFile=${build.classes.name}
347 -cssBundleFile=${internal.app.css.rel}
348 -tempDir=${build.app.temp.dir}
349 -tag=${build.tag.name}
354 ${include.versions.file}
357 -tag=${build.tag.name}
360 ${build.tag.name}-overrides
371 <target name=
"-init-app-js-files" depends=
"-init-compiler">
372 <x-compile refid=
"${compiler.ref.id}">
376 -tag=${build.tag.name}
379 ${build.tag.name}-overrides
390 <target name=
"-init-web-server">
391 <x-server port=
"${build.web.port}"
392 portPropertyName=
"build.web.port"
393 defaultSassFile=
"${app.out.scss}"
394 defaultCssFile=
"${app.out.css}"
395 refid=
"app.web.server"
396 saveVariablesProp=
"app.sass.save">
397 <mapping name=
"~cmd" path=
"${cmd.dir}"/>
398 <mapping name=
"" path=
"${build.web.root}"/>
400 <x-echo>Application available at http://localhost:${build.web.port}
</x-echo>