]> git.proxmox.com Git - extjs.git/blob - extjs/packages/legacy/.sencha/package/slice-impl.xml
add extjs 6.0.1 sources
[extjs.git] / extjs / packages / legacy / .sencha / package / slice-impl.xml
1 <project name="x-slice-impl">
2
3 <target name="-load-sass-page"
4 depends="-generate-slicer-bootstrap,
5 -generate-slicer-manifest">
6 <x-run-if-true value="${package.sass.fashion}">
7 <if>
8 <x-is-false value="${package.sass.rhino}"/>
9 <then>
10 <x-get-relative-path from="${build.web.root}"
11 to="${package.example.fashion.html}"
12 property="package.example.fashion.html.relative"/>
13 <property name="example.page.url"
14 value="http://localhost:${build.web.port}/${package.example.fashion.html.relative}"/>
15 <x-sass-page page="${package.example.fashion.html}"
16 url="${example.page.url}"
17 refId="package.web.server"/>
18 </then>
19 </if>
20 </x-run-if-true>
21 </target>
22
23 <!--
24 Uses the compiler to generate a special theme-only scss file containing
25 rules for all framework / package / app components. This is then used
26 by the slicer example page to capture theme sprites
27 -->
28 <target name="-compile-slicer-sass" depends="-init-compiler">
29 <local name="package.example.scss.tmp"/>
30 <property name="package.example.scss.tmp" value="${package.example.scss}.tmp"/>
31 <x-normalize-path
32 path="${build.out.resources.dir}"
33 property="image.search.path"/>
34
35 <x-compile refid="${compiler.ref.id}">
36 <![CDATA[
37 restore
38 package-${package.name}-all
39 and
40 include
41 -all
42 and
43 sass
44 +class-name-vars
45 +etc
46 +vars
47 +rules
48 -variable=$image-search-path:'${image.search.path}'
49 -variable=$theme-name: '${theme.name}' !default
50 -output=${package.example.scss.tmp}
51 -forward=${package.sass.dynamic}
52 and
53 restore
54 package-${package.name}-all
55 and
56 sass
57 +ruby
58 -output=${package.example.out.ruby}
59 ]]>
60 </x-compile>
61
62 <if>
63 <not>
64 <filesmatch file1="${package.example.scss.tmp}" file2="${package.example.scss}"/>
65 </not>
66 <then>
67 <copy file="${package.example.scss.tmp}" tofile="${package.example.scss}" overwrite="true"/>
68 </then>
69 </if>
70
71 </target>
72
73 <!--
74 Compiles the scss file for the theme slicer page
75 -->
76 <target name="-compass-compile-slicer-css" depends="-compile-slicer-sass">
77 <if>
78 <not>
79 <x-is-true value="${package.sass.fashion}"/>
80 </not>
81 <then>
82 <x-compass-compile
83 dir="${package.example.build.dir}"
84 trace="${compass.compile.trace}"
85 boring="${compass.compile.boring}"
86 force="${compass.compile.force}"
87 sassdir="${package.example.build.dir}"
88 cssdir="${package.example.build.dir}"
89 config="${package.example.compass.config}"/>
90 </then>
91 </if>
92 </target>
93
94 <!--
95 Compiles the scss file for the theme slicer page
96 -->
97 <target name="-fashion-compile-slicer-css" depends="-compile-slicer-sass">
98 <if>
99 <x-is-true value="${package.sass.fashion}"/>
100 <then>
101 <if>
102 <x-is-true value="${package.sass.rhino}"/>
103 <then>
104 <x-fashion-compile file="${package.example.build.dir}"
105 tofile="${package.example.build.dir}"/>
106 </then>
107 <else>
108 <x-sass-build input="${package.example.build.dir}"
109 output="${package.example.build.dir}"
110 refId="package.web.server"/>
111 </else>
112 </if>
113 </then>
114 </if>
115 </target>
116
117 <target name="-generate-slicer-manifest" depends="-compass-compile-slicer-css" if="framework.isV5">
118 <condition property="remove.slicer.css.bootstrap.entries" value="true">
119 <and>
120 <x-is-true value="${package.sass.fashion}"/>
121 <x-is-false value="${package.sass.rhino}"/>
122 </and>
123 </condition>
124 <property name="remove.slicer.css.bootstrap.entries" value="false"/>
125
126 <x-compile refid="${compiler.ref.id}">
127 <![CDATA[
128 slicer-manifest
129 -removeBootstrapCssEntries=${remove.slicer.css.bootstrap.entries}
130 -cssFile=${package.example.css}
131 -basePath=${bootstrap.base.path}
132 -out=${bootstrap.example.json}
133 and
134 microload
135 -operation=microloader
136 -microloaderPath=${build.slicer.microloader.file}
137 -bootPath=${build.boot.file}
138 -out=${bootstrap.example.js}
139 ]]>
140 </x-compile>
141 </target>
142
143 <target name="-generate-slicer-bootstrap" depends="-init-compiler" unless="framework.isV5">
144
145 <local name="relpath"/>
146 <x-get-relative-path from="${bootstrap.base.path}"
147 to="${framework.packages.dir}"
148 property="relpath"/>
149
150 <local name="override.tpl"/>
151 <local name="override.tpl.type"/>
152
153 <property name="override.tpl.type" value="tpl"/>
154 <property name="override.tpl" value='Ext.Loader.loadScriptFile("{0}", Ext.emptyFn);'/>
155
156 <x-bootstrap file="${bootstrap.example.js}"
157 basedir="${bootstrap.base.path}"
158 includeBoot="true"
159 includeCoreFiles="true"
160 overrideTpl="${override.tpl}"
161 overrideTplType="${override.tpl.type}"
162 overrideExcludeTags="">
163 <![CDATA[
164 Ext.Boot.loadSync([
165 "render.js",
166 "${relpath}/ext-theme-base/sass/example/manifest.js",
167 "${relpath}/ext-theme-base/sass/example/shortcuts.js",
168 "custom.js"
169 ]);
170 ]]>
171 </x-bootstrap>
172 </target>
173
174 <target name="-update-slicer-css">
175 <x-get-relative-path
176 from="${package.example.dir}"
177 to="${package.example.css}"
178 property="package.example.css.path"
179 />
180
181 <!--update the app's example to point to the build output-->
182 <echo file="${package.example.dir}/example.css">
183 /*
184 * This file is generated by Sencha Cmd and should NOT be edited. It redirects
185 * to the most recently built CSS file for the application to allow theme.html
186 * to load properly for image slicing (required to support non-CSS3 browsers
187 * such as IE9 and below).
188 */
189 @import '${package.example.css.path}';
190 </echo>
191 </target>
192
193
194 <target name="-capture-theme-image"
195 depends="-generate-slicer-bootstrap,-generate-slicer-manifest,-update-slicer-css">
196 <if>
197 <or>
198 <x-is-false value="${package.sass.fashion}"/>
199 <x-is-true value="${package.sass.rhino}"/>
200 </or>
201 <then>
202 <echo>Capture theme image to ${build.dir}/theme-capture.png</echo>
203 <x-sencha-command dir="${package.dir}">
204 <![CDATA[
205 theme
206 capture
207 -page=${package.example.theme.html}
208 -image=${build.capture.png}
209 -manifest=${build.capture.json}
210 ]]>
211 </x-sencha-command>
212 </then>
213 </if>
214 </target>
215
216 <target name="-capture-sass-page-image">
217 <if>
218 <and>
219 <x-is-true value="${package.sass.fashion}"/>
220 <x-is-false value="${package.sass.rhino}"/>
221 </and>
222 <then>
223 <echo>Capture theme image to ${build.capture.png}</echo>
224 <x-capture-slicer-data manifestPath="${build.capture.json}"
225 imagePath="${build.capture.png}"
226 refId="package.web.server"/>
227 </then>
228 </if>
229 </target>
230
231 <target name="-slice-theme-images" depends="-capture-theme-image">
232 <echo>Slicing theme images to ${build.resources.dir}</echo>
233 <x-sencha-command dir="${package.dir}">
234 <![CDATA[
235 fs
236 slice
237 ${build.slice.options}
238 -image=${build.capture.png}
239 -manifest=${build.capture.json}
240 -out=${build.resources.dir}
241 ]]>
242 </x-sencha-command>
243 </target>
244
245 <target name="-slice-sass-page"
246 depends="-load-sass-page,
247 -update-slicer-css,
248 -fashion-compile-slicer-css,
249 -capture-sass-page-image,
250 -slice-theme-images"/>
251
252 <target name="-fashion-slice-images" depends="-slice-sass-page"></target>
253 <target name="-compass-slice-images" depends="-slice-theme-images"></target>
254
255
256 <target name="-slice-package-images">
257 <if>
258 <x-is-true value="${package.sass.fashion}"/>
259 <then>
260 <x-ant-call target="-fashion-slice-images"/>
261 </then>
262 <else>
263 <x-ant-call target="-compass-slice-images"/>
264 </else>
265 </if>
266 </target>
267
268 <target name="-before-slice"/>
269 <target name="-after-slice"/>
270 <target name="-slice"
271 depends="-slice-package-images"/>
272
273 </project>