Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 197 lines (171 sloc) 7.889 kb
a213cfa @eddiemonge Complete overhaul of Make process to be cleaner, clearer and server-f…
eddiemonge authored
1 # Helper Variables
2 # The command to replace the @VERSION in the files with the actual version
3 VER = sed "s/v@VERSION/$$(git log -1 --format=format:"Git Build: SHA1: %H <> Date: %cd")/"
5f2c402 @eddiemonge Add the current git version to the build process when its not a stabl…
eddiemonge authored
4 VER_MIN = "/*! jQuery Mobile v$$(git log -1 --format=format:"Git Build: SHA1: %H <> Date: %cd") jquerymobile.com | jquery.org/license */"
a213cfa @eddiemonge Complete overhaul of Make process to be cleaner, clearer and server-f…
eddiemonge authored
5 VER_OFFICIAL = $(shell cat version.txt)
5062e56 @gseguin Fixed version string in built bundles (docs and main)
gseguin authored
6 SED_VER_API = sed 's/__version__/"${VER_OFFICIAL}"/g'
8c6498f @eddiemonge Fix license version and zip folder
eddiemonge authored
7 deploy: VER = sed "s/v@VERSION/${VER_OFFICIAL}/"
5f2c402 @eddiemonge Add the current git version to the build process when its not a stabl…
eddiemonge authored
8 deploy: VER_MIN = "/*! jQuery Mobile v${VER_OFFICIAL} jquerymobile.com | jquery.org/license */"
a213cfa @eddiemonge Complete overhaul of Make process to be cleaner, clearer and server-f…
eddiemonge authored
9
10 # The output folder for the finished files
11 OUTPUT = compiled
96c1647 @eddiemonge Changes so make can be run with just make nightly for the nightly builds
eddiemonge authored
12
a213cfa @eddiemonge Complete overhaul of Make process to be cleaner, clearer and server-f…
eddiemonge authored
13 # The name of the files
14 NAME = jquery.mobile
15 STRUCTURE = jquery.mobile.structure
16 deploy: NAME = jquery.mobile-${VER_OFFICIAL}
17 deploy: STRUCTURE = jquery.mobile.structure-${VER_OFFICIAL}
38b8ee5 @eddiemonge Changed Makefile to include nightly build script and other misc fixes
eddiemonge authored
18
a213cfa @eddiemonge Complete overhaul of Make process to be cleaner, clearer and server-f…
eddiemonge authored
19 # The CSS theme being used
20 THEME = default
47a45f5 @jeresig Add deploy functionality to the build script.
jeresig authored
21
b467dfb @gseguin Revert unwanted change use rhino to run JavaScript
gseguin authored
22 RUN_JS = @@java -XX:ReservedCodeCacheSize=64m -classpath build/js.jar:build/google-compiler-20111003.jar org.mozilla.javascript.tools.shell.Main
68ad57f @gseguin Exclude depend! plugin from the built bundle
gseguin authored
23 #RUN_JS = @@node
38b8ee5 @eddiemonge Changed Makefile to include nightly build script and other misc fixes
eddiemonge authored
24
25
a213cfa @eddiemonge Complete overhaul of Make process to be cleaner, clearer and server-f…
eddiemonge authored
26 # Build Targets
38b8ee5 @eddiemonge Changed Makefile to include nightly build script and other misc fixes
eddiemonge authored
27
a213cfa @eddiemonge Complete overhaul of Make process to be cleaner, clearer and server-f…
eddiemonge authored
28 # When no build target is specified, all gets ran
e7ee7fe @gseguin More house cleaning
gseguin authored
29 all: css js zip notify
38b8ee5 @eddiemonge Changed Makefile to include nightly build script and other misc fixes
eddiemonge authored
30
de92360 @gseguin House cleaning: clean target cleans, init target inits
gseguin authored
31 clean:
32 # -------------------------------------------------
33 # Cleaning build output
34 @@rm -rf ${OUTPUT}
35 @@rm -rf tmp
36
37 # Create the output directory.
e7ee7fe @gseguin More house cleaning
gseguin authored
38 init:
de92360 @gseguin House cleaning: clean target cleans, init target inits
gseguin authored
39 @@mkdir -p ${OUTPUT}
38b8ee5 @eddiemonge Changed Makefile to include nightly build script and other misc fixes
eddiemonge authored
40
a213cfa @eddiemonge Complete overhaul of Make process to be cleaner, clearer and server-f…
eddiemonge authored
41 # Build and minify the CSS files
42 css: init
43 # Build the CSS file with the theme included
c5dd709 @gseguin Variableized the JavaScript runner
gseguin authored
44 ${RUN_JS} \
23b2d7f @eddiemonge increase java cache size
eddiemonge authored
45 external/r.js/dist/r.js \
a19e5dd @gseguin Changed source CSS file for css bundle following bac53cf151ac052fba2b…
gseguin authored
46 -o cssIn=css/themes/default/jquery.mobile.css \
23b2d7f @eddiemonge increase java cache size
eddiemonge authored
47 out=${OUTPUT}/${NAME}.compiled.css
8c6498f @eddiemonge Fix license version and zip folder
eddiemonge authored
48 @@cat LICENSE-INFO.txt | ${VER} > ${OUTPUT}/${NAME}.css
e2606bc @gseguin Re-introduced structure CSS files
gseguin authored
49 @@cat ${OUTPUT}/${NAME}.compiled.css >> ${OUTPUT}/${NAME}.css
a213cfa @eddiemonge Complete overhaul of Make process to be cleaner, clearer and server-f…
eddiemonge authored
50 @@echo ${VER_MIN} > ${OUTPUT}/${NAME}.min.css
23b2d7f @eddiemonge increase java cache size
eddiemonge authored
51 @@java -XX:ReservedCodeCacheSize=64m \
52 -jar build/yuicompressor-2.4.6.jar \
53 --type css ${OUTPUT}/${NAME}.compiled.css >> ${OUTPUT}/${NAME}.min.css
e2606bc @gseguin Re-introduced structure CSS files
gseguin authored
54 @@rm ${OUTPUT}/${NAME}.compiled.css
55 # Build the CSS Structure-only file
e42c702 @gseguin Use jquery.mobile.structure.css instead of the list all the individual
gseguin authored
56 ${RUN_JS} \
57 external/r.js/dist/r.js \
1609ea1 @gseguin Changed input file for css structure to static string: jquery.mobile.…
gseguin authored
58 -o cssIn=css/structure/jquery.mobile.structure.css \
e42c702 @gseguin Use jquery.mobile.structure.css instead of the list all the individual
gseguin authored
59 out=${OUTPUT}/${STRUCTURE}.compiled.css
e2606bc @gseguin Re-introduced structure CSS files
gseguin authored
60 @@cat LICENSE-INFO.txt | ${VER} > ${OUTPUT}/${STRUCTURE}.css
e42c702 @gseguin Use jquery.mobile.structure.css instead of the list all the individual
gseguin authored
61 @@cat ${OUTPUT}/${STRUCTURE}.compiled.css >> ${OUTPUT}/${STRUCTURE}.css
e2606bc @gseguin Re-introduced structure CSS files
gseguin authored
62 # ..... and then minify it
63 @@echo ${VER_MIN} > ${OUTPUT}/${STRUCTURE}.min.css
23b2d7f @eddiemonge increase java cache size
eddiemonge authored
64 @@java -XX:ReservedCodeCacheSize=64m \
65 -jar build/yuicompressor-2.4.6.jar \
e42c702 @gseguin Use jquery.mobile.structure.css instead of the list all the individual
gseguin authored
66 --type css ${OUTPUT}/${STRUCTURE}.compiled.css >> ${OUTPUT}/${STRUCTURE}.min.css
67 @@rm ${OUTPUT}/${STRUCTURE}.compiled.css
a213cfa @eddiemonge Complete overhaul of Make process to be cleaner, clearer and server-f…
eddiemonge authored
68 # ..... and then copy in the images
69 @@cp -R css/themes/${THEME}/images ${OUTPUT}/
70 # Css portion is complete.
71 # -------------------------------------------------
72
73
228e317 @gseguin Rewrote "docs" target to take advantage of r.js' whole project optimi…
gseguin authored
74 docs: init
a213cfa @eddiemonge Complete overhaul of Make process to be cleaner, clearer and server-f…
eddiemonge authored
75 # Create the Demos/Docs/Tests/Tools
228e317 @gseguin Rewrote "docs" target to take advantage of r.js' whole project optimi…
gseguin authored
76 # ... Build the docs bundle
c5dd709 @gseguin Variableized the JavaScript runner
gseguin authored
77 ${RUN_JS} \
228e317 @gseguin Rewrote "docs" target to take advantage of r.js' whole project optimi…
gseguin authored
78 external/r.js/dist/r.js \
79 -o build/docs.build.js \
e7ee7fe @gseguin More house cleaning
gseguin authored
80 dir=../tmp/demos
2bddfeb @gseguin Add versioned copyright and version string to jquery.mobile.js in the…
gseguin authored
81 # ... Prepend versioned license to jquery.mobile.js
e7ee7fe @gseguin More house cleaning
gseguin authored
82 @@cat LICENSE-INFO.txt | ${VER} > tmp/demos/LICENSE-INFO.txt
83 @@cat tmp/demos/LICENSE-INFO.txt | cat - tmp/demos/js/jquery.mobile.js > tmp/demos/js/jquery.mobile.js.tmp
84 @@cat tmp/demos/js/jquery.mobile.js.tmp | ${SED_VER_API} > tmp/demos/js/jquery.mobile.js
2bddfeb @gseguin Add versioned copyright and version string to jquery.mobile.js in the…
gseguin authored
85 # ... Prepend versioned license to jquery.mobile.docs.js
e7ee7fe @gseguin More house cleaning
gseguin authored
86 @@cat tmp/demos/LICENSE-INFO.txt | cat - tmp/demos/js/jquery.mobile.docs.js > tmp/demos/js/jquery.mobile.docs.js.tmp
87 @@cat tmp/demos/js/jquery.mobile.docs.js.tmp | ${SED_VER_API} > tmp/demos/js/jquery.mobile.docs.js
2bddfeb @gseguin Add versioned copyright and version string to jquery.mobile.js in the…
gseguin authored
88 # ... Prepend versioned license to jquery.mobile.css
e7ee7fe @gseguin More house cleaning
gseguin authored
89 @@cat tmp/demos/LICENSE-INFO.txt | cat - tmp/demos/css/themes/default/${NAME}.css > tmp/demos/css/themes/default/${NAME}.css.tmp
90 @@mv tmp/demos/css/themes/default/${NAME}.css.tmp tmp/demos/css/themes/default/${NAME}.css
366d33e @eddiemonge Update Makefile to actually work on the server
eddiemonge authored
91 # ... Move and zip up the the whole folder
e7ee7fe @gseguin More house cleaning
gseguin authored
92 @@rm -f ${OUTPUT}/${NAME}.docs.zip
93 @@cd tmp/demos && rm -f *.php && rm -f Makefile
94 @@cd tmp/demos && zip -rq ../../${OUTPUT}/${NAME}.docs.zip *
95 @@rm -rf ${OUTPUT}/demos && mv -f tmp/demos ${OUTPUT}
366d33e @eddiemonge Update Makefile to actually work on the server
eddiemonge authored
96 # Finish by removing the temporary files
a213cfa @eddiemonge Complete overhaul of Make process to be cleaner, clearer and server-f…
eddiemonge authored
97 @@rm -rf tmp
98 # -------------------------------------------------
99
100 # Build and minify the JS files
101 js: init
102 # Build the JavaScript file
c5dd709 @gseguin Variableized the JavaScript runner
gseguin authored
103 ${RUN_JS} \
23b2d7f @eddiemonge increase java cache size
eddiemonge authored
104 external/r.js/dist/r.js \
105 -o baseUrl="js" \
ae835d0 @gseguin Fixes #3479
gseguin authored
106 include=jquery.mobile \
68ad57f @gseguin Exclude depend! plugin from the built bundle
gseguin authored
107 exclude=jquery,../external/requirejs/order,../external/requirejs/depend,../external/requirejs/text,../external/requirejs/text!../version.txt \
23b2d7f @eddiemonge increase java cache size
eddiemonge authored
108 out=${OUTPUT}/${NAME}.compiled.js \
109 pragmasOnSave.jqmBuildExclude=true \
c841078 @gseguin Fixes #3429
gseguin authored
110 wrap.startFile=build/wrap.start \
111 wrap.endFile=build/wrap.end \
2ba27e0 @gseguin Fixes #3394 - jquery.mobile.init was not being included in the built …
gseguin authored
112 findNestedDependencies=true \
23b2d7f @eddiemonge increase java cache size
eddiemonge authored
113 skipModuleInsertion=true \
114 optimize=none
8c6498f @eddiemonge Fix license version and zip folder
eddiemonge authored
115 @@cat LICENSE-INFO.txt | ${VER} > ${OUTPUT}/${NAME}.js
5062e56 @gseguin Fixed version string in built bundles (docs and main)
gseguin authored
116 @@cat ${OUTPUT}/${NAME}.compiled.js | ${SED_VER_API} >> ${OUTPUT}/${NAME}.js
c8d88a2 @gseguin Renamed .tmp temp file to .compiled
gseguin authored
117 @@rm ${OUTPUT}/${NAME}.compiled.js
08b8955 @gseguin Use original r.js, externalized stripping of define/require to amd-st…
gseguin authored
118 # ..... and then minify it
ca6fe9b @gseguin Changed js and css targets to use r.js and r-jqm.js
gseguin authored
119 @@echo ${VER_MIN} > ${OUTPUT}/${NAME}.min.js
08b8955 @gseguin Use original r.js, externalized stripping of define/require to amd-st…
gseguin authored
120 @@java -XX:ReservedCodeCacheSize=64m \
23b2d7f @eddiemonge increase java cache size
eddiemonge authored
121 -jar build/google-compiler-20111003.jar \
122 --js ${OUTPUT}/${NAME}.js \
123 --js_output_file ${OUTPUT}/${NAME}.compiled.js
c8d88a2 @gseguin Renamed .tmp temp file to .compiled
gseguin authored
124 @@cat ${OUTPUT}/${NAME}.compiled.js >> ${OUTPUT}/${NAME}.min.js
125 @@rm ${OUTPUT}/${NAME}.compiled.js
a213cfa @eddiemonge Complete overhaul of Make process to be cleaner, clearer and server-f…
eddiemonge authored
126 # -------------------------------------------------
127
128
129 # Output a message saying the process is complete
130 notify: init
131 @@echo "The files have been built and are in: " $$(pwd)/${OUTPUT}
132 # -------------------------------------------------
e2fa299 @jeresig Adjust sub-directory URLs before deploying the demos.
jeresig authored
133
134
a213cfa @eddiemonge Complete overhaul of Make process to be cleaner, clearer and server-f…
eddiemonge authored
135 # Zip up the jQm files without docs
45b71e1 @johnbender Makefile whitespace
johnbender authored
136 zip: init css js
a213cfa @eddiemonge Complete overhaul of Make process to be cleaner, clearer and server-f…
eddiemonge authored
137 # Packaging up the files into a zip archive
0d283cb @eddiemonge combine the css structure min and license files
eddiemonge authored
138 @@mkdir tmp
45b71e1 @johnbender Makefile whitespace
johnbender authored
139 @@cp -R ${OUTPUT} tmp/${NAME}
5acc18a @eddiemonge Add images to the docs, fix cp syntax, rearrange build dependencies t…
eddiemonge authored
140 # ... And remove the Zipped docs so they aren't included twice (for deploy scripts)
45b71e1 @johnbender Makefile whitespace
johnbender authored
141 @@rm -rf tmp/${NAME}/${NAME}.docs.zip
8c6498f @eddiemonge Fix license version and zip folder
eddiemonge authored
142 @@cd tmp; zip -rq ../${OUTPUT}/${NAME}.zip ${NAME}
0d283cb @eddiemonge combine the css structure min and license files
eddiemonge authored
143 @@rm -rf tmp
a213cfa @eddiemonge Complete overhaul of Make process to be cleaner, clearer and server-f…
eddiemonge authored
144 # -------------------------------------------------
19c952a @eddiemonge For all versions of make except for deploy, the outputted scripts wil…
eddiemonge authored
145
a213cfa @eddiemonge Complete overhaul of Make process to be cleaner, clearer and server-f…
eddiemonge authored
146 # -------------------------------------------------
147 # -------------------------------------------------
148 # -------------------------------------------------
149 #
150 # For jQuery Team Use Only
151 #
152 # -------------------------------------------------
e7ee7fe @gseguin More house cleaning
gseguin authored
153 # NOTE the clean (which removes previous build output) has been removed to prevent a gap in service
84f6085 @johnbender remove init from latest build target
johnbender authored
154 build_latest: css docs js zip
a213cfa @eddiemonge Complete overhaul of Make process to be cleaner, clearer and server-f…
eddiemonge authored
155
0b858d2 @johnbender split up latest build and deploy
johnbender authored
156 deploy_latest:
a213cfa @eddiemonge Complete overhaul of Make process to be cleaner, clearer and server-f…
eddiemonge authored
157 # Time to put these on the CDN
4a1f4f8 @eddiemonge Add quiet option to scp
eddiemonge authored
158 @@scp -qr ${OUTPUT}/* jqadmin@code.origin.jquery.com:/var/www/html/code.jquery.com/mobile/latest/
a213cfa @eddiemonge Complete overhaul of Make process to be cleaner, clearer and server-f…
eddiemonge authored
159 # -------------------------------------------------
160
0b858d2 @johnbender split up latest build and deploy
johnbender authored
161 # Push the latest git version to the CDN. This is done on a post commit hook
162 # TODO target name preserved to avoid issues during refactor, latest -> deploy_latest
163 latest: build_latest deploy_latest
164
a213cfa @eddiemonge Complete overhaul of Make process to be cleaner, clearer and server-f…
eddiemonge authored
165 # Build the nightly backups. This is done on a server cronjob
7cb56bb @johnbender remove cleanup from nightlies to prevent broken build
johnbender authored
166 nightlies: css js docs zip
a213cfa @eddiemonge Complete overhaul of Make process to be cleaner, clearer and server-f…
eddiemonge authored
167 # Time to put these on the CDN
168 @@mkdir -p tmp/nightlies
169 @@mv ${OUTPUT} tmp/nightlies/$$(date "+%Y%m%d")
4a1f4f8 @eddiemonge Add quiet option to scp
eddiemonge authored
170 @@scp -qr tmp/nightlies/* jqadmin@code.origin.jquery.com:/var/www/html/code.jquery.com/mobile/nightlies/
a213cfa @eddiemonge Complete overhaul of Make process to be cleaner, clearer and server-f…
eddiemonge authored
171 # -------------------------------------------------
172
173
174 # Deploy a finished release. This is manually done.
5acc18a @eddiemonge Add images to the docs, fix cp syntax, rearrange build dependencies t…
eddiemonge authored
175 deploy: init css js docs zip
a213cfa @eddiemonge Complete overhaul of Make process to be cleaner, clearer and server-f…
eddiemonge authored
176 # Deploying all the files to the CDN
177 @@mkdir tmp
5acc18a @eddiemonge Add images to the docs, fix cp syntax, rearrange build dependencies t…
eddiemonge authored
178 @@cp -R ${OUTPUT} tmp/${VER_OFFICIAL}
4a1f4f8 @eddiemonge Add quiet option to scp
eddiemonge authored
179 @@scp -qr tmp/* jqadmin@code.origin.jquery.com:/var/www/html/code.jquery.com/mobile/
a213cfa @eddiemonge Complete overhaul of Make process to be cleaner, clearer and server-f…
eddiemonge authored
180 @@rm -rf tmp/${VER_OFFICIAL}
181 @@mv ${OUTPUT}/demos tmp/${VER_OFFICIAL}
4a1f4f8 @eddiemonge Add quiet option to scp
eddiemonge authored
182 # Create the Demos/Docs/Tests/Tools for jQueryMobile.com
ecf0b97 @eddiemonge Update the deployed files to use the CDN for the resources
eddiemonge authored
183 # ... By first replacing the paths
5c04294 @johnbender TODO update jquery version in tag replace
johnbender authored
184 # TODO update jQuery Version replacement on deploy
ecf0b97 @eddiemonge Update the deployed files to use the CDN for the resources
eddiemonge authored
185 @@find tmp/${VER_OFFICIAL} -type f \
186 \( -name '*.html' -o -name '*.php' \) \
187 -exec perl -pi -e \
e74eeda @johnbender default to core 1.7.1 in the deploy of the demo
johnbender authored
188 's|src="(.*)${NAME}.min.js"|src="//code.jquery.com/mobile/${VER_OFFICIAL}/${NAME}.min.js"|g;s|href="(.*)${NAME}.min.css"|href="//code.jquery.com/mobile/${VER_OFFICIAL}/${NAME}.min.css"|g;s|src="(.*)jquery.js"|src="//code.jquery.com/jquery-1.7.1.min.js"|g' {} \;
ecf0b97 @eddiemonge Update the deployed files to use the CDN for the resources
eddiemonge authored
189 # ... So they can be copied to jquerymobile.com
45b71e1 @johnbender Makefile whitespace
johnbender authored
190 @@scp -qr tmp/* jqadmin@jquerymobile.com:/srv/jquerymobile.com/htdocs/demos/
a213cfa @eddiemonge Complete overhaul of Make process to be cleaner, clearer and server-f…
eddiemonge authored
191 # Do some cleanup to wrap it up
192 @@rm -rf tmp
193 @@rm -rf ${OUTPUT}
194 # -------------------------------------------------
195
0d283cb @eddiemonge combine the css structure min and license files
eddiemonge authored
196
Something went wrong with that request. Please try again.