1 <project name=
"x-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"/>
50 <target name=
"-before-apply-version"/>
51 <target name=
"-after-apply-version"/>
52 <target name=
"apply-version" if=
"build.version">
53 <echo>Switch package version to ${build.version}
</echo>
54 <antcall target=
"-before-apply-version"/>
56 <x-set-json-version file=
"${basedir}/package.json"
57 version=
"${build.version}"/>
59 <antcall target=
"-after-apply-version"/>
62 <target name=
"-before-init"/>
63 <target name=
"-init" unless=
"internal.x-sencha-initialized">
64 <antcall target=
"apply-version"/>
67 Now, apply various project updates, such as ant class loader path
68 updates, as well as loading Sencha Cmd config system properties
69 into ant property space
71 <x-sencha-init prefix=
""/>
74 default the build environment to production if it is unset by this point
76 <property name=
"build.environment" value=
"production"/>
77 <property name=
"CR" value=
" "/>
78 <property name=
"build.version" value=
"${package.version}"/>
81 <file path=
"${package.config.dir}/${build.environment}.properties" required=
"false"/>
82 <file path=
"${package.config.dir}/build.properties" required=
"false"/>
83 <file path=
"${package.config.dir}/defaults.properties" required=
"true"/>
87 See if there is a ./resources subfolder
91 <available file=
"${package.resources.dir}" type=
"dir"/>
94 <property name=
"skip.resources" value=
"1"/>
95 <property name=
"skip.slice" value=
"1"/>
101 See if there is a ./sass subfolder
105 <available file=
"${package.sass.dir}" type=
"dir"/>
108 <property name=
"skip.sass" value=
"1"/>
113 Slicing operations are not needed when using the touch framework
114 or for non-theme packages
119 <equals arg1=
"theme" arg2=
"${package.type}"/>
121 <equals arg1=
"touch" arg2=
"${framework.name}"/>
124 <property name=
"skip.slice" value=
"1"/>
129 See if there is an ./examples subfolder full of example applications.
134 <available file=
"${package.examples.dir}" type=
"dir"/>
137 <isset property=
"package.example.path"/>
141 <property name=
"skip.examples" value=
"1"/>
146 See if there is a ./packages subfolder full of packages. This is only allowed
147 for framework packages.
153 <equals arg1=
"${package.type}" arg2=
"framework"/>
154 <equals arg1=
"${package.type}" arg2=
"toolkit"/>
156 <available file=
"${package.subpkgs.dir}" type=
"dir"/>
160 <property name=
"skip.subpkgs" value=
"1"/>
166 <isset property=
"package.framework"/>
169 <property name=
"skip.style" value=
"1"/>
174 <isset property=
"skip.style"/>
176 <property name=
"skip.sass" value=
"1"/>
177 <property name=
"skip.capture" value=
"1"/>
178 <property name=
"skip.slice" value=
"1"/>
184 <isset property=
"package.base.names"/>
187 <property name=
"skip.inherit" value=
"1"/>
192 this id string is used to share a common compiler instance
193 for all x-compile calls in this project
195 <property name=
"compiler.ref.id" value=
"package-compiler"/>
197 <fileset id=
"pkg.files"
199 includes=
"${pkg.includes}"
200 excludes=
"${pkg.excludes}">
201 <exclude name=
"**/.sass-cache/**/*"/>
202 <exclude name=
"**/.sass-cache"/>
203 <exclude name=
"**/theme-capture.*"/>
208 <isset property=
"package.toolkit"/>
210 <property name=
"package.sass.fashion" value=
"true"/>
214 <property name=
"package.sass.fashion" value=
"false"/>
215 <property name=
"package.sass.rhino" value=
"false"/>
216 <property name=
"package.sass.dynamic" value=
"false"/>
219 this property is set indicating we've reached the end of the
220 core init phase. it's presence will indicate that we've already
221 executed this target, and will bypass firing the init code
222 repeatedly in sub projects (antcall, x-ant-call)
223 See the above 'unless' attribute on the -init target
225 <property name=
"internal.x-sencha-initialized" value=
"true"/>
227 <target name=
"-after-init"/>
229 <target name=
"-before-init-defaults"/>
230 <target name=
"-init-defaults">
232 This property can be modified to change general build options
233 such as excluding files from the set. The format expects newlines
234 for each argument, for example:
236 <property name="build.operations"/>
241 <property name=
"build.operations" value=
""/>
244 This property can be modified to change concatenation
247 -strip-comments: comment suppression
248 -remove-text-references: transform string literal class references to objects
249 -beautify: unpack the source
251 <property name="build.concat.options"/>
253 -remove-text-references
257 <property name=
"build.concat.options" value=
""/>
258 <property name=
"build.concat.debug.options" value=
""/>
260 <property name=
"build.pkg.manifest" value=
"pkg.files"/>
262 <target name=
"-after-init-defaults"/>
265 Initializes the compiler instances, reading in the app.json and package.json
266 definitions, as well as scanning and parsing all js files found on the
267 various classpath entries for the framework, workspace, packages, and app
269 <target name=
"-init-compiler" depends=
"-init">
270 <x-compile refid=
"${compiler.ref.id}"
276 -tempDir=${build.compile.temp.dir}
277 -keepTempDir=${build.compile.temp.dir.keep}
282 package-${package.name}-all
287 <target name=
"-init-web-server">
288 <x-server port=
"${build.web.port}"
289 portPropertyName=
"build.web.port"
290 defaultSassFile=
"${package.example.scss}"
291 defaultCssFile=
"${package.example.css}"
292 refid=
"package.web.server">
293 <mapping name=
"~cmd" path=
"${cmd.dir}"/>
294 <mapping name=
"" path=
"${build.web.root}"/>
296 <x-echo>Package web server available at http://localhost:${build.web.port}
</x-echo>