html5-starter 0.2.3b → 0.2.9b

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. data/README.md +2 -2
  2. data/stylesheets/_html5-boilerplate.scss +1 -11
  3. data/stylesheets/html5-boilerplate/_helpers.scss +10 -17
  4. data/stylesheets/html5-boilerplate/_normalize.scss +214 -0
  5. data/stylesheets/html5-boilerplate/_print.scss +5 -10
  6. data/templates/project/files/404.html +42 -38
  7. data/templates/project/files/crossdomain.xml +8 -8
  8. data/templates/project/files/gitattributes.txt +1 -0
  9. data/templates/project/files/gitignore.txt +8 -3
  10. data/templates/project/files/htaccess +215 -158
  11. data/templates/project/files/humans.txt +43 -43
  12. data/templates/project/files/robots.txt +4 -5
  13. data/templates/project/index.html +34 -47
  14. data/templates/project/javascripts/libs/{jquery-1.5.1.js → jquery-1.7.1.js} +3125 -2175
  15. data/templates/project/javascripts/libs/jquery-1.7.1.min.js +4 -0
  16. data/templates/project/javascripts/libs/modernizr-2.5.3.min.js +4 -0
  17. data/templates/project/javascripts/plugins.js +4 -8
  18. data/templates/project/javascripts/script.js +1 -19
  19. data/templates/project/manifest.rb +6 -24
  20. data/templates/project/partials/_boilerplate-defaults.scss +7 -11
  21. data/templates/project/style.scss +28 -51
  22. metadata +10 -30
  23. data/stylesheets/html5-boilerplate/_fonts.scss +0 -38
  24. data/stylesheets/html5-boilerplate/_handheld.scss +0 -8
  25. data/stylesheets/html5-boilerplate/_reset.scss +0 -48
  26. data/stylesheets/html5-boilerplate/_styles.scss +0 -84
  27. data/templates/project/files/build/build.xml +0 -821
  28. data/templates/project/files/build/buildinfo.properties +0 -5
  29. data/templates/project/files/build/config/buildinfo.properties +0 -5
  30. data/templates/project/files/build/config/default.properties +0 -80
  31. data/templates/project/files/build/config/project.properties +0 -56
  32. data/templates/project/files/build/createproject.sh +0 -50
  33. data/templates/project/files/build/runbuildscript.bat +0 -5
  34. data/templates/project/files/build/tools/ant-contrib-1.0b3.jar +0 -0
  35. data/templates/project/files/build/tools/htmlcompressor-1.1.jar +0 -0
  36. data/templates/project/files/build/tools/jpegtran.exe +0 -0
  37. data/templates/project/files/build/tools/optipng-0.6.4-exe/LICENSE.txt +0 -21
  38. data/templates/project/files/build/tools/optipng-0.6.4-exe/optipng.exe +0 -0
  39. data/templates/project/files/build/tools/yuicompressor-2.4.5.jar +0 -0
  40. data/templates/project/handheld.scss +0 -8
  41. data/templates/project/javascripts/libs/dd_belatedpng.js +0 -13
  42. data/templates/project/javascripts/libs/jquery-1.5.1.min.js +0 -16
  43. data/templates/project/javascripts/libs/modernizr-1.7.min.js +0 -2
  44. data/templates/project/javascripts/rails.js +0 -156
