html5-starter 0.1.3b
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +3 -0
- data/README.md +135 -0
- data/VERSION +1 -0
- data/lib/app/helpers/html5_boilerplate_helper.rb +47 -0
- data/lib/html5-boilerplate.rb +6 -0
- data/stylesheets/_html5-boilerplate.scss +15 -0
- data/stylesheets/html5-boilerplate/_fonts.scss +36 -0
- data/stylesheets/html5-boilerplate/_handheld.scss +8 -0
- data/stylesheets/html5-boilerplate/_helpers.scss +25 -0
- data/stylesheets/html5-boilerplate/_print.scss +20 -0
- data/stylesheets/html5-boilerplate/_reset.scss +50 -0
- data/stylesheets/html5-boilerplate/_styles.scss +100 -0
- data/templates/project/_flashes.html.haml +4 -0
- data/templates/project/_footer.html.haml +2 -0
- data/templates/project/_head.html.haml +32 -0
- data/templates/project/_header.html.haml +1 -0
- data/templates/project/_javascripts.html.haml +38 -0
- data/templates/project/_stylesheets.html.haml +8 -0
- data/templates/project/application.html.haml +15 -0
- data/templates/project/files/404.html +22 -0
- data/templates/project/files/apple-touch-icon.png +0 -0
- data/templates/project/files/build/build.xml +636 -0
- data/templates/project/files/build/buildinfo.properties +5 -0
- data/templates/project/files/build/config/build.properties +3 -0
- data/templates/project/files/build/config/default.properties +79 -0
- data/templates/project/files/build/config/project.properties +49 -0
- data/templates/project/files/build/createproject.sh +73 -0
- data/templates/project/files/build/tools/ant-contrib-1.0b3.jar +0 -0
- data/templates/project/files/build/tools/css-compressor/CSSCompression.php +465 -0
- data/templates/project/files/build/tools/css-compressor/changelog.txt +22 -0
- data/templates/project/files/build/tools/css-compressor/cli.php +101 -0
- data/templates/project/files/build/tools/css-compressor/helpers/hex2short-colors.json +39 -0
- data/templates/project/files/build/tools/css-compressor/helpers/hex2short-safe.json +16 -0
- data/templates/project/files/build/tools/css-compressor/helpers/long2hex-colors.json +127 -0
- data/templates/project/files/build/tools/css-compressor/lib/Cleanup.php +218 -0
- data/templates/project/files/build/tools/css-compressor/lib/Color.php +199 -0
- data/templates/project/files/build/tools/css-compressor/lib/Combine.php +191 -0
- data/templates/project/files/build/tools/css-compressor/lib/Combine/Aural.php +109 -0
- data/templates/project/files/build/tools/css-compressor/lib/Combine/Background.php +107 -0
- data/templates/project/files/build/tools/css-compressor/lib/Combine/Border.php +98 -0
- data/templates/project/files/build/tools/css-compressor/lib/Combine/BorderOutline.php +109 -0
- data/templates/project/files/build/tools/css-compressor/lib/Combine/BorderRadius.php +262 -0
- data/templates/project/files/build/tools/css-compressor/lib/Combine/Font.php +125 -0
- data/templates/project/files/build/tools/css-compressor/lib/Combine/List.php +104 -0
- data/templates/project/files/build/tools/css-compressor/lib/Combine/MarginPadding.php +190 -0
- data/templates/project/files/build/tools/css-compressor/lib/Compress.php +212 -0
- data/templates/project/files/build/tools/css-compressor/lib/Control.php +236 -0
- data/templates/project/files/build/tools/css-compressor/lib/Exception.php +32 -0
- data/templates/project/files/build/tools/css-compressor/lib/Format.php +187 -0
- data/templates/project/files/build/tools/css-compressor/lib/Individuals.php +307 -0
- data/templates/project/files/build/tools/css-compressor/lib/Numeric.php +103 -0
- data/templates/project/files/build/tools/css-compressor/lib/Option.php +133 -0
- data/templates/project/files/build/tools/css-compressor/lib/Organize.php +149 -0
- data/templates/project/files/build/tools/css-compressor/lib/Selectors.php +245 -0
- data/templates/project/files/build/tools/css-compressor/lib/Setup.php +292 -0
- data/templates/project/files/build/tools/css-compressor/lib/Trim.php +213 -0
- data/templates/project/files/build/tools/css-compressor/license.txt +21 -0
- data/templates/project/files/build/tools/htmlcompressor-0.9.8.jar +0 -0
- data/templates/project/files/build/tools/jpegtran.exe +0 -0
- data/templates/project/files/build/tools/optipng-0.6.4-exe/LICENSE.txt +21 -0
- data/templates/project/files/build/tools/optipng-0.6.4-exe/optipng.exe +0 -0
- data/templates/project/files/build/tools/yuicompressor-2.4.2.jar +0 -0
- data/templates/project/files/crossdomain.xml +25 -0
- data/templates/project/files/favicon.ico +0 -0
- data/templates/project/files/gitignore.txt +32 -0
- data/templates/project/files/gitignore_placeholder.txt +2 -0
- data/templates/project/files/google.yml +22 -0
- data/templates/project/files/htaccess +415 -0
- data/templates/project/files/humans.txt +43 -0
- data/templates/project/files/lighttpd.conf +149 -0
- data/templates/project/files/mime.types +80 -0
- data/templates/project/files/nginx.conf +108 -0
- data/templates/project/files/robots.txt +5 -0
- data/templates/project/files/web.config +207 -0
- data/templates/project/handheld.scss +8 -0
- data/templates/project/index.html +81 -0
- data/templates/project/javascripts/libs/dd_belatedpng.js +13 -0
- data/templates/project/javascripts/libs/jquery-1.4.4.js +7179 -0
- data/templates/project/javascripts/libs/jquery-1.4.4.min.js +167 -0
- data/templates/project/javascripts/libs/modernizr-1.6.min.js +30 -0
- data/templates/project/javascripts/plugins.js +13 -0
- data/templates/project/javascripts/rails.js +156 -0
- data/templates/project/javascripts/script.js +26 -0
- data/templates/project/manifest.rb +101 -0
- data/templates/project/partials/_base.scss +23 -0
- data/templates/project/style.scss +70 -0
- metadata +171 -0
@@ -0,0 +1,32 @@
|
|
1
|
+
%head
|
2
|
+
%meta{ :charset => "utf-8" }/
|
3
|
+
|
4
|
+
-#
|
5
|
+
Always force latest IE rendering engine (even in intranet) & Chrome Frame
|
6
|
+
Remove this if you use the .htaccess
|
7
|
+
%meta{ :content => "IE=edge,chrome=1", "http-equiv" => "X-UA-Compatible" }/
|
8
|
+
|
9
|
+
-# encoding must be specified within the first 512 bytes www.whatwg.org/specs/web-apps/current-work/multipage/semantics.html#charset
|
10
|
+
|
11
|
+
-# meta element for compatibility mode needs to be before all elements except title & meta msdn.microsoft.com/en-us/library/cc288325(VS.85).aspx
|
12
|
+
-# Chrome Frame is only invoked if meta element for compatibility mode is within the first 1K bytes code.google.com/p/chromium/issues/detail?id=23003
|
13
|
+
|
14
|
+
%title
|
15
|
+
== #{ controller.controller_name.titleize } - #{ controller.action_name.titleize }
|
16
|
+
|
17
|
+
%meta{ :content => "", :name => "description" }/
|
18
|
+
%meta{ :content => "", :name => "author" }/
|
19
|
+
|
20
|
+
-# Mobile viewport optimized: j.mp/bplateviewport
|
21
|
+
%meta{ :content => "width=device-width, initial-scale=1.0", :name => "viewport" }/
|
22
|
+
|
23
|
+
-# Place favicon.ico and apple-touch-icon.png in the root of your domain and delete these references
|
24
|
+
-# %link{ :href => "/favicon.ico", :rel => "shortcut icon" }/
|
25
|
+
-# %link{ :href => "/apple-touch-icon.png", :rel => "apple-touch-icon" }/
|
26
|
+
|
27
|
+
= render :partial => 'layouts/stylesheets'
|
28
|
+
|
29
|
+
-# All JavaScript at the bottom, except for Modernizr which enables HTML5 elements & feature detects
|
30
|
+
= javascript_include_tag 'modernizr-1.6.min'
|
31
|
+
|
32
|
+
= csrf_meta_tag
|
@@ -0,0 +1 @@
|
|
1
|
+
%h1 Header
|
@@ -0,0 +1,38 @@
|
|
1
|
+
-# Grab Google CDN's jQuery
|
2
|
+
-# Looks for google_api_key first in ENV['GOOGLE_API_KEY'] then in config/google.yml
|
3
|
+
- if !google_api_key.blank?
|
4
|
+
= javascript_include_tag "//www.google.com/jsapi?key=#{google_api_key}"
|
5
|
+
:javascript
|
6
|
+
google.load("jquery", "1.4.4");
|
7
|
+
- else
|
8
|
+
= javascript_include_tag "//ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"
|
9
|
+
|
10
|
+
-# fall back to local jQuery if necessary
|
11
|
+
:javascript
|
12
|
+
!window.jQuery && document.write(unescape('%3Cscript src="/javascripts/jquery-1.4.4.min.js"%3E%3C/script%3E'))
|
13
|
+
|
14
|
+
= javascript_include_tag 'rails', 'plugins', 'application'
|
15
|
+
|
16
|
+
/[if lt IE 7 ]
|
17
|
+
:javascript
|
18
|
+
$.getScript("/javascripts/dd_belatedpng.js",function(){ DD_belatedPNG.fix('img, .png_bg'); });
|
19
|
+
|
20
|
+
-# Append your own using content_for :javascripts
|
21
|
+
= yield :javascripts
|
22
|
+
|
23
|
+
-# yui profiler and profileviewer
|
24
|
+
- if Rails.env == 'development'
|
25
|
+
= javascript_include_tag 'profiling/yahoo-profiling.min', 'profiling/config'
|
26
|
+
|
27
|
+
-# asynchronous google analytics: mathiasbynens.be/notes/async-analytics-snippet
|
28
|
+
-# Looks for google_account_id first in ENV['GOOGLE_ACCOUNT_ID'] then in config/google.yml
|
29
|
+
- if !google_account_id.blank?
|
30
|
+
:javascript
|
31
|
+
var _gaq = [['_setAccount', '#{google_account_id}'], ['_trackPageview']];
|
32
|
+
(function(d, t) {
|
33
|
+
var g = d.createElement(t),
|
34
|
+
s = d.getElementsByTagName(t)[0];
|
35
|
+
g.async = true;
|
36
|
+
g.src = ('https:' == location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
|
37
|
+
s.parentNode.insertBefore(g, s);
|
38
|
+
})(document, 'script');
|
@@ -0,0 +1,8 @@
|
|
1
|
+
-# CSS : implied media="all"
|
2
|
+
= stylesheet_link_tag 'style', :media => 'all'
|
3
|
+
|
4
|
+
-# Uncomment if you are specifically targeting less enabled mobile browsers
|
5
|
+
-#= stylesheet_link_tag 'handheld', :media => 'handheld'
|
6
|
+
|
7
|
+
-# Append your own using content_for :stylesheets
|
8
|
+
= yield :stylesheets
|
@@ -0,0 +1,15 @@
|
|
1
|
+
!!! 5
|
2
|
+
-# http://paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither
|
3
|
+
-ie_html :lang => 'en', :class => 'no-js' do
|
4
|
+
= render :partial => 'layouts/head'
|
5
|
+
%body{ :class => "#{controller.controller_name}" }
|
6
|
+
#container
|
7
|
+
%header#header
|
8
|
+
= render :partial => 'layouts/header'
|
9
|
+
#main
|
10
|
+
= render :partial => 'layouts/flashes'
|
11
|
+
= yield
|
12
|
+
%footer#footer
|
13
|
+
= render :partial => 'layouts/footer'
|
14
|
+
-# Javascript at the bottom for fast page loading
|
15
|
+
= render :partial => 'layouts/javascripts'
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<!doctype html>
|
2
|
+
<title>not found</title>
|
3
|
+
|
4
|
+
<style>
|
5
|
+
body { text-align: center;}
|
6
|
+
h1 { font-size: 50px; }
|
7
|
+
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); }
|
8
|
+
::-moz-selection{ background:#FF5E99; color:#fff; }
|
9
|
+
::selection { background:#FF5E99; color:#fff; }
|
10
|
+
details { display:block; }
|
11
|
+
a { color: rgb(36, 109, 56); text-decoration:none; }
|
12
|
+
a:hover { color: rgb(96, 73, 141) ; text-shadow: 2px 2px 2px rgba(36, 109, 56, 0.5); }
|
13
|
+
span[frown] { transform: rotate(90deg); display:inline-block; color: #bbb; }
|
14
|
+
</style>
|
15
|
+
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
<details>
|
20
|
+
<summary><h1>Not found</h1></summary>
|
21
|
+
<p><span frown>:(</span></p>
|
22
|
+
</details>
|
Binary file
|
@@ -0,0 +1,636 @@
|
|
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
|
+
|
14
|
+
<!-- load property files -->
|
15
|
+
<property file="build/config/project.properties"/>
|
16
|
+
<property file="build/config/default.properties"/>
|
17
|
+
|
18
|
+
<!-- merge the stylesheet properties -->
|
19
|
+
<var name="stylesheet-files" value="${file.stylesheets}, ${file.default.stylesheets}"/>
|
20
|
+
|
21
|
+
<!-- merge the pages properties -->
|
22
|
+
<var name="page-files" value="${file.pages}, ${file.pages.default.include}"/>
|
23
|
+
|
24
|
+
|
25
|
+
|
26
|
+
<!--
|
27
|
+
*************************************************
|
28
|
+
* BASE TARGETS *
|
29
|
+
*************************************************
|
30
|
+
-->
|
31
|
+
<target name="basics">
|
32
|
+
<if>
|
33
|
+
<equals arg1="${env}" arg2="dev"/>
|
34
|
+
<then>
|
35
|
+
<!-- Build a dev environment -->
|
36
|
+
<echo message="Building a Development Environment..."/>
|
37
|
+
<antcall target="-rev"/>
|
38
|
+
<antcall target="-clean"/>
|
39
|
+
<antcall target="-copy"/>
|
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="-rev"/>
|
48
|
+
<antcall target="-clean"/>
|
49
|
+
<antcall target="-copy"/>
|
50
|
+
<antcall target="-usemin"/>
|
51
|
+
<antcall target="-js.all.minify"/>
|
52
|
+
<antcall target="-js.main.concat"/>
|
53
|
+
<antcall target="-js.mylibs.concat"/>
|
54
|
+
<antcall target="-js.scripts.concat"/>
|
55
|
+
<antcall target="-js.delete"/>
|
56
|
+
<antcall target="-css"/>
|
57
|
+
<antcall target="-html"/>
|
58
|
+
</then>
|
59
|
+
</elseif>
|
60
|
+
|
61
|
+
<else>
|
62
|
+
<!-- Build a production environment -->
|
63
|
+
<echo message="Building a Production Environment..."/>
|
64
|
+
<antcall target="-rev"/>
|
65
|
+
<antcall target="-clean"/>
|
66
|
+
<antcall target="-copy"/>
|
67
|
+
<antcall target="-usemin"/>
|
68
|
+
<antcall target="-js.all.minify"/>
|
69
|
+
<antcall target="-js.main.concat"/>
|
70
|
+
<antcall target="-js.mylibs.concat"/>
|
71
|
+
<antcall target="-js.scripts.concat"/>
|
72
|
+
<antcall target="-js.delete"/>
|
73
|
+
<antcall target="-strip-console.log"/>
|
74
|
+
<antcall target="-css"/>
|
75
|
+
<antcall target="-html"/>
|
76
|
+
</else>
|
77
|
+
</if>
|
78
|
+
</target>
|
79
|
+
|
80
|
+
|
81
|
+
<target name="text">
|
82
|
+
<if>
|
83
|
+
<equals arg1="${env}" arg2="dev"/>
|
84
|
+
<then>
|
85
|
+
<!-- Build a dev environment -->
|
86
|
+
<echo message="Building a Development Environment..."/>
|
87
|
+
<antcall target="-rev"/>
|
88
|
+
<antcall target="-clean"/>
|
89
|
+
<antcall target="-copy"/>
|
90
|
+
</then>
|
91
|
+
|
92
|
+
<elseif>
|
93
|
+
<equals arg1="${env}" arg2="test"/>
|
94
|
+
<then>
|
95
|
+
<!-- Build a test environment -->
|
96
|
+
<echo message="Building a Test Environment..."/>
|
97
|
+
<antcall target="-rev"/>
|
98
|
+
<antcall target="-clean"/>
|
99
|
+
<antcall target="-copy"/>
|
100
|
+
<antcall target="-usemin"/>
|
101
|
+
<antcall target="-js.all.minify"/>
|
102
|
+
<antcall target="-js.main.concat"/>
|
103
|
+
<antcall target="-js.mylibs.concat"/>
|
104
|
+
<antcall target="-js.scripts.concat"/>
|
105
|
+
<antcall target="-js.delete"/>
|
106
|
+
<antcall target="-css"/>
|
107
|
+
<antcall target="-html"/>
|
108
|
+
<antcall target="-htmlclean"/>
|
109
|
+
</then>
|
110
|
+
</elseif>
|
111
|
+
|
112
|
+
<else>
|
113
|
+
<!-- Build a production environment -->
|
114
|
+
<echo message="Building a Production Environment..."/>
|
115
|
+
<antcall target="-rev"/>
|
116
|
+
<antcall target="-clean"/>
|
117
|
+
<antcall target="-copy"/>
|
118
|
+
<antcall target="-usemin"/>
|
119
|
+
<antcall target="-js.all.minify"/>
|
120
|
+
<antcall target="-js.main.concat"/>
|
121
|
+
<antcall target="-js.mylibs.concat"/>
|
122
|
+
<antcall target="-js.scripts.concat"/>
|
123
|
+
<antcall target="-js.delete"/>
|
124
|
+
<antcall target="-strip-console.log"/>
|
125
|
+
<antcall target="-css"/>
|
126
|
+
<antcall target="-html"/>
|
127
|
+
<antcall target="-htmlclean"/>
|
128
|
+
</else>
|
129
|
+
</if>
|
130
|
+
</target>
|
131
|
+
|
132
|
+
|
133
|
+
<target name="buildkit">
|
134
|
+
<if>
|
135
|
+
<equals arg1="${env}" arg2="dev"/>
|
136
|
+
<then>
|
137
|
+
<!-- Build a dev environment -->
|
138
|
+
<echo message="Building a Development Environment..."/>
|
139
|
+
<antcall target="-rev"/>
|
140
|
+
<antcall target="-clean"/>
|
141
|
+
<antcall target="-copy"/>
|
142
|
+
<antcall target="-imagespng"/>
|
143
|
+
<antcall target="-imagesjpg"/>
|
144
|
+
</then>
|
145
|
+
|
146
|
+
<elseif>
|
147
|
+
<equals arg1="${env}" arg2="test"/>
|
148
|
+
<then>
|
149
|
+
<!-- Build a test environment -->
|
150
|
+
<echo message="Building a Test Environment..."/>
|
151
|
+
<antcall target="-rev"/>
|
152
|
+
<antcall target="-clean"/>
|
153
|
+
<antcall target="-copy"/>
|
154
|
+
<antcall target="-usemin"/>
|
155
|
+
<antcall target="-js.all.minify"/>
|
156
|
+
<antcall target="-js.main.concat"/>
|
157
|
+
<antcall target="-js.mylibs.concat"/>
|
158
|
+
<antcall target="-js.scripts.concat"/>
|
159
|
+
<antcall target="-js.delete"/>
|
160
|
+
<antcall target="-css"/>
|
161
|
+
<antcall target="-html"/>
|
162
|
+
<antcall target="-htmlbuildkit"/>
|
163
|
+
<antcall target="-imagespng"/>
|
164
|
+
<antcall target="-imagesjpg"/>
|
165
|
+
</then>
|
166
|
+
</elseif>
|
167
|
+
|
168
|
+
<else>
|
169
|
+
<!-- Build a production environment -->
|
170
|
+
<echo message="Building a Production Environment..."/>
|
171
|
+
<antcall target="-rev"/>
|
172
|
+
<antcall target="-clean"/>
|
173
|
+
<antcall target="-copy"/>
|
174
|
+
<antcall target="-usemin"/>
|
175
|
+
<antcall target="-js.all.minify"/>
|
176
|
+
<antcall target="-js.main.concat"/>
|
177
|
+
<antcall target="-js.mylibs.concat"/>
|
178
|
+
<antcall target="-js.scripts.concat"/>
|
179
|
+
<antcall target="-js.delete"/>
|
180
|
+
<antcall target="-strip-console.log"/>
|
181
|
+
<antcall target="-css"/>
|
182
|
+
<antcall target="-html"/>
|
183
|
+
<antcall target="-htmlbuildkit"/>
|
184
|
+
<antcall target="-imagespng"/>
|
185
|
+
<antcall target="-imagesjpg"/>
|
186
|
+
</else>
|
187
|
+
</if>
|
188
|
+
</target>
|
189
|
+
|
190
|
+
|
191
|
+
<target name="build">
|
192
|
+
<if>
|
193
|
+
<equals arg1="${env}" arg2="dev"/>
|
194
|
+
<then>
|
195
|
+
<!-- Build a dev environment -->
|
196
|
+
<echo message="Building a Development Environment..."/>
|
197
|
+
<antcall target="-rev"/>
|
198
|
+
<antcall target="-clean"/>
|
199
|
+
<antcall target="-copy"/>
|
200
|
+
<antcall target="-imagespng"/>
|
201
|
+
<antcall target="-imagesjpg"/>
|
202
|
+
</then>
|
203
|
+
|
204
|
+
<elseif>
|
205
|
+
<equals arg1="${env}" arg2="test"/>
|
206
|
+
<then>
|
207
|
+
<!-- Build a test environment -->
|
208
|
+
<echo message="Building a Test Environment..."/>
|
209
|
+
<antcall target="-rev"/>
|
210
|
+
<antcall target="-clean"/>
|
211
|
+
<antcall target="-copy"/>
|
212
|
+
<antcall target="-usemin"/>
|
213
|
+
<antcall target="-js.all.minify"/>
|
214
|
+
<antcall target="-js.main.concat"/>
|
215
|
+
<antcall target="-js.mylibs.concat"/>
|
216
|
+
<antcall target="-js.scripts.concat"/>
|
217
|
+
<antcall target="-js.delete"/>
|
218
|
+
<antcall target="-css"/>
|
219
|
+
<antcall target="-html"/>
|
220
|
+
<antcall target="-htmlclean"/>
|
221
|
+
<antcall target="-imagespng"/>
|
222
|
+
<antcall target="-imagesjpg"/>
|
223
|
+
</then>
|
224
|
+
</elseif>
|
225
|
+
|
226
|
+
<else>
|
227
|
+
<!-- Build a production environment -->
|
228
|
+
<echo message="Building a Production Environment..."/>
|
229
|
+
<antcall target="-rev"/>
|
230
|
+
<antcall target="-clean"/>
|
231
|
+
<antcall target="-copy"/>
|
232
|
+
<antcall target="-usemin"/>
|
233
|
+
<antcall target="-js.all.minify"/>
|
234
|
+
<antcall target="-js.main.concat"/>
|
235
|
+
<antcall target="-js.mylibs.concat"/>
|
236
|
+
<antcall target="-js.scripts.concat"/>
|
237
|
+
<antcall target="-js.delete"/>
|
238
|
+
<antcall target="-strip-console.log"/>
|
239
|
+
<antcall target="-css"/>
|
240
|
+
<antcall target="-html"/>
|
241
|
+
<antcall target="-htmlclean"/>
|
242
|
+
<antcall target="-imagespng"/>
|
243
|
+
<antcall target="-imagesjpg"/>
|
244
|
+
</else>
|
245
|
+
</if>
|
246
|
+
</target>
|
247
|
+
|
248
|
+
|
249
|
+
<target name="minify">
|
250
|
+
<if>
|
251
|
+
<equals arg1="${env}" arg2="dev"/>
|
252
|
+
<then>
|
253
|
+
<!-- Build a dev environment -->
|
254
|
+
<echo message="Building a Development Environment..."/>
|
255
|
+
<antcall target="-rev"/>
|
256
|
+
<antcall target="-clean"/>
|
257
|
+
<antcall target="-copy"/>
|
258
|
+
<antcall target="-imagespng"/>
|
259
|
+
<antcall target="-imagesjpg"/>
|
260
|
+
</then>
|
261
|
+
|
262
|
+
<elseif>
|
263
|
+
<equals arg1="${env}" arg2="test"/>
|
264
|
+
<then>
|
265
|
+
<!-- Build a test environment -->
|
266
|
+
<echo message="Building a Test Environment..."/>
|
267
|
+
<antcall target="-rev"/>
|
268
|
+
<antcall target="-clean"/>
|
269
|
+
<antcall target="-copy"/>
|
270
|
+
<antcall target="-usemin"/>
|
271
|
+
<antcall target="-js.all.minify"/>
|
272
|
+
<antcall target="-js.main.concat"/>
|
273
|
+
<antcall target="-js.mylibs.concat"/>
|
274
|
+
<antcall target="-js.scripts.concat"/>
|
275
|
+
<antcall target="-js.delete"/>
|
276
|
+
<antcall target="-css"/>
|
277
|
+
<antcall target="-html"/>
|
278
|
+
<antcall target="-htmlcompress"/>
|
279
|
+
<antcall target="-imagespng"/>
|
280
|
+
<antcall target="-imagesjpg"/>
|
281
|
+
</then>
|
282
|
+
</elseif>
|
283
|
+
|
284
|
+
<else>
|
285
|
+
<!-- Build a production environment -->
|
286
|
+
<echo message="Building a Production Environment..."/>
|
287
|
+
<antcall target="-rev"/>
|
288
|
+
<antcall target="-clean"/>
|
289
|
+
<antcall target="-copy"/>
|
290
|
+
<antcall target="-usemin"/>
|
291
|
+
<antcall target="-js.all.minify"/>
|
292
|
+
<antcall target="-js.main.concat"/>
|
293
|
+
<antcall target="-js.mylibs.concat"/>
|
294
|
+
<antcall target="-js.scripts.concat"/>
|
295
|
+
<antcall target="-js.delete"/>
|
296
|
+
<antcall target="-strip-console.log"/>
|
297
|
+
<antcall target="-css"/>
|
298
|
+
<antcall target="-html"/>
|
299
|
+
<antcall target="-htmlcompress"/>
|
300
|
+
<antcall target="-imagespng"/>
|
301
|
+
<antcall target="-imagesjpg"/>
|
302
|
+
</else>
|
303
|
+
</if>
|
304
|
+
</target>
|
305
|
+
|
306
|
+
|
307
|
+
<!--
|
308
|
+
*************************************************
|
309
|
+
* FUNCTION TARGETS *
|
310
|
+
*************************************************
|
311
|
+
-->
|
312
|
+
<target name="-load-build-info" description="(PRIVATE) Loads the build versioning information">
|
313
|
+
<property file="./${dir.build}/config/${build.version.info}"/>
|
314
|
+
</target>
|
315
|
+
|
316
|
+
<target name="-clean" description="(PRIVATE) Wipe the previous build (Deletes the dir.publish directory">
|
317
|
+
<!-- This is a private target -->
|
318
|
+
|
319
|
+
<echo message="Cleaning up previous build directory..."/>
|
320
|
+
<delete dir="./${dir.publish}/"/>
|
321
|
+
</target>
|
322
|
+
|
323
|
+
|
324
|
+
<target name="-rev" description="(PRIVATE) Increase the current build number by one and set build date">
|
325
|
+
<!-- This is a private target -->
|
326
|
+
|
327
|
+
<echo message="Increasing the build number..."/>
|
328
|
+
<propertyfile file="./${dir.build}/config/${build.version.info}" comment="Build Information File - DO NOT CHANGE">
|
329
|
+
<entry key="build.number" type="int" default="0000" operation="+" pattern="0000"/>
|
330
|
+
<entry key="build.date" type="date" value="now" pattern="dd.MM.yyyy HH:mm"/>
|
331
|
+
</propertyfile>
|
332
|
+
<property file="./${dir.build}/config/${build.version.info}"/>
|
333
|
+
<echo>Creating build ${build.number}</echo>
|
334
|
+
</target>
|
335
|
+
|
336
|
+
|
337
|
+
<target name="current-number" depends="-load-build-info" description="(PUBLIC) Returns the current build number">
|
338
|
+
<echo>Current build number: ${build.number}</echo>
|
339
|
+
</target>
|
340
|
+
|
341
|
+
|
342
|
+
<target name="-copy" depends="-load-build-info">
|
343
|
+
<!-- This is a private target -->
|
344
|
+
|
345
|
+
<echo message="Copying over new files..."/>
|
346
|
+
<!-- combine the 2 exclude properties -->
|
347
|
+
<var name="excluded-files" value="${file.default.exclude}, ${file.exclude}"/>
|
348
|
+
|
349
|
+
<copy todir="./${dir.publish}">
|
350
|
+
<fileset dir="./" excludes="${excluded-files}"/>
|
351
|
+
</copy>
|
352
|
+
</target>
|
353
|
+
|
354
|
+
|
355
|
+
<!-- JAVASCRIPT -->
|
356
|
+
<target name="-js.main.concat" depends="-load-build-info" description="(PRIVATE) Concatenates the JS files in dir.js">
|
357
|
+
<echo message="Concatenating Main JS scripts..."/>
|
358
|
+
<concat destfile="./${dir.publish}/${dir.js}/scripts-${build.number}.js">
|
359
|
+
<fileset dir="./${dir.publish}/">
|
360
|
+
<include name="**/${dir.js.main}/*.min.js"/>
|
361
|
+
<exclude name="**/${dir.js.mylibs}/*.js"/>
|
362
|
+
<exclude name="**/${dir.js.libs}/*.js"/>
|
363
|
+
</fileset>
|
364
|
+
</concat>
|
365
|
+
</target>
|
366
|
+
|
367
|
+
|
368
|
+
<target name="-js.mylibs.concat" depends="-load-build-info" description="(PRIVATE) Concatenates the JS files in dir.js.mylibs">
|
369
|
+
<echo message="Concatenating JS libraries"/>
|
370
|
+
<concat destfile="./${dir.publish}/${dir.js}/libs-${build.number}.js">
|
371
|
+
<fileset dir="./${dir.publish}/${dir.js.mylibs}/">
|
372
|
+
<include name="**/*.min.js"/>
|
373
|
+
</fileset>
|
374
|
+
</concat>
|
375
|
+
</target>
|
376
|
+
|
377
|
+
|
378
|
+
<target name="-js.scripts.concat" depends="-load-build-info" if="build.concat.scripts">
|
379
|
+
<echo message="Concatenating library file with main script file"/>
|
380
|
+
<concat destfile="./${dir.publish}/${dir.js}/scripts-${build.number}.min.js">
|
381
|
+
<fileset dir="./${dir.publish}/${dir.js}/">
|
382
|
+
<include name="libs-${build.number}.js"/>
|
383
|
+
<include name="scripts-${build.number}.js"/>
|
384
|
+
</fileset>
|
385
|
+
</concat>
|
386
|
+
|
387
|
+
<echo message="Concatenating library file with main debug script file"/>
|
388
|
+
<concat destfile="./${dir.publish}/${dir.js}/scripts-${build.number}-debug.min.js">
|
389
|
+
<fileset dir="./${dir.publish}/${dir.js}/">
|
390
|
+
<include name="libs-${build.number}.js"/>
|
391
|
+
<include name="scripts-${build.number}-debug.js"/>
|
392
|
+
</fileset>
|
393
|
+
</concat>
|
394
|
+
</target>
|
395
|
+
|
396
|
+
|
397
|
+
<target name="-js.all.minify" depends="-js.libs.minify" description="(PRIVATE) Minifies the scripts.js files created by js.scripts.concat">
|
398
|
+
<echo message="Minifying concatenated script- and library-file"/>
|
399
|
+
<apply executable="java" parallel="false">
|
400
|
+
<fileset dir="./${dir.publish}/${dir.js}">
|
401
|
+
<include name="**/*.js"/>
|
402
|
+
<exclude name="**/*.min.js"/>
|
403
|
+
<exclude name="**/${dir.js.libs}/*.js"/>
|
404
|
+
</fileset>
|
405
|
+
<arg line="-jar"/>
|
406
|
+
<arg path="./${dir.build.tools}/${tool.yuicompressor}"/>
|
407
|
+
<srcfile/>
|
408
|
+
<arg line="--line-break"/>
|
409
|
+
<arg line="4000"/>
|
410
|
+
<arg line="-o"/>
|
411
|
+
<mapper type="glob" from="*.js" to="../${dir.publish}/${dir.js}/*.min.js"/>
|
412
|
+
<targetfile/>
|
413
|
+
</apply>
|
414
|
+
</target>
|
415
|
+
|
416
|
+
|
417
|
+
<target name="-js.libs.minify" depends="-load-build-info" description="(PRIVATE) Minifies the helper files in dir.js.libs">
|
418
|
+
<echo message="Minifying helper JS files..."/>
|
419
|
+
|
420
|
+
<apply executable="java" parallel="false">
|
421
|
+
<fileset dir="./${dir.publish}/${dir.js.libs}/" includes="*.js" excludes="*.min.js"/>
|
422
|
+
<arg line="-jar"/>
|
423
|
+
<arg path="./${dir.build.tools}/${tool.yuicompressor}"/>
|
424
|
+
<srcfile/>
|
425
|
+
<arg line="-o"/>
|
426
|
+
<mapper type="glob" from="*.js" to="../${dir.publish}/${dir.js.libs}/*-${build.number}.min.js"/>
|
427
|
+
<targetfile/>
|
428
|
+
</apply>
|
429
|
+
</target>
|
430
|
+
|
431
|
+
|
432
|
+
<target name="-js.delete" depends="-load-build-info" description="(PRIVATE) Deletes the unoptimized js files from build if set">
|
433
|
+
<if>
|
434
|
+
<equals arg1="${build.delete.unoptimized}" arg2="true"/>
|
435
|
+
<then>
|
436
|
+
<echo message="Deleting unoptimized files..."/>
|
437
|
+
<delete file="./${dir.publish}/${dir.js}/scripts-${build.number}.js"/>
|
438
|
+
<delete file="./${dir.publish}/${dir.js}/scripts-${build.number}-debug.js"/>
|
439
|
+
<!--
|
440
|
+
<delete dir="./${dir.publish}/${dir.js.lib}/"/>
|
441
|
+
<delete file="./${dir.publish}/${dir.js}/libs-${build.number}.js"/>
|
442
|
+
this guy probably COULD be on but I think it's better if we keep him off for now. ^pi
|
443
|
+
<delete includeemptydirs="true">
|
444
|
+
<fileset dir="./${dir.publish}/${dir.js.libs}/" includes="*.js" excludes="*.min.js"/>
|
445
|
+
</delete>
|
446
|
+
-->
|
447
|
+
</then>
|
448
|
+
</if>
|
449
|
+
|
450
|
+
<if>
|
451
|
+
<and>
|
452
|
+
<equals arg1="${build.delete.unoptimized}" arg2="true"/>
|
453
|
+
<equals arg1="${build.concat.scripts}" arg2="true"/>
|
454
|
+
</and>
|
455
|
+
<then>
|
456
|
+
<delete file="./${dir.publish}/${dir.js}/libs-${build.number}.js"/>
|
457
|
+
<delete file="./${dir.publish}/${dir.js}/scripts-${build.number}.js"/>
|
458
|
+
</then>
|
459
|
+
</if>
|
460
|
+
</target>
|
461
|
+
|
462
|
+
|
463
|
+
<target name="-strip-console.log" description="(PRIVATE)Comments out any console.log statements">
|
464
|
+
<echo message="Commenting out console.log lines"/>
|
465
|
+
|
466
|
+
|
467
|
+
<replaceregexp match="(console.log\(.*\))" replace="/\*\1\*/" flags="g" >
|
468
|
+
<fileset dir="./${dir.publish}/${dir.js}/">
|
469
|
+
<include name="**/*.js"/>
|
470
|
+
<exclude name="**/*.min.js"/>
|
471
|
+
</fileset>
|
472
|
+
</replaceregexp>
|
473
|
+
</target>
|
474
|
+
|
475
|
+
|
476
|
+
<!-- HTML -->
|
477
|
+
<target name="-usemin" depends="-serverconfig" description="(PRIVATE) Replaces references to non-minified scripts">
|
478
|
+
<echo message="Switching to minified js files..."/>
|
479
|
+
|
480
|
+
<!-- switch from a regular jquery to minified -->
|
481
|
+
<replaceregexp match="jquery-(\d|\d(\.\d)+)\.js" replace="jquery-\1.min.js" flags="">
|
482
|
+
<fileset dir="./${dir.publish}" includes="${page-files}"/>
|
483
|
+
</replaceregexp>
|
484
|
+
<!-- switch any google CDN reference to minified -->
|
485
|
+
<replaceregexp match="(\d|\d(\.\d)+)\/jquery\.js" replace="\1/jquery.min.js" flags="">
|
486
|
+
<fileset dir="./${dir.publish}" includes="${page-files}"/>
|
487
|
+
</replaceregexp>
|
488
|
+
|
489
|
+
<echo>kill off those versioning flags: ?v=2</echo>
|
490
|
+
<replaceregexp match='\?v=\d+">' replace='">' flags="">
|
491
|
+
<fileset dir="./${dir.publish}" includes="${page-files}"/>
|
492
|
+
</replaceregexp>
|
493
|
+
</target>
|
494
|
+
|
495
|
+
|
496
|
+
<target name="-html" depends="-load-build-info" description="(PRIVATE) Very basic clean up of the HTML">
|
497
|
+
<echo message="Clean up the html..."/>
|
498
|
+
<!-- style.css replacement handled as a replacetoken above -->
|
499
|
+
<replaceregexp match="<!-- scripts concatenated [\d\w\s\W]*?!-- end concatenated and minified scripts-->" replace="<script src='${dir.js}/scripts-${build.number}.min.js\'></script>" flags="m">
|
500
|
+
<fileset dir="./${dir.publish}" includes="${page-files}"/>
|
501
|
+
</replaceregexp>
|
502
|
+
<!--[! use comments like this one to avoid having them get minified -->
|
503
|
+
</target>
|
504
|
+
|
505
|
+
|
506
|
+
<target name="-htmlclean">
|
507
|
+
<apply executable="java" parallel="false" force="true" dest="./${dir.publish}/" >
|
508
|
+
<fileset dir="./${dir.publish}/" includes="${page-files}"/>
|
509
|
+
<arg value="-jar"/>
|
510
|
+
<arg path="./${dir.build}/tools/${tool.htmlcompressor}"/>
|
511
|
+
<arg line="--type html"/>
|
512
|
+
<arg line="--preserve-multi-spaces"/>
|
513
|
+
<arg line="--remove-quotes"/>
|
514
|
+
<arg line="--compress-js"/>
|
515
|
+
<arg line="--compress-css"/>
|
516
|
+
<srcfile/>
|
517
|
+
<arg value="-o"/>
|
518
|
+
<mapper type="glob" from="*.html" to="../${dir.publish}/*.html"/>
|
519
|
+
<targetfile/>
|
520
|
+
</apply>
|
521
|
+
</target>
|
522
|
+
|
523
|
+
|
524
|
+
<target name="-htmlbuildkit">
|
525
|
+
<apply executable="java" parallel="false" force="true" dest="./${dir.publish}/" >
|
526
|
+
<fileset dir="./${dir.publish}/" includes="${page-files}"/>
|
527
|
+
<arg value="-jar"/>
|
528
|
+
<arg path="./${dir.build}/tools/${tool.htmlcompressor}"/>
|
529
|
+
<arg value="--preserve-comments"/>
|
530
|
+
<arg line="--preserve-multi-spaces"/>
|
531
|
+
<arg line="--type html"/>
|
532
|
+
<arg line="--compress-js"/>
|
533
|
+
<arg line="--compress-css"/>
|
534
|
+
<srcfile/>
|
535
|
+
<arg value="-o"/>
|
536
|
+
<mapper type="glob" from="*.html" to="../${dir.publish}/*.html"/>
|
537
|
+
<targetfile/>
|
538
|
+
</apply>
|
539
|
+
</target>
|
540
|
+
|
541
|
+
|
542
|
+
<target name="-htmlcompress">
|
543
|
+
<apply executable="java" parallel="false" force="true" dest="./${dir.publish}/" >
|
544
|
+
<fileset dir="./${dir.publish}/" includes="${page-files}"/>
|
545
|
+
<arg value="-jar"/>
|
546
|
+
<arg path="./${dir.build}/tools/${tool.htmlcompressor}"/>
|
547
|
+
<arg line="--type html"/>
|
548
|
+
<arg line="--remove-quotes"/>
|
549
|
+
<arg line="--compress-js"/>
|
550
|
+
<arg line="--compress-css"/>
|
551
|
+
<srcfile/>
|
552
|
+
<arg value="-o"/>
|
553
|
+
<mapper type="glob" from="*.html" to="../${dir.publish}/*.html"/>
|
554
|
+
<targetfile/>
|
555
|
+
</apply>
|
556
|
+
</target>
|
557
|
+
|
558
|
+
|
559
|
+
<target name="-serverconfig" description="(PRIVATE) Upgrades expires headers">
|
560
|
+
<echo message="Upgrading expires header timeouts for js/css"/>
|
561
|
+
<replace file="./${dir.publish}/${file.serverconfig}" token="access plus 2 months" value="access plus 1 year"/>
|
562
|
+
</target>
|
563
|
+
|
564
|
+
|
565
|
+
<!-- CSS -->
|
566
|
+
<target name="-css" description="Concatenates and Minifies any stylesheets listed in the file.stylesheets property">
|
567
|
+
<echo message="Minifying css..."/>
|
568
|
+
|
569
|
+
<concat destfile="./${dir.publish}/${dir.css}/style-${build.number}.css">
|
570
|
+
<filelist dir="./${dir.publish}/${dir.css}" files="${stylesheet-files}"/>
|
571
|
+
</concat>
|
572
|
+
<apply executable="php" parallel="false">
|
573
|
+
<fileset dir="./${dir.publish}/${dir.css}/" includes="style-${build.number}.css"/>
|
574
|
+
<arg line="-f"/>
|
575
|
+
<arg path="./${dir.build.tools}/${tool.csscompressor}"/>
|
576
|
+
<srcfile/>
|
577
|
+
<redirector>
|
578
|
+
<outputmapper type="glob" from="style-${build.number}.css" to="./${dir.publish}/${dir.css}/style-${build.number}.min.css"/>
|
579
|
+
</redirector>
|
580
|
+
</apply>
|
581
|
+
<replace token="style.css" value="style-${build.number}.min.css" dir="${dir.publish}" includes="${page-files}"/>
|
582
|
+
</target>
|
583
|
+
|
584
|
+
|
585
|
+
<!-- IMAGES -->
|
586
|
+
<target name="-imagespng" description="(PRIVATE) Optimizes .png images using optipng">
|
587
|
+
<echo message="Optimizing images"/>
|
588
|
+
|
589
|
+
<!-- osfamily=unix is actually true on OS X as well -->
|
590
|
+
<apply executable="optipng" osfamily="unix">
|
591
|
+
<arg value="-o7"/>
|
592
|
+
<fileset dir="./${dir.publish}/">
|
593
|
+
<include name="**/*.png"/>
|
594
|
+
</fileset>
|
595
|
+
</apply>
|
596
|
+
<apply executable="tools/optipng-0.6.4-exe/optipng.exe" osfamily="windows">
|
597
|
+
<arg value="-o7"/>
|
598
|
+
<fileset dir="./${dir.publish}/">
|
599
|
+
<include name="**/*.png"/>
|
600
|
+
</fileset>
|
601
|
+
</apply>
|
602
|
+
</target>
|
603
|
+
|
604
|
+
|
605
|
+
<target name="-imagesjpg" description="(PRIVATE) Optimizes .jpg images using jpegtan">
|
606
|
+
<echo message="Clean up those jpgs..."/>
|
607
|
+
<if>
|
608
|
+
<equals arg1="${images.strip.metadata}" arg2="true"/>
|
609
|
+
<then>
|
610
|
+
<var name="strip-meta-tags" value="none"/>
|
611
|
+
</then>
|
612
|
+
<else>
|
613
|
+
<var name="strip-meta-tags" value="all"/>
|
614
|
+
</else>
|
615
|
+
</if>
|
616
|
+
<apply executable="jpegtran" osfamily="unix">
|
617
|
+
<fileset dir="./${dir.publish}/${dir.images}/" includes="*.jpg"/>
|
618
|
+
<arg value="-copy"/>
|
619
|
+
<arg value="${strip-meta-tags}"/>
|
620
|
+
<srcfile/>
|
621
|
+
<targetfile/>
|
622
|
+
<!-- you may want to flag optimized images. If so, do it here. Otherwise change this to type="identity" -->
|
623
|
+
<mapper type="glob" from="*.jpg" to="../${dir.publish}/${dir.images}/*.jpg"/>
|
624
|
+
</apply>
|
625
|
+
<apply executable="tools/jpegtran.exe" osfamily="windows">
|
626
|
+
<fileset dir="./${dir.publish}/${dir.images}/" includes="*.jpg"/>
|
627
|
+
<arg value="-copy"/>
|
628
|
+
<arg value="${strip-meta-tags}"/>
|
629
|
+
<srcfile/>
|
630
|
+
<targetfile/>
|
631
|
+
<!-- you may want to flag optimized images. If so, do it here. Otherwise change this to type="identity" -->
|
632
|
+
<mapper type="glob" from="*.jpg" to="../${dir.publish}/${dir.images}/*.jpg"/>
|
633
|
+
</apply>
|
634
|
+
</target>
|
635
|
+
|
636
|
+
</project>
|