1 <project name=
"x-slice-impl">
3 <target name=
"-load-sass-page"
4 depends=
"-detect-app-build-properties,
5 -generate-slicer-bootstrap,
6 -generate-slicer-manifest">
7 <x-run-if-true value=
"${app.sass.fashion}">
9 <x-is-false value=
"${app.sass.rhino}"/>
11 <x-get-relative-path from=
"${build.web.root}"
12 to=
"${app.example.fashion.html}"
13 property=
"app.example.fashion.html.relative"/>
14 <property name=
"example.page.url"
15 value=
"http://localhost:${build.web.port}/${app.example.fashion.html.relative}"/>
16 <x-sass-page page=
"${app.example.fashion.html}"
17 url=
"${example.page.url}"
18 refId=
"app.web.server"/>
25 Uses the compiler to generate a special theme-only scss file containing
26 rules for all framework / package / app components. This is then used
27 by the slicer example page to capture theme sprites
29 <target name=
"-compile-slicer-sass" depends=
"-init-compiler">
30 <local name=
"app.example.scss.tmp"/>
31 <property name=
"app.example.scss.tmp" value=
"${app.example.scss}.tmp"/>
33 path=
"${build.out.resources.dir}"
34 property=
"image.search.path"/>
36 <local name=
"var.begin"/>
37 <local name=
"var.end"/>
39 <condition property=
"var.begin" value=
"dynamic(">
40 <isset property=
"framework.isV6"/>
42 <condition property=
"var.end" value=
")">
43 <isset property=
"framework.isV6"/>
46 <property name=
"var.begin" value=
""/>
47 <property name=
"var.end" value=
"!default"/>
49 <x-compile refid=
"${compiler.ref.id}">
62 -variable=$app-name: ${var.begin} '${app.name}' ${var.end}
63 -variable=$image-search-path:'${image.search.path}'
64 -variable=$theme-name: ${var.begin} '${theme.name}' ${var.end}
65 -output=${app.example.scss.tmp}
66 -forward=${app.sass.dynamic}
73 -output=${app.example.out.ruby}
79 <filesmatch file1=
"${app.example.scss.tmp}" file2=
"${app.example.scss}"/>
82 <copy file=
"${app.example.scss.tmp}" tofile=
"${app.example.scss}" overwrite=
"true"/>
86 <x-get-relative-path from=
"${app.example.dir}"
87 to=
"${app.example.css}"
88 property=
"app.example.css.path"/>
90 <!--update the app's example to point to the build output-->
91 <echo file=
"${app.example.css.file}">
94 * This file is generated by Sencha Cmd and should NOT be edited. It redirects
95 * to the most recently built CSS file for the application to allow theme.html
96 * to load properly for image slicing (required to support non-CSS3 browsers
97 * such as IE9 and below).
99 @import '${app.example.css.path}';
105 Compiles the scss file for the theme slicer page
107 <target name=
"-compass-compile-slicer-css" depends=
"-compile-slicer-sass">
109 <x-is-true value=
"${app.sass.fashion}"/>
112 <x-is-true value=
"${app.sass.rhino}"/>
115 file=
"${app.example.build.dir}"
116 toFile=
"${app.example.build.dir}"/>
119 <x-sass-build input=
"${app.example.build.dir}"
120 output=
"${app.example.build.dir}"
121 refId=
"app.web.server"
128 dir=
"${app.example.build.dir}"
129 trace=
"${compass.compile.trace}"
130 boring=
"${compass.compile.boring}"
131 force=
"${compass.compile.force}"
132 sassdir=
"${app.example.build.dir}"
133 cssdir=
"${app.example.build.dir}"
134 config=
"${app.example.compass.config}"/>
139 <!-- Produces a bootstrap.js file for ext 4.2 slicer pages -->
140 <target name=
"-generate-slicer-bootstrap" unless=
"framework.isV5">
141 <local name=
"relpath"/>
142 <x-get-relative-path from=
"${bootstrap.base.path}"
143 to=
"${framework.packages.dir}"
146 <x-bootstrap file=
"${bootstrap.example.js}"
147 basedir=
"${bootstrap.base.path}"
149 includeCoreFiles=
"true"
150 overrideTpl=
"${bootstrap.override.tpl}"
151 overrideTplType=
"${bootstrap.override.tpltype}"
152 overrideExcludeTags=
"">
156 "${relpath}/ext-theme-base/sass/example/manifest.js",
157 "${relpath}/ext-theme-base/sass/example/shortcuts.js",
165 <!-- Produces a bootstrap.js / bootstrap.json pair for ext 5 slicer pages -->
166 <target name=
"-generate-slicer-manifest" if=
"framework.isV5" depends=
"-detect-app-build-properties">
167 <local name=
"manifest.root.excludes"/>
168 <condition property=
"manifest.root.excludes" value=
"${app.bootstrap.manifest.exclude}">
169 <isset property=
"app.bootstrap.manifest.exclude"/>
171 <property name=
"manifest.root.excludes" value=
""/>
174 <x-is-true value=
"${app.has.js.sdk}"/>
176 <property name=
"manifest.bootstrap.js.exclude">
178 -tag=framework,package-sencha-core,package-core,package-${toolkit.name}
180 <x-compile refid=
"${compiler.ref.id}">
185 ${manifest.bootstrap.js.exclude}
191 <condition property=
"remove.slicer.css.bootstrap.entries" value=
"true">
193 <x-is-true value=
"${app.sass.fashion}"/>
194 <x-is-false value=
"${app.sass.rhino}"/>
197 <property name=
"remove.slicer.css.bootstrap.entries" value=
"false"/>
199 <x-compile refid=
"${compiler.ref.id}">
202 -exclude=${manifest.root.excludes}
203 -removeBootstrapCssEntries=${remove.slicer.css.bootstrap.entries}
205 -basePath=${bootstrap.base.path}
206 -cssFile=${app.example.css.file}
207 -out=${bootstrap.example.json}
210 -operation=microloader
211 -microloaderPath=${build.slicer.microloader.file}
212 -bootPath=${build.boot.file}
213 -out=${bootstrap.example.js}
218 <target name=
"-capture-theme-image">
221 <x-is-false value=
"${app.sass.fashion}"/>
222 <x-is-true value=
"${app.sass.rhino}"/>
225 <echo>Capture theme image to ${build.capture.png}
</echo>
230 -page=${app.example.theme.html}
231 -image=${build.capture.png}
232 -manifest=${build.capture.json}
239 <target name=
"-capture-sass-page-image">
242 <x-is-true value=
"${app.sass.fashion}"/>
243 <x-is-false value=
"${app.sass.rhino}"/>
246 <echo>Capture theme image to ${build.capture.png}
</echo>
247 <x-capture-slicer-data manifestPath=
"${build.capture.json}"
248 imagePath=
"${build.capture.png}"
249 refId=
"app.web.server"/>
254 <target name=
"-slice-theme-images">
255 <echo>Slicing theme images to ${build.resources.dir}
</echo>
260 ${build.slice.options}
261 -image=${build.capture.png}
262 -manifest=${build.capture.json}
263 -out=${build.out.slicer.path}
270 Generates theme images for Ext JS 4.2+ apps using theme packages
271 '-detect-app-build-properties' is defined in js-impl.xml
273 <target name=
"-slice-app-theme"
274 depends=
"-load-sass-page,
275 -compass-compile-slicer-css,
276 -capture-sass-page-image,
277 -capture-theme-image,
278 -slice-theme-images">
281 <macrodef name=
"x-build-theme">
282 <attribute name=
"theme" description=
"the path of the theme folder"/>
283 <attribute name=
"buildsass" default=
"false"/>
284 <attribute name=
"basetheme" default=
"default"/>
286 <local name=
"theme.name"/>
288 <local name=
"framework.theme.dir"/>
289 <local name=
"tmp.theme.dir"/>
290 <local name=
"tmp.img.dir"/>
292 <basename property=
"theme.name" file=
"@{theme}"/>
293 <local name=
"theme.base.name"/>
294 <property name=
"theme.base.name" value=
"${theme.name}"/>
295 <property name=
"theme.images.dir" location=
"@{theme}/images"/>
296 <property name=
"theme.page.dir" location=
"@{theme}/${theme.page.name}"/>
298 <property name=
"tmp.res.dir" value=
"${app.resources.dir}"/>
299 <property name=
"tmp.theme.dir" value=
"${tmp.res.dir}/${theme.base.name}"/>
300 <property name=
"tmp.img.dir" value=
"${tmp.theme.dir}/images"/>
302 <property name=
"app.res.dir" location=
"${app.dir}/packages"/>
303 <property name=
"app.img.dir" location=
"${app.res.dir}/images"/>
305 <property name=
"framework.res.dir" location=
"${framework.dir}/resources"/>
306 <property name=
"framework.img.dir" location=
"${framework.res.dir}/themes/images"/>
307 <property name=
"framework.theme.dir" location=
"${framework.img.dir}/@{basetheme}"/>
309 <echo>Copying base framework images from ${framework.theme.dir} to ${tmp.img.dir}
</echo>
310 <copy todir=
"${tmp.img.dir}">
311 <fileset dir=
"${framework.theme.dir}" includes=
"**/*"/>
315 <equals arg1=
"@{buildsass}" arg2=
"true"/>
317 <echo>Building sass for theme ${theme.name}
</echo>
318 <!--x-build-sass is defined in sass-impl.xml-->
319 <x-build-sass theme=
"@{theme}"/>
323 <echo>Slicing images for theme ${theme.name} to ${tmp.img.dir}
</echo>
328 -data-file=${build.capture.json}
329 -image-file=${build.capture.png}
330 -page=${theme.page.dir}
336 <available file=
"${theme.images.dir}"/>
338 <echo>Copying user defined images from @{theme}/images to ${tmp.img.dir}
</echo>
339 <copy todir=
"${tmp.img.dir}">
340 <fileset dir=
"${theme.images.dir}" includes=
"**/*"/>
349 This is a legacy macrodef for copying resources in theme-directory based themes.
350 It is provided to support building Ext JS 4.1 app themes
352 <macrodef name=
"x-copy-resources">
354 <copy todir=
"${build.resources.dir}" includeEmptyDirs=
"false">
355 <fileset dir=
"${app.resources.dir}"
359 <x-get-relative-path from=
"${app.dir}"
360 to=
"${framework.dir}"
361 property=
"framework.rel.path"/>
363 <copy toDir=
"${build.out.base.path}/${framework.rel.path}">
364 <fileset dir=
"${framework.dir}"
365 includes=
"src/ux/**/css/**/*"/>
371 Generates theme images for Ext JS 4.1 apps that use directory based
372 themes. These have been deprecated in favor of ExtJS 4.2 theme packages
374 <target name=
"-slice-theme-directories">
375 <echo>Processing theme directories from ${app.theme.dir}
</echo>
377 <dirset dir=
"${app.theme.dir}" includes=
"*"/>
379 <x-build-theme theme=
"@{theme}"/>
385 <target name=
"-slice-images">
386 <x-run-if-true value=
"${enable.ext42.themes}">
387 <x-ant-call target=
"-slice-app-theme"/>
389 <x-run-if-true value=
"${enable.ext41.themes}">
390 <x-ant-call target=
"-slice-theme-directories"/>
394 <target name=
"-before-slice"/>
395 <target name=
"-slice" depends=
"-slice-images"/>
396 <target name=
"-after-slice"/>
399 Refresh Individual Theme
401 <target name=
"-before-refresh-theme"/>
402 <target name=
"-refresh-theme">
404 <x-is-true value=
"${enable.ext41.themes}"/>
406 <local name=
"theme.dir"/>
407 <property name=
"theme.dir" location=
"${app.theme.dir}/${args.themeName}"/>
408 <x-build-theme theme=
"${theme.dir}" buildsass=
"true"/>
413 <target name=
"-after-refresh-theme"/>