@@ -1,821 +0,0 @@
1
- <?xml version="1.0"?>
2
- <project name="Boilerplate Build" default="build" basedir="../"> <!-- one back since we're in build/ -->
3
-
4
-
5
- <!-- Load in Ant-Contrib to give us access to some very useful tasks! -->
6
- <!-- the .jar file is located in the tools directory -->
7
- <taskdef resource="net/sf/antcontrib/antcontrib.properties">
8
- <classpath>
9
- <pathelement location="${basedir}/build/tools/ant-contrib-1.0b3.jar"/>
10
- </classpath>
11
- </taskdef>
12
-
13
- <!-- load shell environment -->
14
- <property environment="ENV" />
15
-
16
- <!-- load property files -->
17
- <property file="build/config/project.properties"/>
18
- <property file="build/config/default.properties"/>
19
-
20
- <!-- merge the stylesheet properties -->
21
- <var name="stylesheet-files" value="${file.stylesheets}, ${file.default.stylesheets}"/>
22
-
23
- <!-- merge the pages properties -->
24
- <var name="page-files" value="${file.pages}, ${file.pages.default.include}"/>
25
-
26
-
27
-
28
- <!--
29
- *************************************************
30
- * BASE TARGETS *
31
- *************************************************
32
- -->
33
- <target name="basics">
34
- <if>
35
- <equals arg1="${env}" arg2="dev"/>
36
- <then>
37
- <!-- Build a dev environment -->
38
- <echo message="Building a Development Environment..."/>
39
- <antcall target="-basics.dev"/>
40
- </then>
41
-
42
- <elseif>
43
- <equals arg1="${env}" arg2="test"/>
44
- <then>
45
- <!-- Build a test environment -->
46
- <echo message="Building a Test Environment..."/>
47
- <antcall target="-basics.test"/>
48
- </then>
49
- </elseif>
50
-
51
- <else>
52
- <!-- Build a production environment -->
53
- <echo message="Building a Production Environment..."/>
54
- <antcall target="-basics.production"/>
55
- </else>
56
- </if>
57
- </target>
58
-
59
-
60
- <target name="text">
61
- <if>
62
- <equals arg1="${env}" arg2="dev"/>
63
- <then>
64
- <!-- Build a dev environment -->
65
- <echo message="Building a Development Environment..."/>
66
- <antcall target="-text.dev"/>
67
- </then>
68
-
69
- <elseif>
70
- <equals arg1="${env}" arg2="test"/>
71
- <then>
72
- <!-- Build a test environment -->
73
- <echo message="Building a Test Environment..."/>
74
- <antcall target="-text.test"/>
75
- </then>
76
- </elseif>
77
-
78
- <else>
79
- <!-- Build a production environment -->
80
- <echo message="Building a Production Environment..."/>
81
- <antcall target="-text.production"/>
82
- </else>
83
- </if>
84
- <!-- funky order due to jpegtran being a jerk. See comment at top of imagesjpg task -->
85
- <antcall target="-jpgcopy"/>
86
- </target>
87
-
88
-
89
- <target name="buildkit">
90
- <if>
91
- <equals arg1="${env}" arg2="dev"/>
92
- <then>
93
- <!-- Build a dev environment -->
94
- <echo message="Building a Development Environment..."/>
95
- <antcall target="-buildkit.dev"/>
96
- </then>
97
-
98
- <elseif>
99
- <equals arg1="${env}" arg2="test"/>
100
- <then>
101
- <!-- Build a test environment -->
102
- <echo message="Building a Test Environment..."/>
103
- <antcall target="-buildkit.test"/>
104
- </then>
105
- </elseif>
106
-
107
- <else>
108
- <!-- Build a production environment -->
109
- <echo message="Building a Production Environment..."/>
110
- <antcall target="-buildkit.production"/>
111
- </else>
112
- </if>
113
- </target>
114
-
115
-
116
- <target name="build">
117
- <if>
118
- <equals arg1="${env}" arg2="dev"/>
119
- <then>
120
- <!-- Build a dev environment -->
121
- <echo message="Building a Development Environment..."/>
122
- <antcall target="-build.dev" />
123
- </then>
124
-
125
- <elseif>
126
- <equals arg1="${env}" arg2="test"/>
127
- <then>
128
- <!-- Build a test environment -->
129
- <echo message="Building a Test Environment..."/>
130
- <antcall target="-build.test" />
131
- </then>
132
- </elseif>
133
-
134
- <else>
135
- <!-- Build a production environment -->
136
- <echo message="Building a Production Environment..."/>
137
- <antcall target="-build.production" />
138
- </else>
139
- </if>
140
- </target>
141
-
142
-
143
- <target name="minify">
144
- <if>
145
- <equals arg1="${env}" arg2="dev"/>
146
- <then>
147
- <!-- Build a dev environment -->
148
- <echo message="Building a Development Environment..."/>
149
- <antcall target="-minify.dev"/>
150
- </then>
151
-
152
- <elseif>
153
- <equals arg1="${env}" arg2="test"/>
154
- <then>
155
- <!-- Build a test environment -->
156
- <echo message="Building a Test Environment..."/>
157
- <antcall target="-minify.test"/>
158
- </then>
159
- </elseif>
160
-
161
- <else>
162
- <!-- Build a production environment -->
163
- <echo message="Building a Production Environment..."/>
164
- <antcall target="-minify.production"/>
165
- </else>
166
- </if>
167
- </target>
168
-
169
-
170
- <!--
171
- *************************************************
172
- * BUILD TARGETS *
173
- *************************************************
174
- -->
175
-
176
- <!-- Target: basics -->
177
- <target name="-basics.dev"
178
- depends="-rev,
179
- -clean,
180
- -copy"/>
181
-
182
- <target name="-basics.test"
183
- depends="-rev,
184
- -clean,
185
- -copy,
186
- -usemin,
187
- -js.all.minify,
188
- -js.main.concat,
189
- -js.mylibs.concat,
190
- -js.scripts.concat,
191
- -js.delete,
192
- -css,
193
- -html"/>
194
-
195
- <target name="-basics.production"
196
- depends="-rev,
197
- -clean,
198
- -copy,
199
- -usemin,
200
- -strip-console.log,
201
- -js.all.minify,
202
- -js.main.concat,
203
- -js.mylibs.concat,
204
- -js.scripts.concat,
205
- -js.delete,
206
- -css,
207
- -html"/>
208
-
209
- <!-- Target: text -->
210
- <target name="-text.dev"
211
- depends="-rev,
212
- -clean,
213
- -copy"/>
214
-
215
- <target name="-text.test"
216
- depends="-rev,
217
- -clean,
218
- -copy,
219
- -usemin,
220
- -js.all.minify,
221
- -js.main.concat,
222
- -js.mylibs.concat,
223
- -js.scripts.concat,
224
- -js.delete,
225
- -css,
226
- -html,
227
- -htmlclean"/>
228
-
229
- <target name="-text.production"
230
- depends="-rev,
231
- -clean,
232
- -copy,
233
- -usemin,
234
- -strip-console.log,
235
- -js.all.minify,
236
- -js.main.concat,
237
- -js.mylibs.concat,
238
- -js.scripts.concat,
239
- -js.delete,
240
- -css,
241
- -html,
242
- -htmlclean"/>
243
-
244
- <!-- Target: buildkit -->
245
- <target name="-buildkit.dev"
246
- depends="-rev,
247
- -clean,
248
- -prodcopy,
249
- -imagespng,
250
- -imagesjpg"/>
251
-
252
- <target name="-buildkit.test"
253
- depends="-rev,
254
- -clean,
255
- -prodcopy,
256
- -usemin,
257
- -js.all.minify,
258
- -js.main.concat,
259
- -js.mylibs.concat,
260
- -js.scripts.concat,
261
- -js.delete,
262
- -css,
263
- -html,
264
- -htmlbuildkit,
265
- -imagespng,
266
- -imagesjpg"/>
267
-
268
- <target name="-buildkit.production"
269
- depends="-rev,
270
- -clean,
271
- -prodcopy,
272
- -usemin,
273
- -strip-console.log,
274
- -js.all.minify,
275
- -js.main.concat,
276
- -js.mylibs.concat,
277
- -js.scripts.concat,
278
- -js.delete,
279
- -css,
280
- -html,
281
- -htmlbuildkit,
282
- -imagespng,
283
- -imagesjpg"/>
284
-
285
- <!-- Target: build -->
286
- <target name="-build.dev"
287
- depends="-rev,
288
- -clean,
289
- -prodcopy,
290
- -imagespng,
291
- -imagesjpg"/>
292
-
293
- <target name="-build.test"
294
- depends="-rev,
295
- -clean,
296
- -prodcopy,
297
- -usemin,
298
- -js.all.minify,
299
- -js.main.concat,
300
- -js.mylibs.concat,
301
- -js.scripts.concat,
302
- -js.delete,
303
- -css,
304
- -html,
305
- -htmlclean,
306
- -imagespng,
307
- -imagesjpg"/>
308
-
309
- <target name="-build.production"
310
- depends="-rev,
311
- -clean,
312
- -prodcopy,
313
- -usemin,
314
- -strip-console.log,
315
- -js.all.minify,
316
- -js.main.concat,
317
- -js.mylibs.concat,
318
- -js.scripts.concat,
319
- -js.delete,
320
- -css,
321
- -html,
322
- -htmlclean,
323
- -imagespng,
324
- -imagesjpg"/>
325
-
326
- <!-- Target: minify -->
327
- <target name="-minify.dev"
328
- depends="-rev,
329
- -clean,
330
- -prodcopy,
331
- -imagespng,
332
- -imagesjpg"/>
333
-
334
- <target name="-minify.test"
335
- depends="-rev,
336
- -clean,
337
- -prodcopy,
338
- -usemin,
339
- -js.all.minify,
340
- -js.main.concat,
341
- -js.mylibs.concat,
342
- -js.scripts.concat,
343
- -js.delete,
344
- -css,
345
- -html,
346
- -htmlcompress,
347
- -imagespng,
348
- -imagesjpg"/>
349
-
350
- <target name="-minify.production"
351
- depends="-rev,
352
- -clean,
353
- -prodcopy,
354
- -usemin,
355
- -strip-console.log,
356
- -js.all.minify,
357
- -js.main.concat,
358
- -js.mylibs.concat,
359
- -js.scripts.concat,
360
- -js.delete,
361
- -css,
362
- -html,
363
- -htmlcompress,
364
- -imagespng,
365
- -imagesjpg"/>
366
-
367
- <!--
368
- *************************************************
369
- * FUNCTION TARGETS *
370
- *************************************************
371
- -->
372
- <target name="-load-build-info" description="(PRIVATE) Loads the build versioning information">
373
- <property file="./${dir.build}/config/${build.version.info}"/>
374
- </target>
375
-
376
- <target name="-clean" description="(PRIVATE) Wipe the previous build (Deletes the dir.publish directory">
377
- <!-- This is a private target -->
378
-
379
- <echo message="Cleaning up previous build directory..."/>
380
- <delete dir="./${dir.publish}/"/>
381
- </target>
382
-
383
-
384
- <target name="-rev" description="(PRIVATE) Increase the current build number by one and set build date">
385
- <!-- This is a private target -->
386
-
387
- <echo message="====================================================================="/>
388
- <echo message="Welcome to the HTML5 Boilerplate Build Script!"/>
389
- <echo message=" "/>
390
- <echo message="We're going to get your site all ship-shape and ready for prime time."/>
391
- <echo message=" "/>
392
- <echo message="This should take somewhere between 15 seconds and a few minutes,"/>
393
- <echo message="mostly depending on how many images we're going to compress."/>
394
- <echo message=" "/>
395
- <echo message="Feel free to come back or stay here and follow along."/>
396
- <echo message="====================================================================="/>
397
- <echo message=" "/>
398
- <echo message=" "/>
399
-
400
-
401
- <echo message="Increasing the build number..."/>
402
- <propertyfile file="./${dir.build}/config/${build.version.info}" comment="Build Information File - DO NOT CHANGE">
403
- <entry key="build.number" type="int" default="0000" operation="+" pattern="0000"/>
404
- <entry key="build.date" type="date" value="now" pattern="dd.MM.yyyy HH:mm"/>
405
- </propertyfile>
406
- <property file="./${dir.build}/config/${build.version.info}"/>
407
- <echo>Creating build ${build.number}</echo>
408
- </target>
409
-
410
-
411
- <target name="current-number" depends="-load-build-info" description="(PUBLIC) Returns the current build number">
412
- <echo>Current build number: ${build.number}</echo>
413
- </target>
414
-
415
-
416
- <target name="-copy" depends="-load-build-info">
417
- <!-- This is a private target -->
418
-
419
- <echo message="Copying over new files..."/>
420
- <!-- combine the 2 exclude properties -->
421
- <var name="excluded-files" value="${file.default.exclude}, ${file.exclude}"/>
422
-
423
- <copy todir="./${dir.publish}">
424
- <fileset dir="${dir.source}/" excludes="${excluded-files}"/>
425
- </copy>
426
-
427
- <echo message="A copy of all non-dev files are now in: ./${dir.publish}."/>
428
- </target>
429
-
430
- <target name="-prodcopy" depends="-load-build-info">
431
- <!-- This is a private target -->
432
-
433
- <echo message="Copying over new files..."/>
434
- <!-- combine the 2 exclude properties -->
435
- <var name="prod-excluded-files" value="${file.default.exclude}, ${file.jpg.exclude}, ${file.exclude}"/>
436
-
437
- <copy todir="./${dir.publish}">
438
- <fileset dir="${dir.source}/" excludes="${prod-excluded-files}"/>
439
- </copy>
440
-
441
- <echo message="A copy of all non-dev files are now in: ./${dir.publish}."/>
442
- </target>
443
-
444
-
445
- <!-- JAVASCRIPT -->
446
- <target name="-js.main.concat" depends="-load-build-info" description="(PRIVATE) Concatenates the JS files in dir.js">
447
- <echo message="Concatenating Main JS scripts..."/>
448
- <concat destfile="./${dir.publish}/${dir.js}/scripts-${build.number}.js">
449
- <fileset dir="./${dir.publish}/">
450
- <include name="**/${dir.js.main}/*.min.js"/>
451
- <exclude name="**/${dir.js.mylibs}/*.js"/>
452
- <exclude name="**/${dir.js.libs}/*.js"/>
453
- </fileset>
454
- </concat>
455
- </target>
456
-
457
-
458
- <target name="-js.mylibs.concat" depends="-load-build-info" description="(PRIVATE) Concatenates the JS files in dir.js.mylibs">
459
- <echo message="Concatenating JS libraries"/>
460
- <concat destfile="./${dir.publish}/${dir.js}/libs-${build.number}.js">
461
- <fileset dir="./${dir.publish}/${dir.js.mylibs}/">
462
- <include name="**/*.min.js"/>
463
- </fileset>
464
- </concat>
465
- </target>
466
-
467
-
468
- <target name="-js.scripts.concat" depends="-load-build-info" if="build.concat.scripts">
469
- <echo message="Concatenating library file with main script file"/>
470
- <concat destfile="./${dir.publish}/${dir.js}/scripts-${build.number}.min.js">
471
- <fileset dir="./${dir.publish}/${dir.js}/">
472
- <include name="libs-${build.number}.js"/>
473
- <include name="scripts-${build.number}.js"/>
474
- </fileset>
475
- </concat>
476
-
477
- <echo message="Concatenating library file with main debug script file"/>
478
- <concat destfile="./${dir.publish}/${dir.js}/scripts-${build.number}-debug.min.js">
479
- <fileset dir="./${dir.publish}/${dir.js}/">
480
- <include name="libs-${build.number}.js"/>
481
- <include name="scripts-${build.number}-debug.js"/>
482
- </fileset>
483
- </concat>
484
- </target>
485
-
486
-
487
- <target name="-js.all.minify" depends="-js.libs.minify" description="(PRIVATE) Minifies the scripts.js files created by js.scripts.concat">
488
- <echo message="Minifying concatenated script- and library-file"/>
489
- <apply executable="java" parallel="false">
490
- <fileset dir="./${dir.publish}/${dir.js}">
491
- <include name="**/*.js"/>
492
- <exclude name="**/*.min.js"/>
493
- <exclude name="**/${dir.js.libs}/*.js"/>
494
- </fileset>
495
- <arg line="-jar"/>
496
- <arg path="./${dir.build.tools}/${tool.yuicompressor}"/>
497
- <srcfile/>
498
- <arg line="--line-break"/>
499
- <arg line="4000"/>
500
- <arg line="-o"/>
501
- <mapper type="glob" from="*.js" to="../${dir.publish}/${dir.js}/*.min.js"/>
502
- <targetfile/>
503
- </apply>
504
- </target>
505
-
506
-
507
- <target name="-js.libs.minify" depends="-load-build-info" description="(PRIVATE) Minifies the helper files in dir.js.libs">
508
- <echo message="Minifying helper JS files..."/>
509
-
510
- <apply executable="java" parallel="false">
511
- <fileset dir="./${dir.publish}/${dir.js.libs}/" includes="*.js" excludes="*.min.js"/>
512
- <arg line="-jar"/>
513
- <arg path="./${dir.build.tools}/${tool.yuicompressor}"/>
514
- <srcfile/>
515
- <arg line="-o"/>
516
- <mapper type="glob" from="*.js" to="../${dir.publish}/${dir.js.libs}/*-${build.number}.min.js"/>
517
- <targetfile/>
518
- </apply>
519
- </target>
520
-
521
-
522
- <target name="-js.delete" depends="-load-build-info" description="(PRIVATE) Deletes the unoptimized js files from build if set">
523
- <if>
524
- <equals arg1="${build.delete.unoptimized}" arg2="true"/>
525
- <then>
526
- <echo message="Deleting unoptimized files..."/>
527
- <delete file="./${dir.publish}/${dir.js}/scripts-${build.number}.js"/>
528
- <delete file="./${dir.publish}/${dir.js}/scripts-${build.number}-debug.js"/>
529
- <!--
530
- <delete dir="./${dir.publish}/${dir.js.lib}/"/>
531
- <delete file="./${dir.publish}/${dir.js}/libs-${build.number}.js"/>
532
- this guy probably COULD be on but I think it's better if we keep him off for now. ^pi
533
- <delete includeemptydirs="true">
534
- <fileset dir="./${dir.publish}/${dir.js.libs}/" includes="*.js" excludes="*.min.js"/>
535
- </delete>
536
- -->
537
- </then>
538
- </if>
539
-
540
- <if>
541
- <and>
542
- <equals arg1="${build.delete.unoptimized}" arg2="true"/>
543
- <equals arg1="${build.concat.scripts}" arg2="true"/>
544
- </and>
545
- <then>
546
- <delete file="./${dir.publish}/${dir.js}/libs-${build.number}.js"/>
547
- <delete file="./${dir.publish}/${dir.js}/scripts-${build.number}.js"/>
548
- </then>
549
- </if>
550
- </target>
551
-
552
-
553
- <target name="-strip-console.log" description="(PRIVATE)Comments out any console.log statements">
554
- <echo message="Commenting out console.log lines"/>
555
-
556
-
557
- <replaceregexp match="(console.log\(.*\))" replace="/\*\1\*/" flags="g" >
558
- <fileset dir="./${dir.publish}/${dir.js}/">
559
- <include name="**/*.js"/>
560
- <exclude name="**/*.min.js"/>
561
- </fileset>
562
- </replaceregexp>
563
- </target>
564
-
565
-
566
- <!-- HTML -->
567
- <target name="-usemin" depends="-serverconfig" description="(PRIVATE) Replaces references to non-minified scripts">
568
- <echo message="Switching to minified js files..."/>
569
-
570
- <!-- switch from a regular jquery to minified -->
571
- <replaceregexp match="jquery-(\d|\d(\.\d)+)\.js" replace="jquery-\1.min.js" flags="g">
572
- <fileset dir="./${dir.publish}" includes="${page-files}"/>
573
- </replaceregexp>
574
- <!-- switch any google CDN reference to minified -->
575
- <replaceregexp match="(\d|\d(\.\d)+)\/jquery\.js" replace="\1/jquery.min.js" flags="g">
576
- <fileset dir="./${dir.publish}" includes="${page-files}"/>
577
- </replaceregexp>
578
-
579
- <echo>Kill off those versioning flags: ?v=2</echo>
580
- <replaceregexp match='\?v=\d+">' replace='">' flags="g">
581
- <fileset dir="./${dir.publish}" includes="${page-files}"/>
582
- </replaceregexp>
583
-
584
- <echo>Remove favicon.ico reference if it is pointing to the root</echo>
585
- <replaceregexp match="&lt;link rel=&quot;shortcut icon&quot; href=&quot;/favicon\.ico&quot;&gt;" replace="">
586
- <fileset dir="./${dir.publish}" includes="${page-files}"/>
587
- </replaceregexp>
588
- <!-- we maintain the apple-touch-icon reference for Android 2.2 www.ravelrumba.com/blog/android-apple-touch-icon
589
- <replace token="&lt;link rel=&quot;apple-touch-icon&quot; href=&quot;/apple-touch-icon.png&quot;>" value="">
590
- <fileset dir="./${dir.publish}" includes="${page-files}"/>
591
- </replace>
592
- -->
593
- </target>
594
-
595
-
596
- <target name="-html" depends="-load-build-info" description="(PRIVATE) Very basic clean up of the HTML">
597
- <echo message="Update the HTML to reference our concatenated script file: scripts-${build.number}.min.js"/>
598
- <!-- style.css replacement handled as a replacetoken above -->
599
- <replaceregexp match="&lt;!-- scripts concatenated [\d\w\s\W]*?!-- end ((scripts)|(concatenated and minified scripts))--&gt;" replace="&lt;script src='${dir.js}/scripts-${build.number}.min.js\'&gt;&lt;/script&gt;" flags="m">
600
- <fileset dir="./${dir.publish}" includes="${page-files}"/>
601
- </replaceregexp>
602
- <!--[! use comments like this one to avoid having them get minified -->
603
- </target>
604
-
605
-
606
- <target name="-htmlclean">
607
- <echo message="Run htmlcompressor on the HTML"/>
608
- <echo message=" - maintaining whitespace"/>
609
- <echo message=" - removing html comments"/>
610
- <echo message=" - compressing inline style/script tag contents"/>
611
- <apply executable="java" parallel="false" force="true" dest="./${dir.publish}/" >
612
- <fileset dir="./${dir.publish}/" includes="${page-files}"/>
613
- <arg value="-jar"/>
614
- <arg path="./${dir.build}/tools/${tool.htmlcompressor}"/>
615
- <arg line="--type html"/>
616
- <arg line="--preserve-multi-spaces"/>
617
- <arg line="--remove-quotes"/>
618
- <arg line="--compress-js"/>
619
- <arg line="--compress-css"/>
620
- <srcfile/>
621
- <arg value="-o"/>
622
- <mapper type="glob" from="*.html" to="../${dir.publish}/*.html"/>
623
- <targetfile/>
624
- </apply>
625
- </target>
626
-
627
-
628
- <target name="-htmlbuildkit">
629
- <echo message="Run htmlcompressor on the HTML"/>
630
- <echo message=" - maintaining whitespace"/>
631
- <echo message=" - retain html comments"/>
632
- <echo message=" - compressing inline style/script tag contents"/>
633
- <apply executable="java" parallel="false" force="true" dest="./${dir.publish}/" >
634
- <fileset dir="./${dir.publish}/" includes="${page-files}"/>
635
- <arg value="-jar"/>
636
- <arg path="./${dir.build}/tools/${tool.htmlcompressor}"/>
637
- <arg value="--preserve-comments"/>
638
- <arg line="--preserve-multi-spaces"/>
639
- <arg line="--type html"/>
640
- <arg line="--compress-js"/>
641
- <arg line="--compress-css"/>
642
- <srcfile/>
643
- <arg value="-o"/>
644
- <mapper type="glob" from="*.html" to="../${dir.publish}/*.html"/>
645
- <targetfile/>
646
- </apply>
647
- </target>
648
-
649
-
650
- <target name="-htmlcompress">
651
- <echo message="Run htmlcompressor on the HTML"/>
652
- <echo message=" - removing unnecessary whitespace"/>
653
- <echo message=" - removing html comments"/>
654
- <echo message=" - compressing inline style/script tag contents"/>
655
- <apply executable="java" parallel="false" force="true" dest="./${dir.publish}/" >
656
- <fileset dir="./${dir.publish}/" includes="${page-files}"/>
657
- <arg value="-jar"/>
658
- <arg path="./${dir.build}/tools/${tool.htmlcompressor}"/>
659
- <arg line="--type html"/>
660
- <arg line="--remove-quotes"/>
661
- <arg line="--compress-js"/>
662
- <arg line="--compress-css"/>
663
- <srcfile/>
664
- <arg value="-o"/>
665
- <mapper type="glob" from="*.html" to="../${dir.publish}/*.html"/>
666
- <targetfile/>
667
- </apply>
668
- </target>
669
-
670
-
671
- <target name="-serverconfig" description="(PRIVATE) Upgrades expires headers">
672
- <echo message="Upgrading expires header timeouts for js/css to 1yr..."/>
673
- <if>
674
- <available file="./${dir.publish}/${file.serverconfig}"/>
675
- <then>
676
- <replace file="./${dir.publish}/${file.serverconfig}" token="access plus 2 months" value="access plus 1 year"/>
677
- </then>
678
- </if>
679
- </target>
680
-
681
-
682
- <!-- CSS -->
683
- <target name="-css" depends="-load-build-info" description="Concatenates and Minifies any stylesheets listed in the file.stylesheets property">
684
- <echo message="Concatenating css..."/>
685
-
686
- <concat destfile="./${dir.publish}/${dir.css}/style-${build.number}.css">
687
- <filelist dir="./${dir.publish}/${dir.css}" files="${stylesheet-files}"/>
688
- </concat>
689
-
690
- <echo message="Minifying css..."/>
691
-
692
- <apply executable="java" parallel="false">
693
- <fileset dir="./${dir.publish}/${dir.css}/" includes="style-${build.number}.css"/>
694
- <arg line="-jar"/>
695
- <arg path="./${dir.build.tools}/${tool.yuicompressor}"/>
696
- <srcfile/>
697
- <arg line="-o"/>
698
- <mapper type="glob" from="style-${build.number}.css" to="../${dir.publish}/${dir.css}/style-${build.number}.min.css"/>
699
- <targetfile/>
700
- </apply>
701
-
702
- <echo message="Updating the HTML with the new css filename"/>
703
-
704
- <replace token="style.css" value="style-${build.number}.min.css" dir="${dir.publish}" includes="${page-files}"/>
705
- </target>
706
-
707
-
708
- <!-- IMAGES -->
709
- <target name="-imagespng" description="(PRIVATE) Optimizes .png images using optipng">
710
- <echo message="Optimizing images..."/>
711
- <echo message="This part might take a while. But everything else is already done."/>
712
- <echo message=" "/>
713
-
714
-
715
- <echo message="First, we run optipng on the .png files..."/>
716
-
717
- <!-- osfamily=unix is actually true on OS X as well -->
718
- <!-- On *nix's and OS X, check for optipng and give a helpful message if it's not installed -->
719
- <if>
720
- <and>
721
- <os family="unix" />
722
- <available file="optipng" filepath="${ENV.PATH}" />
723
- </and>
724
- <then>
725
- <apply executable="optipng" osfamily="unix">
726
- <arg value="-quiet"/>
727
- <arg value="-o7"/>
728
- <fileset dir="./${dir.publish}/">
729
- <include name="**/*.png"/>
730
- </fileset>
731
- </apply>
732
- </then>
733
- <elseif>
734
- <os family="unix" />
735
- <then>
736
- <echo message="*** optipng NOT INSTALLED. SKIPPING OPTIMIZATION OF PNGs." />
737
- <echo message="*** Install optipng to enable png optimization." />
738
- <echo message="*** For instructions see 'Dependencies' at: http://html5boilerplate.com/docs/#Build-script#dependencies" />
739
- </then>
740
- </elseif>
741
- </if>
742
-
743
- <apply executable="tools/optipng-0.6.4-exe/optipng.exe" osfamily="windows">
744
- <arg value="-o7"/>
745
- <arg value="-quiet"/>
746
- <fileset dir="./${dir.publish}/">
747
- <include name="**/*.png"/>
748
- </fileset>
749
- </apply>
750
- </target>
751
-
752
-
753
- <target name="-imagesjpg" description="(PRIVATE) Optimizes .jpg images using jpegtan">
754
- <echo message="Now, we clean up those jpgs..."/>
755
-
756
- <!-- jpegtran is a little weird in that it assumes a pre-existing file means it's already optimized. -->
757
- <!-- why? good question. To combat this, we skipped copying over the ${dir.images}/*.jpg earlier in the -->
758
- <!-- copy task. Now, we're using jpegtran to copy the files over while we crunch 'em. -->
759
-
760
- <if>
761
- <equals arg1="${images.strip.metadata}" arg2="true"/>
762
- <then>
763
- <var name="strip-meta-tags" value="none"/>
764
- </then>
765
- <else>
766
- <var name="strip-meta-tags" value="all"/>
767
- </else>
768
- </if>
769
-
770
- <!-- On *nix's and OS X, check for jpegtran and give a helpful message if it's not installed -->
771
- <if>
772
- <and>
773
- <os family="unix" />
774
- <available file="jpegtran" filepath="${ENV.PATH}" />
775
- </and>
776
- <then>
777
- <apply executable="jpegtran" osfamily="unix">
778
- <fileset dir="${dir.source}/${dir.images}" includes="*.jpg"/>
779
- <arg value="-copy"/>
780
- <arg value="${strip-meta-tags}"/>
781
- <arg value="-optimize"/>
782
- <srcfile/>
783
- <redirector>
784
- <outputmapper type="glob" from="*.jpg" to="./${dir.publish}/${dir.images}/*.jpg"/>
785
- </redirector>
786
- <!-- you may want to flag optimized images. If so, do it here. Otherwise change this to type="identity" -->
787
- </apply>
788
- </then>
789
- <elseif>
790
- <os family="unix" />
791
- <then>
792
- <echo message="*** jpegtran NOT INSTALLED. SKIPPING OPTIMIZATION OF JPEGs." />
793
- <echo message="*** Install jpegtran to enable jpeg optimization." />
794
- <echo message="*** For instructions see 'Dependencies' at: http://html5boilerplate.com/docs/#Build-script#dependencies" />
795
- </then>
796
- </elseif>
797
- </if>
798
-
799
- <apply executable="tools/jpegtran.exe" osfamily="windows">
800
- <fileset dir="${dir.source}/${dir.images}" includes="*.jpg"/>
801
- <arg value="-copy"/>
802
- <arg value="${strip-meta-tags}"/>
803
- <arg value="-optimize"/>
804
- <srcfile/>
805
- <targetfile/>
806
- <!-- you may want to flag optimized images. If so, do it here. Otherwise change this to type="identity" -->
807
- <mapper type="glob" from="*.jpg" to="../${dir.publish}/${dir.images}/*.jpg"/>
808
- </apply>
809
- </target>
810
-
811
-
812
- <target name="-jpgcopy">
813
- <echo message="Copying over the unmodified jpegs."/>
814
-
815
- <copy todir="./${dir.publish}/${dir.images}">
816
- <fileset dir="${dir.source}/${dir.images}" includes="*.jpg"/>
817
- </copy>
818
- </target>
819
-
820
-
821
- </project>