rails-boilerplate 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. data/README.md +2 -1
  2. data/lib/{rails_boilerplate.rb → rails-boilerplate.rb} +0 -0
  3. data/lib/rails_boilerplate/version.rb +1 -1
  4. data/test/dummy/config/application.rb +1 -1
  5. metadata +79 -76
  6. data/html5-boilerplate/.gitattributes +0 -1
  7. data/html5-boilerplate/.gitignore +0 -41
  8. data/html5-boilerplate/.htaccess +0 -506
  9. data/html5-boilerplate/404.html +0 -38
  10. data/html5-boilerplate/README.md +0 -387
  11. data/html5-boilerplate/apple-touch-icon-114x114-precomposed.png +0 -0
  12. data/html5-boilerplate/apple-touch-icon-57x57-precomposed.png +0 -0
  13. data/html5-boilerplate/apple-touch-icon-72x72-precomposed.png +0 -0
  14. data/html5-boilerplate/apple-touch-icon-precomposed.png +0 -0
  15. data/html5-boilerplate/apple-touch-icon.png +0 -0
  16. data/html5-boilerplate/build/build.xml +0 -1051
  17. data/html5-boilerplate/build/config/default.properties +0 -116
  18. data/html5-boilerplate/build/config/manifest.appcache +0 -20
  19. data/html5-boilerplate/build/config/project.properties +0 -96
  20. data/html5-boilerplate/build/createproject.sh +0 -50
  21. data/html5-boilerplate/build/project.xml +0 -7
  22. data/html5-boilerplate/build/runbuildscript.bat +0 -6
  23. data/html5-boilerplate/build/tools/ant-contrib-1.0b3.jar +0 -0
  24. data/html5-boilerplate/build/tools/closure-compiler-v1346.jar +0 -0
  25. data/html5-boilerplate/build/tools/csslint-rhino.js +0 -11138
  26. data/html5-boilerplate/build/tools/fulljshint.js +0 -5904
  27. data/html5-boilerplate/build/tools/fulljslint.js +0 -6651
  28. data/html5-boilerplate/build/tools/htmlcompressor-1.4.3.jar +0 -0
  29. data/html5-boilerplate/build/tools/jpegtran.exe +0 -0
  30. data/html5-boilerplate/build/tools/optipng-0.6.4-exe/LICENSE.txt +0 -21
  31. data/html5-boilerplate/build/tools/optipng-0.6.4-exe/optipng.exe +0 -0
  32. data/html5-boilerplate/build/tools/rhino.jar +0 -0
  33. data/html5-boilerplate/build/tools/yuicompressor-2.4.5.jar +0 -0
  34. data/html5-boilerplate/crossdomain.xml +0 -25
  35. data/html5-boilerplate/css/style.css +0 -293
  36. data/html5-boilerplate/demo/elements.html +0 -493
  37. data/html5-boilerplate/demo/hack.css +0 -84
  38. data/html5-boilerplate/demo/hack2.css +0 -41
  39. data/html5-boilerplate/demo/internet_explorer.png +0 -0
  40. data/html5-boilerplate/demo/test_tubes.png +0 -0
  41. data/html5-boilerplate/demo/tests.html +0 -300
  42. data/html5-boilerplate/favicon.ico +0 -0
  43. data/html5-boilerplate/humans.txt +0 -43
  44. data/html5-boilerplate/img/.gitignore +0 -2
  45. data/html5-boilerplate/index.html +0 -79
  46. data/html5-boilerplate/js/libs/jquery-1.6.3.js +0 -9044
  47. data/html5-boilerplate/js/libs/jquery-1.6.3.min.js +0 -4
  48. data/html5-boilerplate/js/libs/modernizr-2.0.6.min.js +0 -4
  49. data/html5-boilerplate/js/mylibs/.gitignore +0 -2
  50. data/html5-boilerplate/js/plugins.js +0 -20
  51. data/html5-boilerplate/js/script.js +0 -8
  52. data/html5-boilerplate/robots.txt +0 -5
  53. data/html5-boilerplate/test/index.html +0 -31
  54. data/html5-boilerplate/test/qunit/qunit.css +0 -148
  55. data/html5-boilerplate/test/qunit/qunit.js +0 -1265
  56. data/html5-boilerplate/test/tests.js +0 -24
