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.
133 <available file=
"${package.examples.dir}" type=
"dir"/>
136 <property name=
"skip.examples" value=
"1"/>
141 See if there is a ./packages subfolder full of packages. This is only allowed
142 for framework packages.
148 <equals arg1=
"${package.type}" arg2=
"framework"/>
149 <equals arg1=
"${package.type}" arg2=
"toolkit"/>
151 <available file=
"${package.subpkgs.dir}" type=
"dir"/>
155 <property name=
"skip.subpkgs" value=
"1"/>
161 <isset property=
"package.framework"/>
164 <property name=
"skip.style" value=
"1"/>
169 <isset property=
"skip.style"/>
171 <property name=
"skip.sass" value=
"1"/>
172 <property name=
"skip.capture" value=
"1"/>
173 <property name=
"skip.slice" value=
"1"/>
179 <isset property=
"package.base.names"/>
182 <property name=
"skip.inherit" value=
"1"/>
187 this id string is used to share a common compiler instance
188 for all x-compile calls in this project
190 <property name=
"compiler.ref.id" value=
"package-compiler"/>
192 <fileset id=
"pkg.files"
194 includes=
"${pkg.includes}"
195 excludes=
"${pkg.excludes}">
196 <exclude name=
"**/.sass-cache/**/*"/>
197 <exclude name=
"**/.sass-cache"/>
198 <exclude name=
"**/theme-capture.*"/>
203 <isset property=
"package.toolkit"/>
205 <property name=
"package.sass.fashion" value=
"true"/>
209 <property name=
"package.sass.fashion" value=
"false"/>
210 <property name=
"package.sass.rhino" value=
"false"/>
211 <property name=
"package.sass.dynamic" value=
"false"/>
214 this property is set indicating we've reached the end of the
215 core init phase. it's presence will indicate that we've already
216 executed this target, and will bypass firing the init code
217 repeatedly in sub projects (antcall, x-ant-call)
218 See the above 'unless' attribute on the -init target
220 <property name=
"internal.x-sencha-initialized" value=
"true"/>
222 <target name=
"-after-init"/>
224 <target name=
"-before-init-defaults"/>
225 <target name=
"-init-defaults">
227 This property can be modified to change general build options
228 such as excluding files from the set. The format expects newlines
229 for each argument, for example:
231 <property name="build.operations"/>
236 <property name=
"build.operations" value=
""/>
239 This property can be modified to change concatenation
242 -strip-comments: comment suppression
243 -remove-text-references: transform string literal class references to objects
244 -beautify: unpack the source
246 <property name="build.concat.options"/>
248 -remove-text-references
252 <property name=
"build.concat.options" value=
""/>
253 <property name=
"build.concat.debug.options" value=
""/>
255 <property name=
"build.pkg.manifest" value=
"pkg.files"/>
257 <target name=
"-after-init-defaults"/>
260 Initializes the compiler instances, reading in the app.json and package.json
261 definitions, as well as scanning and parsing all js files found on the
262 various classpath entries for the framework, workspace, packages, and app
264 <target name=
"-init-compiler" depends=
"-init">
265 <x-compile refid=
"${compiler.ref.id}"
271 -tempDir=${build.compile.temp.dir}
272 -keepTempDir=${build.compile.temp.dir.keep}
277 package-${package.name}-all
282 <target name=
"-init-web-server">
283 <x-server port=
"${build.web.port}"
284 portPropertyName=
"build.web.port"
285 defaultSassFile=
"${package.example.scss}"
286 defaultCssFile=
"${package.example.css}"
287 refid=
"package.web.server">
288 <mapping name=
"~cmd" path=
"${cmd.dir}"/>
289 <mapping name=
"" path=
"${build.web.root}"/>
291 <x-echo>Package web server available at http://localhost:${build.web.port}
</x-echo>