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