@@ -1,38 +0,0 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8">
5
- <title>Page Not Found :(</title>
6
- <style>
7
- body { text-align: center;}
8
- h1 { font-size: 50px; text-align: center }
9
- span[frown] { transform: rotate(90deg); display:inline-block; color: #bbb; }
10
- body { font: 20px Constantia, 'Hoefler Text', "Adobe Caslon Pro", Baskerville, Georgia, Times, serif; color: #999; text-shadow: 2px 2px 2px rgba(200, 200, 200, 0.5); }
11
- ::-moz-selection{ background:#FF5E99; color:#fff; }
12
- ::selection { background:#FF5E99; color:#fff; }
13
- article {display:block; text-align: left; width: 500px; margin: 0 auto; }
14
-
15
- a { color: rgb(36, 109, 56); text-decoration:none; }
16
- a:hover { color: rgb(96, 73, 141) ; text-shadow: 2px 2px 2px rgba(36, 109, 56, 0.5); }
17
- </style>
18
- </head>
19
- <body>
20
- <article>
21
- <h1>Not found <span frown>:(</span></h1>
22
- <div>
23
- <p>Sorry, but the page you were trying to view does not exist.</p>
24
- <p>It looks like this was the result of either:</p>
25
- <ul>
26
- <li>a mistyped address</li>
27
- <li>an out-of-date link</li>
28
- </ul>
29
- </div>
30
-
31
- <script>
32
- var GOOG_FIXURL_LANG = (navigator.language || '').slice(0,2),
33
- GOOG_FIXURL_SITE = location.host;
34
- </script>
35
- <script src="http://linkhelp.clients.google.com/tbproxy/lh/wm/fixurl.js"></script>
36
- </article>
37
- </body>
38
- </html>
@@ -1,387 +0,0 @@
1
- # HTML5 Boilerplate [http://html5boilerplate.com](http://html5boilerplate.com)
2
-
3
- ## Changelog:
4
-
5
- ### v.2.0 : August 10th, 2011
6
-
7
- ### v2.0 HIGHLIGHTS
8
-
9
- #### NORMALIZE.CSS
10
-
11
- We are now using [normalize.css](http://github.com/necolas/normalize.css/) developed by Nicolas Gallagher along with Jonathan Neal instead of the traditional CSS Reset stylesheet.
12
-
13
- normalize.css retains useful browser defaults and includes several common fixes to improve cross-browser (desktop and mobile) styling consistency.
14
-
15
- Lots of research has gone into normalize, verifying what are the default user agent styles provided by each browser. We can very specifically change only the ones we need to instead of the bulldozer approach.
16
-
17
- ##### Why this is great news:
18
-
19
- * Who likes being so damn redundant and declaring: `em, i { font-style: italic; }`
20
- * By using normalization instead of a reset + building up default styles, we use less styles and save bytes
21
- * Less noise in your dev tools: when debugging, you don't have to trawl through every reset selector to reach the actual style that is causing the issue.
22
- * More details here: http://necolas.github.com/normalize.css/
23
-
24
-
25
- #### PROMPT CHROME FRAME FOR IE6
26
- * With the latest release of Chrome frame which does not require admin access to be installed, we felt it was a good time to prompt IE 6 users to install Chrome Frame. (Using protocol-relative url and exact version for higher expires headers)
27
-
28
-
29
- ####BUILD SCRIPT++: Faster, @import inlining, appcache generation
30
- * If 15 seconds was too long to wait before, you'll be happy with the changes. Via a new "intermediate" folder, we cut down build time by 80% or more.
31
- * If you use <code>@import</code>s in your CSS to author in multiple files, the build script will inline all these together. This way, you have a maintainable authoring experience, and still a highly performant production version.
32
- * Making an app that works offline is a badge of honor. Now with a flick of a config switch, the H5BP build script can autogenerate your cache manifest file with all the right info and wire it up. It'll also keep the manifest revved as you deploy new changes.
33
-
34
- ##### ADDING RESPOND.JS
35
- * Add `respond.js` as a shift to a responsive approach. Updated it to an improved, comment-free version which would enable IEs to also apply styles using media queries.
36
-
37
-
38
- #### PNGFIX & HANDHELD REMOVED
39
- * Remove `handheld.css` as we do not think it was useful among the diverse feature phones
40
- * We feel tools like imagealpha and pngquant are more useful than using stopgap fixes like belatedpng.
41
-
42
- ### detailed 2.0 changelog
43
-
44
- #### .HTACCESS
45
- * Disable directory browsing by default
46
- * removed trailing slash redirects in `.htaccess`. More: https://github.com/paulirish/html5-boilerplate/wiki/Proper-usage-of-trailing-slash-redirects #493 #515
47
- * Updating TTF mimetype to fix Google Chrome warning
48
- * Improved support for all versions of Apache, incl workaround for bug in `mod_filter`: Fixes #441. Fixes #499. Fixes #535. Closes #549. (the grouping ticket) Ref #576
49
- * Use substring matching in `gzip` `filter_module` and `re-enable gzip` for some common MIME-types
50
- * `mod_deflate` trigger rules modifications
51
- * Add gzip support for XHTML, RSS, Atom
52
- * Move font & SVG compression from FilesMatch to FilterProvider / AddOutputFilterByType
53
- * Added m4a (Need it for IE9) and m4v (HandBrake default) MIME types.
54
- * moved ETag removal configs closer
55
- * added Header unset ETag In some servers setting "FileETag None" alone, is not enough. Removing header and setting it to None fixes the issue.
56
- * Add `Options +FollowSymlinks` when `RewriteEngine` is used. Fixes #489.
57
- * Some more security for PHP: turn off `error display` and turn on `error logging`
58
- * Allow Blackberry to read vCards
59
-
60
-
61
- #### BUILD SCRIPT
62
- * CSSLint, JSLint, JSHint tools are now optionally available in the build script
63
- * New features in build script:
64
- * Added a `files.bypass` property which when set, will not compress the listed JavaScript files, but just silently passes it on to the publish folder without any change.
65
- * Added a `images.bypass` with a list of image files or folders within the img directory that you do not want to be optimized. Fixes #564
66
- * Build script is compatible with php files now. it appears. fixes #392.
67
- * Build script now generates `.appcache` manifest. see #652
68
- * Test for Ant version to head off problems with Ant < 1.8.2
69
- * Removes concatenated CSS files from `index.html` when they are `<link>` -ed. Fixes #452
70
- * Added `DOCTYPE` so IDEs don't complain about the lack of schema. http://stackoverflow.com/questions/363768/disable-dtd-warning-for-ant-scripts-in-eclipse
71
- * Updated Windows `optipng` and `jpegtran` paths to include `${basedir}`
72
- * Minification affects all `.css` and `.js` files in `/css` and `/js` dirs, not just the ones explicitly included in concatenation.
73
- * Build script: compress all images in subfolders, too.
74
- * Added `gae.js_dir` and `gae.css_dir` so that App Engine projects can have the correct directory names swapped in their templates.
75
- * Added a second replace token statement so that `/css/style.css` gets swapped too.
76
- * Change `*.png` and `*.jpg` to `**/*.png` and `**/*.jpg` so that optimize commands reach subdirectories.
77
- * Improved build script compatibility with Netbeans IDE. `default.properties`: added IDE generated files/folders to exclude from build script `.gitignore`: Filename case correction for Windows generated Thumb.db Fix #374
78
- * Adding properties to `project.properties` so that Google App Engine builds don't have "static" prepended when swapping for minified versions.
79
- * `console.log` messages are no longer commented out. use `log()` instead
80
-
81
- * Much faster build process
82
-
83
- Intermediate stages are stored in a new intermediate folder, and only
84
- files that should be published are copied into the publish folder.
85
-
86
- Files are not deleted at the beginning of every build, and files that
87
- have already been processed will not be reprocessed unless the source
88
- has changed.
89
-
90
- * Files are revved by SHA, not incrementally at each build
91
-
92
- Versioned files are referenced by a SHA-1 hash of the content rather
93
- than a build number. This means that changing your HTML and rebuilding
94
- will not cause your users to redownload the same CSS and JavaScript, and
95
- a reverted change may cause users to use a copy that was previously
96
- downloaded. It may be better to use only part of the hash so the HTTP
97
- request is shorter.
98
-
99
- * Copy files last. This slightly simplifies copying because we don't have to exclude PNG, JPEG, or HTML files from the copy stage. (It comes preminified, and we don't need to minify it again.) This also updates the HTML so that the script is not missing if the un-minified scripts are unavailable on the server. This commit requires a change to existing HTML files :/
100
- * Change the source htaccess rather than updating it
101
- * Update yuicompressor to 2.4.5. fixes media query minification issue.
102
- * Update htmlcompressor to 1.1 which uses the new yuicompressor for CSS.
103
- * Try not to re-optimize the same images every time
104
- * Lots of bug fixes for edge cases and improved techniques...
105
-
106
-
107
-
108
- #### INDEX.HTML
109
- * Use minified jQuery by default. / jQuery updated to 1.6.2
110
- * Add `respond.js` as part of shift to 'mobile first' approach.
111
- * Updated to Modernizr 2.0 Complete, Production minified.
112
- * Prompt IE 6 users to install Chrome Frame, update chromeframe install to 1.0.3. Move chromeframe to bottom of page after the other scripts. also reference exact version for higher expires headers. Use protocol-relative url for chrome frame URL Fixes #495
113
- * Removing touch icon link tags and retaining only the comment.
114
- * Encourage people to send the `X-UA-Compatible` HTTP header instead of leaving it in the HTML, to avoid edge case issues. Fixes #378.
115
- * Remove the cache-busting query parameters from the HTML.
116
- * Simplify the conditional comment containing code for IE 9+ and modern browsers
117
- * Simpler escape for `</script>`. See http://mathiasbynens.be/notes/etago for more information.
118
- * Encourage people to use a custom Modernizr build containing only the features they need for that particular project.
119
- * Added maximum touch-icon support as per http://mathiasbynens.be/notes/touch-icons#sizes
120
- * Add a link to optional `<meta>` tags that could be added to the `<head>` element: https://github.com/paulirish/html5-boilerplate/issues/482
121
- * Standardize the use of single and double quotes as per http://h5bp.com/d/The-markup★quotes
122
- * Added Site Speed tracking for Google Analytics
123
- * Google Analytics now retrieved with <code>Modernizr.load()</code> for byte brevity and optimal speed. Fixes #542
124
-
125
- #### STYLE.CSS
126
- * Major: Now using CSS normalization instead of CSS reset + building up default styles. Fixes #412, #500, #534. Closes #456. Links #566
127
- * Add `'oldie'` class to conditional `<html>` classnames. Fix #522
128
- * Add `img { max-width: 100%; }` to print styles to prevent images from getting cut off.
129
- * Update clearfix to use 'micro' clearfix http://nicolasgallagher.com/micro-clearfix-hack/
130
- * Add placeholder CSS media queries for mobile-first approach
131
- * Tweaking our hot pink `::selection`. It is now #fe57a1, which is Festal (adj): pertaining to or befitting a feast, festival, holiday, or gala occasion.
132
- * Use `color: black` for links when printing, refs #147
133
- * added `vertical-align: middle` to fix borders on image containers. Fixes #440
134
- * Add `<svg>` overflow fix for IE9. Group `<img>` and `<svg>` rules in an 'embedded content' section of CSS file. Add `{cursor:pointer}` to `<label>` element.
135
- * Switch to `outline:0` for accesible focus treatment. Avoids Opera bug when combined with transitions. Also saves bytes.
136
- * Set `{overflow:auto}` for `<button>` and `<input>` in `<table>` in IE6/7. Avoids numerous layout and whitespace issues that result from setting `{overflow:visible}` to fix the odd inner spacing of those form elements.
137
- * Add `{resize: vertical}` to `<textarea>`. Only allow vertical resizing
138
-
139
-
140
- #### MISC
141
-
142
- * `.gitignore` additions: textmate project folder, older CVS folders, sass_cache.
143
- * Update HTML elements demo: reduce repetition, remove deprecated elements, add certain HTML5 elements, add more comprehensive collection of HTML5 input types, include different form markup styles, add form elements box-sizing test
144
- * Add `.gitattributes` to help with consistent line endings
145
- * Changed curly quotes to straight quotes in `crossdomain.xml`
146
-
147
-
148
- #### Significant commits:
149
-
150
- * 26a391c60d0356e2e0dcf1929381583622e1be9c Revert "Added native iOS inertia scrolling"
151
- * ddaf66a515c09f835603f95fe723d7da691324e6 Major: Now using CSS normalization instead of CSS reset + building up default styles
152
- * e5e057e53815ed55f4ecfaef3057bf2940c7c0b2 Change our conditional comments around the HTML tag to use a single `.oldie` class.
153
- * 7f53f98ec734e6b655d7a50fd245277d388fac1e Revert "Change our conditional comments around the HTML tag to use a single `.oldie` class."
154
- * 648026d780dc6b9ecad8d37d61a92b69be5fd654 Tweaking our hot pink `::selection` based on a suggestion from David Murdoch and research from Adam Diehm.
155
- * 0e1c7ba929caddec63971cccfb7de7c0d343e060 Use minified jQuery by default.
156
- * a0ac99a4d96453e68ff4e650fca3055767ec26aa optimize build process
157
- * bb22ca66a8619808a87c1b5438845ed44baa4d3e Remove the cache-busting query parameters from the HTML.
158
-
159
-
160
- #### CONTRIBUTORS
161
- [alrra](https://github.com/alrra) [Adeel Ejaz](http://adeelejaz.com/) [David Murdoch](http://www.vervestudios.co/) [Jonathan Fielding](https://github.com/jonathan-fielding) [Robert Ros](https://github.com/rros) [Rob Larsen](http://htmlcssjavascript.com/) [William Meleyal](http://meleyal.com/) [Bruno De Barros](http://terraduo.com/) [Mike Almond](http://mikealmond.com/) [Frank](https://github.com/thatcoolguy) [Joey Baker](http://byjoeybaker.com/) [Ben Word](http://benword.com/) [Mike Botsko](http://www.botsko.net/) [Carlos Rosquillas](https://github.com/disusered) [Todd H. Gardner](https://github.com/toddhgardner) [rdeknijf](https://github.com/rdeknijf) [John Attebury](https://github.com/johnattebury) [Calvin Rien](https://github.com/darktable) [Ryan Seddon](https://github.com/ryanseddon) [Dayle Rees](http://www.daylerees.com/) [Ryan Smith-Roberts](https://lab.net/) [Brian Blakely](https://github.com/brianblakely) [Steve Heffernan](http://www.steveheffernan.com) [Barney Carroll](http://barneycarroll.com/) [Osman Gormus](https://github.com/gormus) [Jason Tokoph](http://www.mozes.com/) [See Guo Lin](http://see.guol.in/) [Jeremey Hustman](http://www.ukontrol.com/) [James Williams](http://jameswilliams.be/blog) [John-Scott Atlakson](https://github.com/jsma) [stereobooster](https://github.com/stereobooster) [walker](http://walkerhamilton.com/) [François Robichet](http://www.francois.robichet.com/) [leobetosouza](http://leobetosouza.com/) [Matthew Donoughe](http://static.dyndns.org/~mdonoughe/) [Patrick Hall](http://lotsofwords.org/) [Andy Dawson](http://www.ad7six.com/) [Daniel Filho](http://danielfilho.info/blog/) [Clément](https://github.com/clemos) [Joe Morgan](https://github.com/JoeMorgan) [Han Lin Yap](http://www.zencodez.net/) [Gregg Gajic](https://github.com/gg) [Michael Cetrulo](http://www.linkedin.com/in/web2samus) [Robert Doucette](https://github.com/robbyrice) [lexadecimal.com](http://lexadecimal.com/) [Adam Diehm](http://twitter.com/atdiehm)
162
-
163
-
164
- ### v.1.0 : March 21st, 2011
165
-
166
- #### Build Script
167
- <ul>
168
- <li>Files linked via <code>@import</code> will be inlined into the files they are imported to using Corey Hart's CSS Compressor.</li>
169
- <li>Environments are definable.</li>
170
- <li>htaccess Expires headers are upgraded to 1year, as the filenames are revved</li>
171
- <li>Massive rewrite so you can define which HTML, CSS, and JS files to operate on in your configurable project.properties files. This allows you to let the build script operate on unique folder architectures (including non-H5BP projects).</li>
172
- <li>Added a source directory option in the build config, so your source files can be in a different directory from the final generated files. (Useful for other CMSes/frameworks like Django.) </li>
173
- </ul>
174
-
175
- #### index.html
176
- <ul>
177
- <li>We use a <a href="http://paulirish.com/2010/the-protocol-relative-url/">protocol-relative URL</a> for the jQuery include, to prevent the mixed content warning.</li>
178
- <li>The order of <code>&lt;meta></code> tags, <code>&lt;title></code>, and <code>charset</code> has been <a href="https://github.com/paulirish/html5-boilerplate/wiki/The-markup">documented more extensively now</a>. TL;DR: You are <a href="https://github.com/paulirish/html5-boilerplate/commit/4b67ea5cabb8c2b75faf2e255344cdffdf190464">safe to use the boilerplate's order of tags</a>.</li>
179
- <li>We've shortened up the Google Analytics snippet.</li>
180
- <li>Added an ARIA <code>role</code> attribute to <code>div#main</code>. This assumes your main content goes within that container.</li>
181
- <li>IE9 doesn't get its own conditional class! Yay!</li>
182
- </ul>
183
-
184
- #### style.css
185
- <ul>
186
- <li>Added <code>.focusable</code> helper class, which extends <code>.visuallyhidden</code> to allow the element to be focusable when navigated to via the keyboard.</li>
187
- <li>Anchor links are no longer reset. Basically our reset is effectively merged with Eric Meyer's recent CSS reset update, and the HTML5 Doctor reset.</li>
188
- <li>An unordered list within a <code>&lt;nav></code> element will no longer have a margin.</li>
189
- <li>All helper classes are now after primary styles to ensure correct overrides and not be burdened with resets. </li>
190
- <li><code>.visuallyhidden</code> is no longer camelCase for consistency with other classname formats.</li>
191
- <li>Updated the specificity of <code>.visuallyhidden</code> to make sure it overrides all other declarations. </li>
192
- <li>Removed reset on <code>&lt;img></code> elements within table cells as they look ugly alongside multiline texts. Browsers default to baseline alignment for images, which works better than top alignment.</li>
193
- <li>Increased margin-left on <code>&lt;ol></code>, to allow for 2-digit list numbers.</li>
194
- <li>Added a print reset on IE's proprietary filters.</li>
195
- <li>Print styles no longer prints hash links or JavaScript links.</li>
196
- <li>Updated <code>&lt;sub></code>/<code>&lt;sup></code> CSS so that they're not impacted by <code>line-height</code>, so now you can do sub/superscripts without worrying.</li>
197
- </ul>
198
-
199
- #### Project
200
- <ul>
201
- <li>Added a <a href="http://humanstxt.org">humans.txt</a> so you can clarify authorship and tools used.</li>
202
- <li>Removed YUI profiling. You probably weren't using it anyway.</li>
203
- <li>Removed QUnit's unit tests. There is no need to ship with them, really.</li>
204
- </ul>
205
-
206
- #### Webserver Configs
207
- #### .htaccess
208
- <ul>
209
- <li>.htaccess is far more documented now. Take a read through it!</li>
210
- <li><a href="https://github.com/paulirish/html5-boilerplate/commit/37b5fec090d00f38de64b591bcddcb205aadf8ee">Changed mimetype of <code>.ico</code> files to <code>image/x-icon</code></a>.</li>
211
- <li>HTML Manifest files now use <code>.appcache</code> extension instead of <code>.manifest</code>, as per <a href="http://html5.org/r/5812">http://html5.org/r/5812</a>.</li>
212
- <li>Force deflate for accept-encoding headers mangled by turtle tappers, courtesy of <a href="http://developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping/">Yahoo!'s research</a></li>
213
- <li>We nerfed some of the directives in case you're on a server without <code>mod_headers</code>. (Which is totally crazy, man!)</li>
214
- <li>Block access to <code>.git</code> and <code>.svn</code> folders.</li>
215
- <li>Eradicating Chrome's console warning on WOFF font downloads.</li>
216
- <li>More optimizations available if you set the <code>.htaccess</code> details up in your <code>httpd.conf</code></li>
217
- <li><code>.htaccess</code> now caches <code>.htc</code> files</li>
218
-
219
- <li>Moved all server configurations (except Apache's <code>.htaccess</code>) over to <a href ="https://github.com/paulirish/html5-boilerplate-server-configs">the new html5-boilerplate-server-configs repo</a>. Head over there if you're not using Apache. </li>
220
-
221
- <li>Updated <code>.htaccess</code> and <code>mime.types</code> for <code>ogg</code> formats.</li>
222
- <li>Fixed regression where EOT fonts had been excluded from DEFLATE compression</li>
223
- <li>Apache version independence: Use <code>mod_filter</code> for compression, with fallback to AddOutputFilterByType directive for legacy versions</li>
224
- <li>Added plugin/extension mime types for Safari, Chrome, Firefox</li>
225
- </ul>
226
- #### nginx
227
- <ul>
228
- <li>Cleaned up cache expires directives.</li>
229
- <li>Now includes SVG and font formats for gzipping.</li>
230
- <li>expires header bug fixed.</li>
231
- </ul>
232
- #### IIS
233
- <ul>
234
- <li>Added Flash video mime types to IIS server</li>
235
- <li>Fixed some mimetype weirdness that was preventing proper caching</li>
236
- </ul>
237
-
238
- <ul>
239
- <li>Also Google App Engine, Lighttpd, and NodeJS <a href="https://github.com/paulirish/html5-boilerplate-server-configs">configurations were added</a></li>
240
- </ul>
241
-
242
- <p>Basically a lot of great updates were made for 1.0. <a href="https://github.com/paulirish/html5-boilerplate/compare/v0.9.5...v1.0">Here are all 220 commits since last release.</a>. You may ask though, <a href="http://html5boilerplate.com/docs/#FAQs★do-i-need-to-upgrade-my-sites-to-a-new-version">do I need to upgrade existing sites</a>? Short answer: nah, you're good.</p>
243
-
244
- #### Contributors
245
- [Mickael Daniel](http://blog.mklog.fr/), Dave Kirk, [Jonathan Verrecchia](http://www.html5-css3.fr/), [nlogax](https://github.com/nlogax), [Rob Larsen](http://htmlcssjavascript.com/),
246
- [David Murdoch](http://www.vervestudios.co/), [AD7six](http://www.ad7six.com/),
247
- [Mathias Bynens](http://mathiasbynens.be/), [Michael van Laar](http://www.michael-van-laar.de/), [Mike West](http://mikewest.org/), [Mikko Tikkanen](http://www.mintusability.com/), [Velir](http://velir.com/), [Stephen Gariepy](http://garowetz.ca/)
248
-
249
- ##### Boilerplate
250
- [Adam J. McIntyre](http://www.amodernfable.com/), [Adeel Ejaz](http://adeelejaz.com/), akolesnikov, [Alex Dunae](http://dialect.ca/), [Andrew Le](http://andrewdle.com/), [ashnur](https://github.com/ashnur), [Ben Truyman](http://bentruyman.com/), [Bruno Aguirre](http://brunoaguirre.com/), [Chris Hager](http://metachris.org/), [Corey Ward](http://blog.coreyward.net/), [Craig Barnes](https://github.com/craigbarnes), crappish, [Daniel Schildt](http://autiomaa.org/), [Dave DeSandro](https://github.com/daveatnclud), [Dustin Whittle](http://dustinwhittle.com/), grigio, [Irakli Nadareishvili](http://freshblurbs.com/), [Jaime Bueza](http://jaime.bueza.com/), [Jake Ingman](https://github.com/jingman), [James A. Rosen](http://jamesarosen.com/), [Jeremy Balch](https://github.com/balchjd), [joe bartlett](http://twitter.com/jdbartlett), [Joe Sak](http://www.joesak.com/), [John Bacon](https://github.com/johnbacon)
251
- [Jonathan Fielding](https://github.com/jonathan-fielding), [Jonathan Neal](http://iecss.com/), [kblomqvist](https://github.com/kblomqvist), [Kenneth Nordahl](http://nordahl.me/), [Maarten Verbaarschot](https://github.com/mverbaar), [Manuel Strehl](http://www.manuel-strehl.de/), [Marcel Turi](http://marcel.turi.co/), [Martin Hintzmann](https://github.com/Hintzmann), [mikealmond](https://github.com/mikealmond)
252
- [mikkotikkanen](http://www.mintusability.com/), [Nic Pottier](https://github.com/nicpottier), [Paul Neave](http://www.neave.com/), [Peter Beverloo](http://peter.sh/), [Rick Waldron](http://weblog.bocoup.com/), [Rob Flaherty](http://www.ravelrumba.com/), [S Anand](http://www.s-anand.net/), [Sam Sherlock](http://samsherlock.com/), [Michael Cetrulo](http://www.linkedin.com/in/web2samus), [simshaun](https://github.com/simshaun), [Sirupsen](http://sirupsen.com/), [Stephen Gariepy](http://garowetz.ca/), [timemachine3030 ](https://github.com/timemachine3030), [Vinay](http://www.artminister.com/), [Weston Ruter](http://weston.ruter.net/), [WraithKenny](http://unfocus.com/), [Yann Mainier](http://yann.mainier.com/), [Michael van Laar](http://www.michael-van-laar.de/), [Massimo Lombardo](http://unwiredbrain.com/), [Ivan Nikolić ](http://twitter.com/niksy), [Kaelig](http://kaelig.fr/), [Richard Bradshaw](http://bradshawenterprises.com/), [SammyK](http://sammyk.me/), [alrra](https://github.com/alrra), [Rizky Syazuli](http://id.linkedin.com/in/rizky), [iszak](https://github.com/Iszak), [aaron peters](https://github.com/aaronpeters), [Swaroop C H](http://www.swaroopch.com/), [Mike Połtyn](http://mike.poltyn.com/), Marco d'Itri, Mike Lamb , [BIG Folio](http://bigfolio.com/), Philip von Bargen, Meander, Daniel Harttman, rse, timwillison, ken nordahl, [Erik Dahlström](http://my.opera.com/macdev_ed), christopherjacob, [Chew Choon Keat](http://blog.choonkeat.com/), benalman, stoyan, Markus, [Vladimir Carrer](http://www.vcarrer.com/), [aristidesfl](https://github.com/aristidesfl), [Trevor Norris](http://blog.trevorjnorris.com/) [Miloš Gavrilović](http://www.arvag.net/)
253
-
254
-
255
-
256
- #####Configs
257
- [Dusan Hlavaty](http://sk.linkedin.com/in/dusanhlavaty), [Sean Caetano Martin](http://www.xonecas.com/), [yaph](http://www.ramiro.org/), [michaud](https://github.com/michaud), Paul Sarena, [Graham Weldon](http://grahamweldon.com/), [Ron. Adams](http://visual-assault.org/)
258
-
259
- #####Translators
260
- [alrra](http://twitter.com/alrra), [Anton Kovalyov](http://self.kovalyov.net/), [Milos Gavrilovic](http://www.arvag.net/), [jorge-vitrubio](https://github.com/jorge-vitrubio), Julian Wachholz, [laviperchik](https://github.com/laviperchik), [lenzcom](https://github.com/lenzcom), [Mathias Bynens](http://mathiasbynens.be/), [Mickael Daniel](http://blog.mklog.fr/), [Mike West](http://mikewest.org/), [Niels Bom](http://www.nielsbom.com/), Ricardo Tomasi, [skill83 ](https://github.com/skill83), [Sean Caetano Martin](http://www.xonecas.com/), [Yuya Saito](http://css.studiomohawk.com/), [Zee-Julien](https://github.com/Zee-Julien)
261
-
262
-
263
- ### v.0.9.5 : October 25th, 2010
264
-
265
- Major changes:
266
-
267
- <ul>
268
- <li>Removed <code>-webkit-font-smoothing: antialiased;</code> it makes monospace too thin.</li>
269
- <li>IE conditional classes have moved from the <code>&lt;body&gt;</code> tag to the <code>&lt;html&gt;</code> tag ( #44 ).</li>
270
- <li>Dropped <code>text-rendering: <a href="http://www.aestheticallyloyal.com/public/optimize-legibility/">optimizeLegibility</a></code> as it breaks small-caps, looks odd on Linux machines, and goes invisible on WebOS.</li>
271
- <li>Added a IE6 call for the minified <code>dd_belatedpng</code>.</li>
272
- <li>Revised viewport declaration to allow user scaling and clear Webkit console errors ( #37 ).</li>
273
- <li>Updated Modernizr to 1.6 </li>
274
- <li>Added <code>web.config</code> file for Microsoft IIS</li>
275
- <li>Beta release of the <a href="http://github.com/paulirish/html5-boilerplate/wiki/Build-script">Build Script</a> (this is HUGE)</li>
276
- <li>New project scaffolding <a href="http://github.com/paulirish/html5-boilerplate/wiki/makep.sh">bash script</a>.</li>
277
- </ul>
278
-
279
- #### General
280
- * Updated Modernizr to 1.6 (smaller and faster)
281
- * Added web.config file for Microsoft IIS. Now forcing latest IE version and ChromeFrame, if installed.
282
- * Added <code>favicon</code> and <code>default icon</code> for iOS.
283
- * Updated <code>crossdomain.xml</code> wording for better security guidelines ( #124 ).
284
- * Expires value for <code>nginx.conf</code> corrected.
285
- * License clarified.
286
-
287
- #### style.css
288
- * Removed <code>-webkit-font-smoothing: antialiased</code> as it made monospace too thin.
289
- * Updated fonts normalization to YUI 3.2.0 PR1.
290
- * Table Header set explicitly for IE6, and table row now has <code>page-break: avoid</code> in print CSS.
291
- * <code>text-shadow:none !important</code> set for all text in print CSS.
292
- * Removed scrollbar from <code>&lt;textarea></code>s in IE.
293
- * Fixed <code>&lt;textarea></code> stylings and form field treatment for validity. Added default <code>background-color</code>.
294
- * New robust clearfix solution without IE 5.5 hack ( #45 #126 ).
295
- * Margins for form-elements explicitly set to <code>0</code> as webkit adds 2px space around form elements' chrome.
296
- * Dropped <code>text-rendering: optimizeLegibility</code> as it breaks <code>small-caps</code> and looks odd on Linux machines.
297
- * Lists now have a left margin of <code>1.8em</code>. Default <code>list-style-type</code> for ordered list is <code>decimal</code>.
298
- * Image Replacement now works with right-to-left text ( #68 ).
299
- * Removed "Star Hack" for checkboxes in favor of <code>.ie7</code> selector.
300
-
301
- #### index.html
302
- * IE conditional classes have moved from the <code>&lt;body></code> tag to the <code>&lt;html></code> tag ( #44 ).
303
- * Added a IE6 call for the minified <code>dd_belatedpng</code>.
304
- * Google Analytics script will now work with SSL in IE6.
305
- * Added protocol independent absolute path for cdn jquery, with improved fallback-to-local code to protect against edge case IE bug.
306
- * Commented out handheld CSS ( #73 ).
307
- * Mobile viewport and textsize styles adjusted per group feedback ( #37 ).
308
-
309
- #### .htaccess
310
- * More files are served via gzip like <code>.htc</code> ( #55 ).
311
- * Added Expires header for content types image/gif and video/webm.
312
- * Fixed favicon display in IE6 ( #113 ).
313
- * Corrected mimetypes for fonts.
314
- * Removed caching for files of type json/xml.
315
- * Better use of <code>ifmodule</code> for more stability in different Apache environments.
316
-
317
- [View full diff and commit history](http://github.com/paulirish/html5-boilerplate/compare/v0.9.1...v0.9.5)
318
-
319
-
320
- #### Contributors
321
- Shi Chuan, Rob Larsen, Ivan Nikolić, Mikko Tikkanen, Velir, Paul Neave, Weston Ruter, Jeffrey Barke, Robert Meissner, SirFunk, Philip von Bargen, Kroc Camen, Rick Waldron, Andreas Madsen, Marco d'Itri, Adeelejaz, James Rosen, Dave DeSandro, Ken Newman, Daniel Lenz, Swaroop C H, Yann Mainier, Joe Sak, Irakli, Rob Flaherty, Jeff Starr, Mike Lamb, Holek, Aaron Peters, Kaelig, Meander, Charlie Ussery, Ciney, Région Wallonne, Sirupsen, and Paul Hayes.
322
-
323
-
324
-
325
- ### v.0.9.1 : August 13th, 2010
326
- * HTML5 Boilerplate is now in the Public Domain
327
- * Nginx configuration added
328
- * Font stacks (sans-serif and monospace) simplified
329
- * Very accessible <code>a:focus</code> styles.
330
- * Corrected IE=edge,chromeframe enabling (As a result, the base HTML [does not validate](http://bit.ly/cGSSgr))
331
- * ServerSideIncludes disabled by default.
332
- * Apache config bugfixes
333
- * Conditional body tag class combined
334
- * dd_belatedPNG updated to 0.0.8. Redundant BackgroundImageCache fix removed.
335
-
336
- [View full diff and commit history](http://github.com/paulirish/html5-boilerplate/compare/v0.9...v0.9.1)
337
-
338
- ##### Thanks:
339
-
340
- voodootikigod, garowetz, fearphage, christopherjacob, mathias bynens, daniel harttman, rse, chris dary, erik dahlstrom, timwillison, kenneth nordahl, riddle, elcuervo, andreas kuckartz, 3rdEden, riley willis, majic3
341
-
342
- ### v0.9 : August 10th, 2010 - Initial release
343
-
344
-
345
- ## License:
346
-
347
- Major components:
348
-
349
- * Modernizr: MIT/BSD license
350
- * jQuery: MIT/GPL license
351
- * DD_belatedPNG: MIT license
352
- * YUI Profiling: BSD license
353
- * HTML5Doctor CSS reset: Public Domain
354
- * CSS Reset Reloaded: Public Domain
355
-
356
- Everything else:
357
-
358
- * [The Unlicense](http://unlicense.org) (aka: public domain)
359
-
360
-
361
- ## Summary:
362
-
363
- This is a set of files that a front-end developer can use to get started on a website, with following included:
364
-
365
- 1. Cross-browser compatible (IE6? Yeah, we got that.)
366
- 2. HTML5 ready. Use the new tags with certainty.
367
- 3. Optimal caching and compression rules for Grade-A performance
368
- 4. Best practice site configuration defaults
369
- 5. Think there's too much? The HTML5 Boilerplate is delete-key friendly. :)
370
- 6. Mobile browser optimizations
371
- 7. Progressive enhancement graceful degredation ........ yeah yeah we got that
372
- 8. IE-specific classes for maximum cross-browser control
373
- 9. Want to write unit tests but lazy? A full, hooked up test suite is waiting for you.
374
- 10. Javascript profiling…in IE6 and IE7? Sure, no problem.
375
- 11. Console.log nerfing so you won't break anyone by mistake.
376
- 12. Never go wrong with your doctype or markup!
377
- 13. An optimal print stylesheet, performance optimized
378
- 14. iOS, Android, Opera Mobile-adaptable markup and CSS skeleton.
379
- 15. IE6 pngfix baked in.
380
- 16. jQuery, waiting for you
381
-
382
- ## Releases
383
-
384
- There are two releases: a documented release (which is exactly what you see here), and a "stripped" release (with most of the descriptive comments stripped out).
385
-
386
- Watch the [current tickets](http://github.com/paulirish/html5-boilerplate/issues) to view the areas of active development.
387
-
Binary file
@@ -1,1051 +0,0 @@
1
- <?xml version="1.0"?>
2
- <!DOCTYPE project>
3
- <project name="Boilerplate Build" default="build" basedir="../"> <!-- one back since we're in build/ -->
4
-
5
-
6
- <!-- Load in Ant-Contrib to give us access to some very useful tasks! -->
7
- <!-- the .jar file is located in the tools directory -->
8
- <taskdef resource="net/sf/antcontrib/antlib.xml">
9
- <classpath>
10
- <pathelement location="${basedir}/build/tools/ant-contrib-1.0b3.jar"/>
11
- </classpath>
12
- </taskdef>
13
-
14
- <!-- load shell environment -->
15
- <property environment="ENV" />
16
-
17
- <!-- load property files -->
18
- <property file="build/config/project.properties"/>
19
- <property file="build/config/default.properties"/>
20
-
21
- <!-- merge the stylesheet properties -->
22
- <var name="stylesheet-files" value="${file.default.stylesheets}, ${file.stylesheets}"/>
23
-
24
- <!-- merge the pages properties -->
25
- <var name="page-files" value="${file.pages}, ${file.pages.default.include}"/>
26
-
27
- <!-- Test for Ant Version Delete this task and all instances of overwrite='no' if you can't upgrade to 1.8.2-->
28
- <fail message="All features of the build script require Ant version 1.8.2. Please upgrade to 1.8.2 or remove all instances of 'overwrite=no' (and this fail task) from the build script to continue">
29
- <condition>
30
- <not>
31
- <contains string="${ant.version}" substring="1.8.2"/>
32
- </not>
33
- </condition>
34
- </fail>
35
-
36
- <!--
37
- *************************************************
38
- * BASE TARGETS *
39
- *************************************************
40
- -->
41
- <target name="basics">
42
- <if>
43
- <equals arg1="${env}" arg2="dev"/>
44
- <then>
45
- <!-- Build a dev environment -->
46
- <echo message="Building a Development Environment..."/>
47
- <antcall target="-basics.dev"/>
48
- </then>
49
-
50
- <elseif>
51
- <equals arg1="${env}" arg2="test"/>
52
- <then>
53
- <!-- Build a test environment -->
54
- <echo message="Building a Test Environment..."/>
55
- <antcall target="-basics.test"/>
56
- </then>
57
- </elseif>
58
-
59
- <else>
60
- <!-- Build a production environment -->
61
- <echo message="Building a Production Environment..."/>
62
- <antcall target="-basics.production"/>
63
- </else>
64
- </if>
65
- </target>
66
-
67
-
68
- <target name="text">
69
- <if>
70
- <equals arg1="${env}" arg2="dev"/>
71
- <then>
72
- <!-- Build a dev environment -->
73
- <echo message="Building a Development Environment..."/>
74
- <antcall target="-text.dev"/>
75
- </then>
76
-
77
- <elseif>
78
- <equals arg1="${env}" arg2="test"/>
79
- <then>
80
- <!-- Build a test environment -->
81
- <echo message="Building a Test Environment..."/>
82
- <antcall target="-text.test"/>
83
- </then>
84
- </elseif>
85
-
86
- <else>
87
- <!-- Build a production environment -->
88
- <echo message="Building a Production Environment..."/>
89
- <antcall target="-text.production"/>
90
- </else>
91
- </if>
92
- <antcall target="-imgcopy"/>
93
- </target>
94
-
95
-
96
- <target name="buildkit">
97
- <if>
98
- <equals arg1="${env}" arg2="dev"/>
99
- <then>
100
- <!-- Build a dev environment -->
101
- <echo message="Building a Development Environment..."/>
102
- <antcall target="-buildkit.dev"/>
103
- </then>
104
-
105
- <elseif>
106
- <equals arg1="${env}" arg2="test"/>
107
- <then>
108
- <!-- Build a test environment -->
109
- <echo message="Building a Test Environment..."/>
110
- <antcall target="-buildkit.test"/>
111
- </then>
112
- </elseif>
113
-
114
- <else>
115
- <!-- Build a production environment -->
116
- <echo message="Building a Production Environment..."/>
117
- <antcall target="-buildkit.production"/>
118
- </else>
119
- </if>
120
- </target>
121
-
122
-
123
- <target name="build">
124
- <if>
125
- <equals arg1="${env}" arg2="dev"/>
126
- <then>
127
- <!-- Build a dev environment -->
128
- <echo message="Building a Development Environment..."/>
129
- <antcall target="-build.dev" />
130
- </then>
131
-
132
- <elseif>
133
- <equals arg1="${env}" arg2="test"/>
134
- <then>
135
- <!-- Build a test environment -->
136
- <echo message="Building a Test Environment..."/>
137
- <antcall target="-build.test" />
138
- </then>
139
- </elseif>
140
-
141
- <else>
142
- <!-- Build a production environment -->
143
- <echo message="Building a Production Environment..."/>
144
- <antcall target="-build.production" />
145
- </else>
146
- </if>
147
- </target>
148
-
149
-
150
- <target name="minify">
151
- <if>
152
- <equals arg1="${env}" arg2="dev"/>
153
- <then>
154
- <!-- Build a dev environment -->
155
- <echo message="Building a Development Environment..."/>
156
- <antcall target="-minify.dev"/>
157
- </then>
158
-
159
- <elseif>
160
- <equals arg1="${env}" arg2="test"/>
161
- <then>
162
- <!-- Build a test environment -->
163
- <echo message="Building a Test Environment..."/>
164
- <antcall target="-minify.test"/>
165
- </then>
166
- </elseif>
167
-
168
- <else>
169
- <!-- Build a production environment -->
170
- <echo message="Building a Production Environment..."/>
171
- <antcall target="-minify.production"/>
172
- </else>
173
- </if>
174
- </target>
175
-
176
- <target name="clean" depends="-clean"/>
177
-
178
-
179
-
180
- <!-- JSLint target, run separately -->
181
- <target name="jslint">
182
- <apply dir="${dir.source}/${dir.js}" executable="java" parallel="false" failonerror="true">
183
- <fileset dir="./${dir.source}/">
184
- <include name="**/${dir.js}/*.js"/>
185
- <exclude name="**/*.min.js"/>
186
- <exclude name="**/${dir.js.libs}/"/>
187
- <exclude name="**/${dir.publish}/"/>
188
- </fileset>
189
- <arg value="-jar" />
190
- <arg path="./${dir.build.tools}/${tool.rhino}" />
191
- <arg path="./${dir.build.tools}/${tool.jslint}" />
192
- <srcfile/>
193
- <arg value="${tool.jslint.opts}" />
194
- </apply>
195
- <echo>JSLint Successful</echo>
196
- </target>
197
-
198
-
199
- <!-- JSHint target, run separately -->
200
- <target name="jshint">
201
- <apply dir="${dir.source}/${dir.js}" executable="java" parallel="false" failonerror="true">
202
- <fileset dir="./${dir.source}/">
203
- <include name="**/${dir.js}/*.js"/>
204
- <exclude name="**/*.min.js"/>
205
- <exclude name="**/${dir.js.libs}/"/>
206
- <exclude name="**/${dir.publish}/"/>
207
- </fileset>
208
- <arg value="-jar" />
209
- <arg path="./${dir.build.tools}/${tool.rhino}" />
210
- <arg path="./${dir.build.tools}/${tool.jshint}" />
211
- <srcfile/>
212
- <arg value="${tool.jshint.opts}" />
213
- </apply>
214
- <echo>JSHint Successful</echo>
215
- </target>
216
-
217
- <!-- CSSLint target, run separately -->
218
- <target name="csslint">
219
- <apply dir="${dir.source}/${dir.css}" executable="java" parallel="false" failonerror="true">
220
- <fileset dir="./${dir.source}/">
221
- <include name="**/${dir.css}/*.css"/>
222
- <exclude name="**/*.min.css"/>
223
- <exclude name="**/${dir.publish}/"/>
224
- </fileset>
225
- <arg value="-jar" />
226
- <arg path="./${dir.build.tools}/${tool.rhino}" />
227
- <arg path="./${dir.build.tools}/${tool.csslint}" />
228
- <srcfile/>
229
- <arg value="${tool.csslint.opts}" />
230
- </apply>
231
- <echo>CSSLint Successful</echo>
232
- </target>
233
-
234
- <!--
235
- *************************************************
236
- * BUILD TARGETS *
237
- *************************************************
238
- -->
239
-
240
- <!-- Target: basics -->
241
- <target name="-basics.dev"
242
- depends="-intro,
243
- -copy"/>
244
-
245
- <target name="-basics.test"
246
- depends="-intro,
247
- -usemin,
248
- -js.all.minify,
249
- -js.main.concat,
250
- -js.mylibs.concat,
251
- -js.scripts.concat,
252
- -css,
253
- -manifest,
254
- -copy"/>
255
-
256
- <target name="-basics.production"
257
- depends="-intro,
258
- -usemin,
259
- -js.all.minify,
260
- -js.main.concat,
261
- -js.mylibs.concat,
262
- -js.scripts.concat,
263
- -css,
264
- -manifest,
265
- -copy"/>
266
-
267
- <!-- Target: text -->
268
- <target name="-text.dev"
269
- depends="-intro,
270
- -copy"/>
271
-
272
- <target name="-text.test"
273
- depends="-intro,
274
- -usemin,
275
- -js.all.minify,
276
- -js.main.concat,
277
- -js.mylibs.concat,
278
- -js.scripts.concat,
279
- -css,
280
- -manifest,
281
- -htmlclean,
282
- -copy"/>
283
-
284
- <target name="-text.production"
285
- depends="-intro,
286
- -usemin,
287
- -js.all.minify,
288
- -js.main.concat,
289
- -js.mylibs.concat,
290
- -js.scripts.concat,
291
- -css,
292
- -manifest,
293
- -htmlclean,
294
- -copy"/>
295
-
296
- <!-- Target: buildkit -->
297
- <target name="-buildkit.dev"
298
- depends="-intro,
299
- -imagespng,
300
- -imagesjpg,
301
- -copy"/>
302
-
303
- <target name="-buildkit.test"
304
- depends="-intro,
305
- -usemin,
306
- -js.all.minify,
307
- -js.main.concat,
308
- -js.mylibs.concat,
309
- -js.scripts.concat,
310
- -css,
311
- -manifest,
312
- -htmlbuildkit,
313
- -imagespng,
314
- -imagesjpg,
315
- -copy"/>
316
-
317
- <target name="-buildkit.production"
318
- depends="-intro,
319
- -usemin,
320
- -js.all.minify,
321
- -js.main.concat,
322
- -js.mylibs.concat,
323
- -js.scripts.concat,
324
- -css,
325
- -manifest,
326
- -htmlbuildkit,
327
- -imagespng,
328
- -imagesjpg,
329
- -copy"/>
330
-
331
- <!-- Target: build -->
332
- <target name="-build.dev"
333
- depends="-intro,
334
- -imagespng,
335
- -imagesjpg,
336
- -copy"/>
337
-
338
- <target name="-build.test"
339
- depends="-intro,
340
- -usemin,
341
- -js.all.minify,
342
- -js.main.concat,
343
- -js.mylibs.concat,
344
- -js.scripts.concat,
345
- -css,
346
- -manifest,
347
- -htmlclean,
348
- -imagespng,
349
- -imagesjpg,
350
- -copy"/>
351
-
352
- <target name="-build.production"
353
- depends="-intro,
354
- -usemin,
355
- -js.all.minify,
356
- -js.main.concat,
357
- -js.mylibs.concat,
358
- -js.scripts.concat,
359
- -css,
360
- -manifest,
361
- -htmlclean,
362
- -imagespng,
363
- -imagesjpg,
364
- -copy"/>
365
-
366
- <!-- Target: minify -->
367
- <target name="-minify.dev"
368
- depends="-intro,
369
- -imagespng,
370
- -imagesjpg,
371
- -copy"/>
372
-
373
- <target name="-minify.test"
374
- depends="-intro,
375
- -usemin,
376
- -js.all.minify,
377
- -js.main.concat,
378
- -js.mylibs.concat,
379
- -js.scripts.concat,
380
- -css,
381
- -manifest,
382
- -htmlcompress,
383
- -imagespng,
384
- -imagesjpg,
385
- -copy"/>
386
-
387
- <target name="-minify.production"
388
- depends="-intro,
389
- -usemin,
390
- -js.all.minify,
391
- -js.main.concat,
392
- -js.mylibs.concat,
393
- -js.scripts.concat,
394
- -css,
395
- -manifest,
396
- -htmlcompress,
397
- -imagespng,
398
- -imagesjpg,
399
- -copy"/>
400
-
401
- <!--
402
- *************************************************
403
- * FUNCTION TARGETS *
404
- *************************************************
405
- -->
406
-
407
- <target name="-clean" description="(PRIVATE) Wipe the previous build (Deletes the dir.publish directory">
408
- <!-- This is a private target -->
409
- <echo message="Cleaning up previous build directory..."/>
410
- <delete dir="./${dir.intermediate}/"/>
411
- <delete dir="./${dir.publish}/"/>
412
- </target>
413
-
414
-
415
- <target name="-intro" description="(PRIVATE) Kindly inform the developer about the impending magic">
416
- <!-- This is a private target -->
417
-
418
- <echo message="====================================================================="/>
419
- <echo message="Welcome to the HTML5 Boilerplate Build Script!"/>
420
- <echo message=" "/>
421
- <echo message="We're going to get your site all ship-shape and ready for prime time."/>
422
- <echo message=" "/>
423
- <echo message="This should take somewhere between 15 seconds and a few minutes,"/>
424
- <echo message="mostly depending on how many images we're going to compress."/>
425
- <echo message=" "/>
426
- <echo message="Feel free to come back or stay here and follow along."/>
427
- <echo message="====================================================================="/>
428
- <echo message=" "/>
429
- <echo message=" "/>
430
-
431
- </target>
432
-
433
- <target name="-mkdirs">
434
- <if>
435
- <or>
436
- <equals arg1="${dir.publish}" arg2="."/>
437
- <equals arg1="${dir.publish}" arg2=".."/>
438
- <equals arg1="${dir.publish}" arg2="/"/>
439
- <equals arg1="${dir.publish}" arg2="./"/>
440
- <equals arg1="${dir.publish}" arg2="../"/>
441
- </or>
442
- <then>
443
- <fail message="Your dir.publish folder is set to ${dir.publish} which could delete your entire site or worse. Change it in project.properties"/>
444
- </then>
445
- <else>
446
- <echo message="Creating directory structure... ${dir.publish}"/>
447
-
448
- <mkdir dir="${dir.intermediate}"/>
449
- <copy todir="${dir.intermediate}" includeEmptyDirs="true">
450
- <fileset dir="${dir.source}/" excludes="${file.default.exclude}, ${file.exclude}">
451
- <type type="dir"/>
452
- </fileset>
453
- </copy>
454
- <mkdir dir="${dir.publish}"/>
455
- <copy todir="${dir.publish}" includeEmptyDirs="true">
456
- <fileset dir="${dir.source}/" excludes="${file.default.exclude}, ${file.exclude}">
457
- <type type="dir"/>
458
- </fileset>
459
- </copy>
460
- </else>
461
- </if>
462
- </target>
463
-
464
- <target name="-copy" depends="-mkdirs">
465
- <!-- This is a private target -->
466
-
467
- <echo message="Copying over new files..."/>
468
-
469
- <copy todir="./${dir.publish}">
470
- <fileset dir="${dir.source}/" excludes="${file.default.exclude}, ${file.exclude}">
471
- <!-- exclude files that are superseded by optimized versions with different names -->
472
- <!-- this is not strictly necessary, but it avoids putting unreferenced files into your server -->
473
- <exclude name="${dir.js}/**/*.js"/>
474
- <exclude name="${dir.css}/**/*.css"/>
475
- <exclude name="${file.manifest}"/>
476
- </fileset>
477
- </copy>
478
-
479
- <echo message="A copy of all non-dev files are now in: ./${dir.publish}."/>
480
- </target>
481
-
482
- <!-- JAVASCRIPT -->
483
- <target name="-js.main.concat" depends="-js.all.minify" description="(PRIVATE) Concatenates the JS files in dir.js">
484
- <echo message="Concatenating Main JS scripts..."/>
485
- <!-- overwrite=no here means not to overwrite if the target is newer than the sources -->
486
- <concat destfile="./${dir.intermediate}/${dir.js}/scripts-concat.js" overwrite="no">
487
- <fileset dir="./${dir.intermediate}/">
488
- <include name="${dir.js.main}/plugins.js"/>
489
- <include name="${dir.js.main}/${file.root.script}"/>
490
- </fileset>
491
- </concat>
492
- </target>
493
-
494
- <target name="-js.mylibs.concat" depends="-js.all.minify" description="(PRIVATE) Concatenates the JS files in dir.js.mylibs">
495
- <mkdir dir="./${dir.intermediate}/${dir.js.mylibs}"/>
496
-
497
- <echo message="Concatenating JS libraries"/>
498
- <!-- overwrite=no here means not to overwrite if the target is newer than the sources -->
499
- <concat destfile="./${dir.intermediate}/${dir.js}/mylibs-concat.js" overwrite="no">
500
- <fileset dir="./${dir.intermediate}/${dir.js.mylibs}/"
501
- includes="**/*.js"
502
- excludes="${file.js.bypass}"/>
503
-
504
- </concat>
505
- </target>
506
-
507
-
508
- <target name="-js.scripts.concat" depends="-js.main.concat,-js.mylibs.concat" if="build.concat.scripts">
509
- <echo message="Concatenating library file with main script file"/>
510
- <!-- overwrite=no here means not to overwrite if the target is newer than the sources -->
511
- <concat destfile="./${dir.intermediate}/${dir.js}/scripts-concat.min.js" overwrite="no">
512
- <fileset dir="./${dir.intermediate}/${dir.js}/">
513
- <include name="mylibs-concat.js"/>
514
- <include name="scripts-concat.js"/>
515
- </fileset>
516
- </concat>
517
-
518
- <checksum file="${dir.intermediate}/${dir.js}/scripts-concat.min.js" algorithm="sha" property="scripts.fullsha" />
519
- <propertyregex property="scripts.sha" input="${scripts.fullsha}" regexp=".{${hash.length}}" select="\0" />
520
- <property name="scripts.js" value="${dir.js}/${scripts.sha}.js" />
521
- <copy file="${dir.intermediate}/${dir.js}/scripts-concat.min.js" tofile="${dir.publish}/${dir.js}/${scripts.sha}.js" />
522
- </target>
523
-
524
-
525
- <target name="-js.all.minify" depends="-mkdirs" description="(PRIVATE) Minifies the scripts.js files created by js.scripts.concat">
526
- <echo message="Minifying scripts"/>
527
- <copy todir="${dir.intermediate}/">
528
- <fileset dir="${dir.source}/" includes="${dir.js}/**/*.min.js" />
529
- </copy>
530
- <apply executable="java" parallel="false">
531
- <fileset dir="${dir.source}/" >
532
- <include name="${dir.js}/**/*.js"/>
533
- <exclude name="${dir.js}/**/*.min.js"/>
534
- </fileset>
535
- <arg line="-jar"/>
536
- <arg path="./${dir.build.tools}/closure-compiler-v1346.jar"/>
537
- <arg line="--js"/>
538
- <srcfile/>
539
- <arg line="--compilation_level" />
540
- <arg value="${scripts.compilation.level}" />
541
- <arg line="--warning_level" />
542
- <arg value="${scripts.compilation.warninglevel}" />
543
- <arg line="--js_output_file" />
544
- <mapper type="glob" from="*.js" to="${basedir}/${dir.intermediate}/*.js"/>
545
- <targetfile/>
546
- </apply>
547
-
548
- <!-- at this point all js files are minified with their original names -->
549
-
550
- <copy todir="${dir.publish}/">
551
- <fileset dir="${dir.intermediate}/">
552
- <include name="${dir.js}/**/*.js"/>
553
- <exclude name="${dir.js.mylibs}/**/*.js"/>
554
- <exclude name="${dir.js}/scripts-concat.js"/>
555
- <exclude name="${dir.js}/mylibs-concat.js"/>
556
- <exclude name="${dir.js}/scripts-concat.min.js"/>
557
- <exclude name="${dir.js}/plugins.js"/>
558
- <exclude name="${dir.js}/${file.root.script}"/>
559
- </fileset>
560
- </copy>
561
- <copy todir="${dir.publish}/${dir.js.mylibs}/">
562
- <fileset dir="${dir.source}/${dir.js.mylibs}/"
563
- includes="${file.js.bypass}"/>
564
- </copy>
565
- </target>
566
-
567
-
568
- <!-- HTML -->
569
- <target name="-usemin" depends="-js.scripts.concat,-css" description="(PRIVATE) Replaces references to non-minified scripts">
570
- <echo message="Switching to minified js files..."/>
571
-
572
- <!-- Changes to style.css or scripts.js mean that the html must be updated, and it will be.
573
- Unfortunately, the html we want to update may not have the tags we want to replace(because it was updated before).
574
- This outofdate check ensures that the html files have the markers for us to replace. -->
575
- <outofdate property="needhtmlrefresh">
576
- <sourcefiles>
577
- <fileset dir="${dir.publish}" includes="${style.css}, ${scripts.js}"/>
578
- </sourcefiles>
579
- <targetfiles>
580
- <fileset dir="${dir.intermediate}" includes="${page-files}"/>
581
- </targetfiles>
582
- </outofdate>
583
-
584
- <!-- force the files to be overwritten with older copies from source if needhtmlrefresh is set -->
585
- <copy todir="${dir.intermediate}" overwrite="${needhtmlrefresh}">
586
- <fileset dir="${dir.source}" includes="${page-files}"/>
587
- </copy>
588
-
589
- <!-- switch from a regular jquery to minified -->
590
- <replaceregexp match="jquery-(\d|\d(\.\d)+)\.js" replace="jquery-\1.min.js" flags="g">
591
- <fileset dir="./${dir.intermediate}" includes="${page-files}"/>
592
- </replaceregexp>
593
- <!-- switch any google CDN reference to minified -->
594
- <replaceregexp match="(\d|\d(\.\d)+)\/jquery\.js" replace="\1/jquery.min.js" flags="g">
595
- <fileset dir="./${dir.intermediate}" includes="${page-files}"/>
596
- </replaceregexp>
597
-
598
- <echo>Kill off those versioning flags: ?v=2</echo>
599
- <replaceregexp match='\?v=\d+">' replace='">' flags="g">
600
- <fileset dir="./${dir.intermediate}" includes="${page-files}"/>
601
- </replaceregexp>
602
-
603
- <echo>Remove favicon.ico reference if it is pointing to the root</echo>
604
- <replaceregexp match="&lt;link rel=[&quot;']shortcut icon[&quot;'] href=[&quot;']/favicon\.ico[&quot;']&gt;" replace="">
605
- <fileset dir="${dir.intermediate}" includes="${page-files}"/>
606
- </replaceregexp>
607
- <!-- we maintain the apple-touch-icon reference for Android 2.2 www.ravelrumba.com/blog/android-apple-touch-icon
608
- <replace token="&lt;link rel=&quot;apple-touch-icon&quot; href=&quot;/apple-touch-icon.png&quot;>" value="">
609
- <fileset dir="${dir.intermediate}" includes="${page-files}"/>
610
- </replace>
611
- -->
612
-
613
- <echo message="Update the HTML to reference our concatenated script file: ${scripts.js}"/>
614
- <!-- style.css replacement handled as a replacetoken above -->
615
- <replaceregexp match="&lt;!-- scripts concatenated [\d\w\s\W]*&lt;script.*src=['&quot;]?(.*)/${file.root.script}(?:\?.*)?['&quot;]?\s*&gt;\s*&lt;/script&gt;[\d\w\s\W]*&lt;!-- end ((scripts)|(concatenated and minified scripts))\s*--&gt;"
616
- replace="&lt;script defer src='\1/${scripts.sha}.js\'&gt;&lt;/script&gt;" flags="m">
617
- <fileset dir="${dir.intermediate}" includes="${page-files}"/>
618
- </replaceregexp>
619
- <!--[! use comments like this one to avoid having them get minified -->
620
-
621
- <echo message="Updating the HTML with the new css filename: ${style.css}"/>
622
-
623
- <replaceregexp match="&lt;link rel=['&quot;]?stylesheet['&quot;]?\s+href=['&quot;]?(.*)/${file.root.stylesheet}(?:\?.*)?['&quot;]?\s*&gt;"
624
- replace="&lt;link rel='stylesheet' href='\1/${css.sha}.css'&gt;" flags="m">
625
- <fileset dir="${dir.intermediate}" includes="${page-files}"/>
626
- </replaceregexp>
627
-
628
- </target>
629
-
630
-
631
- <target name="-manifest" depends="-usemin">
632
- <if>
633
- <isset property="file.manifest" />
634
- <then>
635
- <echo message="copying a fresh ${dir.build}/config/${file.manifest} to /${dir.intermediate}"/>
636
-
637
- <delete file="${dir.intermediate}/${file.manifest}"/>
638
- <copy file="${dir.build}/config/${file.manifest}" tofile="${dir.intermediate}/${file.manifest}" />
639
-
640
- <echo message="manifest creation" />
641
-
642
- <!-- update version -->
643
- <echo message="Updating the site.manifest version date to today, current time"/>
644
- <tstamp>
645
- <format property="TODAY" pattern="yyyy-MM-dd HH:mm:ss"/>
646
- </tstamp>
647
- <replaceregexp match="# version .+" replace="# version ${TODAY}" file="${dir.intermediate}/${file.manifest}"/>
648
-
649
- <!-- add html files -->
650
- <echo message="Updating the site.manifest with html files: ${page-files}"/>
651
- <for list="${page-files}" param="file" delimiter="," trim="true">
652
- <sequential>
653
- <replaceregexp match="# html files" replace="# html files${line.separator}@{file}" file="${dir.intermediate}/${file.manifest}" />
654
- </sequential>
655
- </for>
656
-
657
- <!-- add stylesheet files -->
658
- <echo message="Updating the site.manifest with the new css filename: ${style.css}"/>
659
- <replace token="# css files" value="# css files${line.separator}${style.css}" file="${dir.intermediate}/${file.manifest}" />
660
-
661
- <!-- add javascript files -->
662
- <echo message="Updating the site.manifest with the new js filename: ${scripts.js}"/>
663
- <for param="file">
664
- <path>
665
- <fileset dir="./${dir.intermediate}/${dir.js.mylibs}/"
666
- includes="${file.js.bypass}" />
667
- </path>
668
- <sequential>
669
- <basename property="filename.@{file}" file="@{file}" />
670
- <replaceregexp match="# js files" replace="# js files${line.separator}${dir.js.mylibs}/${filename.@{file}}" file="${dir.intermediate}/${file.manifest}" />
671
- </sequential>
672
- </for>
673
- <for param="file">
674
- <path>
675
- <fileset dir="./${dir.intermediate}/${dir.js.libs}/"
676
- includes="*.min.js"/>
677
- </path>
678
- <sequential>
679
- <basename property="filename.@{file}" file="@{file}" />
680
- <replaceregexp match="# js files" replace="# js files${line.separator}${dir.js.libs}/${filename.@{file}}" file="${dir.intermediate}/${file.manifest}" />
681
- </sequential>
682
- </for>
683
- <replace token="# js files" value="# js files${line.separator}${scripts.js}" file="${dir.intermediate}/${file.manifest}" />
684
-
685
- <echo message="copying ${file.manifest} to /${dir.publish}"/>
686
- <copy file="${dir.intermediate}/${file.manifest}" tofile="${dir.publish}/${file.manifest}" />
687
-
688
- <echo>Add manifest attribute to HTML: </echo>
689
- <replaceregexp match="&lt;html (.*?)>\s*?&lt;!--&lt;!\[endif" replace='&lt;html \1 manifest="${file.manifest}"> &lt;!--&lt;![endif' flags="g">
690
- <fileset dir="./${dir.intermediate}" includes="${page-files}"/>
691
- </replaceregexp>
692
-
693
- </then>
694
- <else>
695
- <echo message="no manifest.appcache generated!" />
696
- </else>
697
- </if>
698
- </target>
699
-
700
- <target name="-htmlclean" depends="-usemin">
701
- <echo message="Run htmlcompressor on the HTML"/>
702
- <echo message=" - maintaining whitespace"/>
703
- <echo message=" - removing html comments"/>
704
- <echo message=" - compressing inline style/script tag contents"/>
705
- <apply executable="java" parallel="false" dest="./${dir.publish}/" >
706
- <fileset dir="./${dir.intermediate}/" includes="${page-files}"/>
707
- <arg value="-jar"/>
708
- <arg path="./${dir.build.tools}/${tool.htmlcompressor}"/>
709
- <arg line="--preserve-multi-spaces"/>
710
- <arg line="--remove-quotes"/>
711
- <arg line="--compress-js"/>
712
- <arg line="--compress-css"/>
713
- <arg line="--preserve-php"/>
714
- <arg line="--preserve-ssi"/>
715
- <srcfile/>
716
- <arg value="-o"/>
717
- <mapper type="glob" from="*" to="../${dir.publish}/*"/>
718
- <targetfile/>
719
- </apply>
720
- </target>
721
-
722
-
723
- <target name="-htmlbuildkit" depends="-usemin">
724
- <echo message="Run htmlcompressor on the HTML"/>
725
- <echo message=" - maintaining whitespace"/>
726
- <echo message=" - retain html comments"/>
727
- <echo message=" - compressing inline style/script tag contents"/>
728
- <apply executable="java" parallel="false" dest="./${dir.publish}/" >
729
- <fileset dir="./${dir.intermediate}/" includes="${page-files}"/>
730
- <arg value="-jar"/>
731
- <arg path="./${dir.build.tools}/${tool.htmlcompressor}"/>
732
- <arg value="--preserve-comments"/>
733
- <arg line="--preserve-multi-spaces"/>
734
- <arg line="--compress-js"/>
735
- <arg line="--compress-css"/>
736
- <arg line="--preserve-php"/>
737
- <arg line="--preserve-ssi"/>
738
- <srcfile/>
739
- <arg value="-o"/>
740
- <mapper type="glob" from="*" to="../${dir.publish}/*"/>
741
- <targetfile/>
742
- </apply>
743
- </target>
744
-
745
-
746
- <target name="-htmlcompress" depends="-usemin">
747
- <echo message="Run htmlcompressor on the HTML"/>
748
- <echo message=" - removing unnecessary whitespace"/>
749
- <echo message=" - removing html comments"/>
750
- <echo message=" - compressing inline style/script tag contents"/>
751
- <apply executable="java" parallel="false" dest="./${dir.publish}/" >
752
- <fileset dir="./${dir.intermediate}/" includes="${page-files}"/>
753
- <arg value="-jar"/>
754
- <arg path="./${dir.build.tools}/${tool.htmlcompressor}"/>
755
- <arg line="--remove-quotes"/>
756
- <arg line="--compress-js"/>
757
- <arg line="--compress-css"/>
758
- <arg line="--preserve-php"/>
759
- <arg line="--preserve-ssi"/>
760
- <srcfile/>
761
- <arg value="-o"/>
762
- <mapper type="glob" from="*" to="../${dir.publish}/*"/>
763
- <targetfile/>
764
- </apply>
765
- </target>
766
-
767
-
768
- <!-- CSS -->
769
-
770
- <target name="-css-remove-concatenated-stylesheets">
771
- <echo>Removing ${css_file} from html</echo>
772
- <replaceregexp match="&lt;link.+href=&quot;.*${css_file}&quot;.*&gt;" replace=" ">
773
- <fileset dir="${dir.intermediate}" includes="${page-files}"/>
774
- </replaceregexp>
775
- </target>
776
-
777
-
778
- <target name="css-split" description="turns style.css into multiple files @imported together">
779
- <copy file="${dir.source}/${dir.css}/${file.root.stylesheet}" tofile="${dir.source}/${dir.css}/${file.root.stylesheet}.temp"/>
780
-
781
- <replaceregexp file="${dir.source}/${dir.css}/${file.root.stylesheet}.temp"
782
- match=".*"
783
- replace="/* remove me */" flags="s" />
784
-
785
- <loadfile property="root" srcfile="${dir.source}/${dir.css}/${file.root.stylesheet}"/>
786
- <var name="curr.buffer" value=""/>
787
-
788
- <for delimiter="${line.separator}" param="currline" list="${root}">
789
- <sequential>
790
- <!-- does this line contain an h5bp-import? -->
791
- <propertyregex property="export.name" input="@{currline}" regexp="^.*==\|== +(.*) +==+$" select="\1" casesensitive="true" override="true" />
792
- <if>
793
- <isset property="export.name"/>
794
- <then>
795
- <propertyregex property="export.name" input="${export.name}" regexp=" " replace="." global="true" override="true" />
796
- <var name="export.name" value="${export.name}.css"/>
797
-
798
- <if>
799
- <isset property="curr.file"/>
800
- <then>
801
- <!-- create curr.file -->
802
- <copy file="${dir.source}/${dir.css}/${file.root.stylesheet}" tofile="${dir.source}/${dir.css}/${curr.file}" overwrite="true"/>
803
- <!-- write the curr.buffer into the curr.file -->
804
- <replaceregexp file="${dir.source}/${dir.css}/${curr.file}"
805
- match=".*"
806
- replace="${curr.buffer}" flags="s" />
807
-
808
- <var name="curr.buffer" value=""/>
809
- <var name="curr.file" unset="true"/>
810
- </then>
811
- </if>
812
- <var name="curr.file" value="${export.name}"/>
813
- <var name="export.name" unset="true"/>
814
-
815
- <!-- insert import line into new root -->
816
- <replace file="${dir.source}/${dir.css}/${file.root.stylesheet}.temp" token="/* remove me */" value="@import url(${curr.file});${line.separator}/* remove me */"/>
817
- </then>
818
- </if>
819
- <var name="curr.buffer" value="${curr.buffer}@{currline}${line.separator}" />
820
- </sequential>
821
- </for>
822
- <!-- one more time to write out the last file -->
823
- <if>
824
- <isset property="curr.file"/>
825
- <then>
826
- <!-- create curr.file -->
827
- <copy file="${dir.source}/${dir.css}/${file.root.stylesheet}" tofile="${dir.source}/${dir.css}/${curr.file}" overwrite="true"/>
828
- <!-- write the curr.buffer into the curr.file -->
829
- <replaceregexp file="${dir.source}/${dir.css}/${curr.file}"
830
- match=".*"
831
- replace="${curr.buffer}" flags="s" />
832
-
833
- <var name="curr.buffer" value=""/>
834
- <var name="curr.file" unset="true"/>
835
- </then>
836
- </if>
837
- <replace file="${dir.source}/${dir.css}/${file.root.stylesheet}.temp" token="/* remove me */" value="${curr.buffer}"/>
838
- <copy file="${dir.source}/${dir.css}/${file.root.stylesheet}" tofile="${dir.source}/${dir.css}/${file.root.stylesheet}.orig" overwrite="false"/>
839
- <move file="${dir.source}/${dir.css}/${file.root.stylesheet}.temp" tofile="${dir.source}/${dir.css}/${file.root.stylesheet}" overwrite="false"/>
840
- </target>
841
-
842
- <target name="-css" depends="-mkdirs" description="Concatenates and Minifies any stylesheets @imported via the file.stylesheets">
843
- <echo message="Concatenating any @imports..."/>
844
-
845
- <!-- copy source file to intermediate directory -->
846
- <copy file="${dir.source}/${dir.css}/${file.root.stylesheet}" tofile="${dir.intermediate}/${dir.css}/${file.root.stylesheet}"/>
847
-
848
- <!-- replace imports with h5bp-import tags (part 1) this one wraps @media types -->
849
- <replaceregexp file="${dir.intermediate}/${dir.css}/${file.root.stylesheet}"
850
- match="^@import\s+(?:url\s*\(\s*['&quot;]?|['&quot;])((?!http:|https:|ftp:|\/\/)[^&quot;^'^\s]+)(?:['&quot;]?\s*\)|['&quot;])\s*([\w\s,\-]*);.*$"
851
- replace="@media \2{ /* h5bp-import: \1 */ }" byline="true" />
852
-
853
- <!-- replace imports with h5bp-import tags (part 2) -->
854
- <replaceregexp file="${dir.intermediate}/${dir.css}/${file.root.stylesheet}"
855
- match="^@media \{ (/\* .* \*/) \}" replace="\1" byline="true" />
856
-
857
- <!-- copy skeleton to concat file -->
858
- <copy file="${dir.intermediate}/${dir.css}/${file.root.stylesheet}"
859
- tofile="${dir.intermediate}/${dir.css}/style-concat.css" overwrite="true"/>
860
-
861
- <!-- load the file into a property -->
862
- <loadfile property="imports" srcfile="${dir.intermediate}/${dir.css}/${file.root.stylesheet}"/>
863
-
864
- <var name="concat-files" value="${file.root.stylesheet}"/>
865
-
866
- <!-- go over the file line by line -->
867
- <for delimiter="${line.separator}" param="import" list="${imports}">
868
- <sequential>
869
- <!-- does this line contain an h5bp-import? -->
870
- <propertyregex property="file.name" input="@{import}" regexp="/\* h5bp-import: (.*) \*/" select="\1" casesensitive="true" override="true" />
871
-
872
- <if>
873
- <isset property="file.name"/>
874
- <then>
875
- <var name="concat-files" value="${file.name},${concat-files}"/>
876
-
877
- <!-- load the file into a variable -->
878
- <loadfile property="file.contents" srcFile="${dir.source}/${dir.css}/${file.name}"/>
879
-
880
- <!-- pop that file into the concatenated output file -->
881
- <replace file="${dir.intermediate}/${dir.css}/style-concat.css" token="/* h5bp-import: ${file.name} */" value="${file.contents}"/>
882
-
883
- <var name="file.contents" unset="true"/>
884
- </then>
885
- </if>
886
- </sequential>
887
- </for>
888
- <echo message="Minifying css..."/>
889
-
890
- <apply executable="java" parallel="false">
891
- <fileset dir="${dir.intermediate}/${dir.css}/" includes="style-concat.css"/>
892
- <arg line="-jar"/>
893
- <arg path="${dir.build.tools}/${tool.yuicompressor}"/>
894
- <srcfile/>
895
- <arg line="-o"/>
896
- <mapper type="merge" to="${basedir}/${dir.intermediate}/${dir.css}/style-concat.min.css"/>
897
- <targetfile/>
898
- </apply>
899
-
900
- <checksum file="${dir.intermediate}/${dir.css}/style-concat.min.css" algorithm="sha" property="css.fullsha" />
901
- <propertyregex property="css.sha" input="${css.fullsha}" regexp=".{${hash.length}}" select="\0" />
902
- <property name="style.css" value="${dir.css}/${css.sha}.css" />
903
- <copy file="${dir.intermediate}/${dir.css}/style-concat.min.css" tofile="${dir.publish}/${dir.css}/${css.sha}.css" />
904
-
905
- <echo message="Minifying any unconcatenated css files..."/>
906
-
907
- <apply executable="java" parallel="false">
908
- <fileset dir="${dir.source}/${dir.css}/" excludes="${concat-files}" includes="**/*.css"/>
909
- <arg line="-jar"/>
910
- <arg path="${dir.build.tools}/${tool.yuicompressor}"/>
911
- <srcfile/>
912
- <arg line="-o"/>
913
- <mapper type="glob" from="*.css" to="${basedir}/${dir.publish}/${dir.css}/*.css"/>
914
- <targetfile/>
915
- </apply>
916
- <foreach list="${file.stylesheets}" param="css_file" target="-css-remove-concatenated-stylesheets" />
917
- </target>
918
-
919
-
920
- <!-- IMAGES -->
921
- <target name="-imagespng" depends="-mkdirs" description="(PRIVATE) Optimizes .png images using optipng">
922
- <echo message="Optimizing images..."/>
923
- <echo message="This part might take a while. But everything else is already done."/>
924
- <echo message=" "/>
925
-
926
-
927
- <echo message="First, we run optipng on the .png files..."/>
928
-
929
- <!-- osfamily=unix is actually true on OS X as well -->
930
- <!-- On *nix's and OS X, check for optipng and give a helpful message if it's not installed -->
931
- <if>
932
- <and>
933
- <os family="unix" />
934
- <available file="optipng" filepath="${ENV.PATH}" />
935
- </and>
936
- <then>
937
- <!-- work around https://sourceforge.net/tracker/?func=detail&aid=2671422&group_id=151404&atid=780916 -->
938
- <delete>
939
- <fileset dir="./${dir.publish}/${dir.images}/">
940
- <include name="**/*.png"/>
941
- </fileset>
942
- </delete>
943
- <apply executable="optipng" dest="./${dir.publish}/${dir.images}/" osfamily="unix">
944
- <fileset dir="./${dir.source}/${dir.images}/" includes="**/*.png" excludes="${images.bypass}, ${images.default.bypass}"/>
945
- <arg value="-quiet"/>
946
- <arg value="-o7"/>
947
- <arg value="-out"/>
948
- <targetfile/>
949
- <srcfile/>
950
- <mapper type="identity"/>
951
- </apply>
952
- </then>
953
- <elseif>
954
- <os family="unix" />
955
- <then>
956
- <echo message="*** optipng NOT INSTALLED. SKIPPING OPTIMIZATION OF PNGs." />
957
- <echo message="*** Install optipng to enable png optimization." />
958
- <echo message="*** For instructions see 'Dependencies' at: http://html5boilerplate.com/docs/#Build-script#dependencies" />
959
- </then>
960
- </elseif>
961
- </if>
962
-
963
- <!-- work around https://sourceforge.net/tracker/?func=detail&aid=2671422&group_id=151404&atid=780916 -->
964
- <delete>
965
- <fileset dir="./${dir.publish}/${dir.images}/">
966
- <include name="**/*.png"/>
967
- </fileset>
968
- </delete>
969
- <apply executable="${basedir}/${dir.build.tools}/optipng-0.6.4-exe/optipng.exe" dest="./${dir.publish}/${dir.images}/" osfamily="windows">
970
- <fileset dir="./${dir.source}/${dir.images}/" includes="**/*.png" excludes="${images.bypass}, ${images.default.bypass}"/>
971
- <arg value="-quiet"/>
972
- <arg value="-o7"/>
973
- <arg value="-out"/>
974
- <targetfile/>
975
- <srcfile/>
976
- <mapper type="identity"/>
977
- </apply>
978
- </target>
979
-
980
-
981
- <target name="-imagesjpg" depends="-mkdirs" description="(PRIVATE) Optimizes .jpg images using jpegtan">
982
- <echo message="Now, we clean up those jpgs..."/>
983
-
984
- <if>
985
- <equals arg1="${images.strip.metadata}" arg2="true"/>
986
- <then>
987
- <var name="strip-meta-tags" value="none"/>
988
- </then>
989
- <else>
990
- <var name="strip-meta-tags" value="all"/>
991
- </else>
992
- </if>
993
-
994
- <!-- On *nix's and OS X, check for jpegtran and give a helpful message if it's not installed -->
995
- <if>
996
- <and>
997
- <os family="unix" />
998
- <available file="jpegtran" filepath="${ENV.PATH}" />
999
- </and>
1000
- <then>
1001
- <apply executable="jpegtran" dest="./${dir.publish}/${dir.images}" osfamily="unix">
1002
- <fileset dir="${dir.source}/${dir.images}" includes="**/*.jpg" excludes="${images.bypass}, ${images.default.bypass}"/>
1003
- <arg value="-copy"/>
1004
- <arg value="${strip-meta-tags}"/>
1005
- <arg value="-optimize"/>
1006
- <arg value="-outfile"/>
1007
- <targetfile/>
1008
- <srcfile/>
1009
- <mapper type="identity"/>
1010
- <!-- you may want to flag optimized images. If so, do it here. Otherwise change this to type="identity" -->
1011
- <!--<mapper type="glob" from="*.jpg" to="*.jpg"/>-->
1012
- </apply>
1013
- </then>
1014
- <elseif>
1015
- <os family="unix" />
1016
- <then>
1017
- <echo message="*** jpegtran NOT INSTALLED. SKIPPING OPTIMIZATION OF JPEGs." />
1018
- <echo message="*** Install jpegtran to enable jpeg optimization." />
1019
- <echo message="*** For instructions see 'Dependencies' at: http://html5boilerplate.com/docs/#Build-script#dependencies" />
1020
- </then>
1021
- </elseif>
1022
- </if>
1023
-
1024
- <apply executable="${basedir}/${dir.build.tools}/jpegtran.exe" dest="./${dir.publish}/${dir.images}" osfamily="windows">
1025
- <fileset dir="${dir.source}/${dir.images}" includes="**/*.jpg" excludes="${images.bypass}, ${images.default.bypass}"/>
1026
- <arg value="-copy"/>
1027
- <arg value="${strip-meta-tags}"/>
1028
- <arg value="-optimize"/>
1029
- <arg value="-outfile"/>
1030
- <targetfile/>
1031
- <srcfile/>
1032
- <mapper type="identity"/>
1033
- <!-- you may want to flag optimized images. If so, do it here. Otherwise change this to type="identity" -->
1034
- <!--<mapper type="glob" from="*.jpg" to="*.jpg"/>-->
1035
- </apply>
1036
- </target>
1037
-
1038
-
1039
- <target name="-imgcopy" depends="-mkdirs">
1040
- <echo message="Copying over the unmodified images."/>
1041
-
1042
- <copy todir="./${dir.publish}/${dir.images}">
1043
- <fileset dir="${dir.source}/${dir.images}" includes="**/*.jpg, **/*.png"/>
1044
- </copy>
1045
- </target>
1046
-
1047
- <!-- Import project.xml (put any custom build targets in this file so that they aren't overwritten when build.xml is updated) -->
1048
- <!-- See: https://github.com/paulirish/html5-boilerplate/issues/704 -->
1049
- <import file="./project.xml" />
1050
-
1051
- </project>