Skip to content
Newer
Older
100644 203 lines (175 sloc) 7.81 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
29 all: init 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.
38 init: clean
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 bac53cf
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 \
80 dir=../tmp/${NAME}
2bddfeb @gseguin Add versioned copyright and version string to jquery.mobile.js in the…
gseguin authored
81 # ... Prepend versioned license to jquery.mobile.js
82 @@cat tmp/${NAME}/LICENSE-INFO.txt | cat - tmp/${NAME}/js/jquery.mobile.js > tmp/${NAME}/js/jquery.mobile.js.tmp
83 @@cat tmp/${NAME}/js/jquery.mobile.js.tmp | ${SED_VER_API} > tmp/${NAME}/js/jquery.mobile.js
84 # ... Prepend versioned license to jquery.mobile.docs.js
d6330f9 @gseguin Added prepending of version licensed to jquery.mobile.docs.js and jqu…
gseguin authored
85 @@cat tmp/${NAME}/LICENSE-INFO.txt | cat - tmp/${NAME}/js/jquery.mobile.docs.js > tmp/${NAME}/js/jquery.mobile.docs.js.tmp
5062e56 @gseguin Fixed version string in built bundles (docs and main)
gseguin authored
86 @@cat tmp/${NAME}/js/jquery.mobile.docs.js.tmp | ${SED_VER_API} > tmp/${NAME}/js/jquery.mobile.docs.js
2bddfeb @gseguin Add versioned copyright and version string to jquery.mobile.js in the…
gseguin authored
87 # ... Prepend versioned license to jquery.mobile.css
d6330f9 @gseguin Added prepending of version licensed to jquery.mobile.docs.js and jqu…
gseguin authored
88 @@cat tmp/${NAME}/LICENSE-INFO.txt | cat - tmp/${NAME}/css/themes/default/${NAME}.css > tmp/${NAME}/css/themes/default/${NAME}.css.tmp
89 @@mv tmp/${NAME}/css/themes/default/${NAME}.css.tmp tmp/${NAME}/css/themes/default/${NAME}.css
366d33e @eddiemonge Update Makefile to actually work on the server
eddiemonge authored
90 # ... Move and zip up the the whole folder
8c6498f @eddiemonge Fix license version and zip folder
eddiemonge authored
91 @@cd tmp; zip -rq ../${OUTPUT}/${NAME}.docs.zip ${NAME}
b7cd212 @eddiemonge Why three lines when 2 will suffice?
eddiemonge authored
92 @@mv tmp/${NAME} ${OUTPUT}/demos
366d33e @eddiemonge Update Makefile to actually work on the server
eddiemonge authored
93 # Finish by removing the temporary files
a213cfa @eddiemonge Complete overhaul of Make process to be cleaner, clearer and server-f…
eddiemonge authored
94 @@rm -rf tmp
95 # -------------------------------------------------
96
5f487bb @eddiemonge add images to path, remove nightly folder before moving to there so i…
eddiemonge authored
97
a213cfa @eddiemonge Complete overhaul of Make process to be cleaner, clearer and server-f…
eddiemonge authored
98 # Create the output directory. This is in a separate step so its not dependant on other targets
99 init:
100 # -------------------------------------------------
555d250 @johnbender clarify make log output
johnbender authored
101 # Cleaning build output
a65ac5f @eddiemonge change makefile to point to CDN
eddiemonge authored
102 @@rm -rf ${OUTPUT}
a213cfa @eddiemonge Complete overhaul of Make process to be cleaner, clearer and server-f…
eddiemonge authored
103 @@rm -rf tmp
104 @@mkdir -p ${OUTPUT}
7e115d6 @jeresig Add in ability to push demos to the jQueryMobile.com server.
jeresig authored
105
a213cfa @eddiemonge Complete overhaul of Make process to be cleaner, clearer and server-f…
eddiemonge authored
106 # Build and minify the JS files
107 js: init
108 # Build the JavaScript file
c5dd709 @gseguin Variableized the JavaScript runner
gseguin authored
109 ${RUN_JS} \
23b2d7f @eddiemonge increase java cache size
eddiemonge authored
110 external/r.js/dist/r.js \
111 -o baseUrl="js" \
ae835d0 @gseguin Fixes #3479
gseguin authored
112 include=jquery.mobile \
68ad57f @gseguin Exclude depend! plugin from the built bundle
gseguin authored
113 exclude=jquery,../external/requirejs/order,../external/requirejs/depend,../external/requirejs/text,../external/requirejs/text!../version.txt \
23b2d7f @eddiemonge increase java cache size
eddiemonge authored
114 out=${OUTPUT}/${NAME}.compiled.js \
115 pragmasOnSave.jqmBuildExclude=true \
c841078 @gseguin Fixes #3429
gseguin authored
116 wrap.startFile=build/wrap.start \
117 wrap.endFile=build/wrap.end \
2ba27e0 @gseguin Fixes #3394 - jquery.mobile.init was not being included in the built …
gseguin authored
118 findNestedDependencies=true \
23b2d7f @eddiemonge increase java cache size
eddiemonge authored
119 skipModuleInsertion=true \
120 optimize=none
8c6498f @eddiemonge Fix license version and zip folder
eddiemonge authored
121 @@cat LICENSE-INFO.txt | ${VER} > ${OUTPUT}/${NAME}.js
5062e56 @gseguin Fixed version string in built bundles (docs and main)
gseguin authored
122 @@cat ${OUTPUT}/${NAME}.compiled.js | ${SED_VER_API} >> ${OUTPUT}/${NAME}.js
c8d88a2 @gseguin Renamed .tmp temp file to .compiled
gseguin authored
123 @@rm ${OUTPUT}/${NAME}.compiled.js
08b8955 @gseguin Use original r.js, externalized stripping of define/require to amd-st…
gseguin authored
124 # ..... and then minify it
ca6fe9b @gseguin Changed js and css targets to use r.js and r-jqm.js
gseguin authored
125 @@echo ${VER_MIN} > ${OUTPUT}/${NAME}.min.js
08b8955 @gseguin Use original r.js, externalized stripping of define/require to amd-st…
gseguin authored
126 @@java -XX:ReservedCodeCacheSize=64m \
23b2d7f @eddiemonge increase java cache size
eddiemonge authored
127 -jar build/google-compiler-20111003.jar \
128 --js ${OUTPUT}/${NAME}.js \
129 --js_output_file ${OUTPUT}/${NAME}.compiled.js
c8d88a2 @gseguin Renamed .tmp temp file to .compiled
gseguin authored
130 @@cat ${OUTPUT}/${NAME}.compiled.js >> ${OUTPUT}/${NAME}.min.js
131 @@rm ${OUTPUT}/${NAME}.compiled.js
a213cfa @eddiemonge Complete overhaul of Make process to be cleaner, clearer and server-f…
eddiemonge authored
132 # -------------------------------------------------
133
134
135 # Output a message saying the process is complete
136 notify: init
137 @@echo "The files have been built and are in: " $$(pwd)/${OUTPUT}
138 # -------------------------------------------------
e2fa299 @jeresig Adjust sub-directory URLs before deploying the demos.
jeresig authored
139
140
a213cfa @eddiemonge Complete overhaul of Make process to be cleaner, clearer and server-f…
eddiemonge authored
141 # Zip up the jQm files without docs
45b71e1 @johnbender Makefile whitespace
johnbender authored
142 zip: init css js
a213cfa @eddiemonge Complete overhaul of Make process to be cleaner, clearer and server-f…
eddiemonge authored
143 # Packaging up the files into a zip archive
0d283cb @eddiemonge combine the css structure min and license files
eddiemonge authored
144 @@mkdir tmp
45b71e1 @johnbender Makefile whitespace
johnbender authored
145 @@cp -R ${OUTPUT} tmp/${NAME}
5acc18a @eddiemonge Add images to the docs, fix cp syntax, rearrange build dependencies t…
eddiemonge authored
146 # ... And remove the Zipped docs so they aren't included twice (for deploy scripts)
45b71e1 @johnbender Makefile whitespace
johnbender authored
147 @@rm -rf tmp/${NAME}/${NAME}.docs.zip
8c6498f @eddiemonge Fix license version and zip folder
eddiemonge authored
148 @@cd tmp; zip -rq ../${OUTPUT}/${NAME}.zip ${NAME}
0d283cb @eddiemonge combine the css structure min and license files
eddiemonge authored
149 @@rm -rf tmp
a213cfa @eddiemonge Complete overhaul of Make process to be cleaner, clearer and server-f…
eddiemonge authored
150 # -------------------------------------------------
19c952a @eddiemonge For all versions of make except for deploy, the outputted scripts wil…
eddiemonge authored
151
a213cfa @eddiemonge Complete overhaul of Make process to be cleaner, clearer and server-f…
eddiemonge authored
152 # -------------------------------------------------
153 # -------------------------------------------------
154 # -------------------------------------------------
155 #
156 # For jQuery Team Use Only
157 #
158 # -------------------------------------------------
84f6085 @johnbender remove init from latest build target
johnbender authored
159 # NOTE the init (which removes previous build output) has been removed to prevent a gap in service
160 build_latest: css docs js zip
a213cfa @eddiemonge Complete overhaul of Make process to be cleaner, clearer and server-f…
eddiemonge authored
161
0b858d2 @johnbender split up latest build and deploy
johnbender authored
162 deploy_latest:
a213cfa @eddiemonge Complete overhaul of Make process to be cleaner, clearer and server-f…
eddiemonge authored
163 # Time to put these on the CDN
4a1f4f8 @eddiemonge Add quiet option to scp
eddiemonge authored
164 @@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
165 # -------------------------------------------------
166
0b858d2 @johnbender split up latest build and deploy
johnbender authored
167 # Push the latest git version to the CDN. This is done on a post commit hook
168 # TODO target name preserved to avoid issues during refactor, latest -> deploy_latest
169 latest: build_latest deploy_latest
170
a213cfa @eddiemonge Complete overhaul of Make process to be cleaner, clearer and server-f…
eddiemonge authored
171 # Build the nightly backups. This is done on a server cronjob
7cb56bb @johnbender remove cleanup from nightlies to prevent broken build
johnbender authored
172 nightlies: css js docs zip
a213cfa @eddiemonge Complete overhaul of Make process to be cleaner, clearer and server-f…
eddiemonge authored
173 # Time to put these on the CDN
174 @@mkdir -p tmp/nightlies
175 @@mv ${OUTPUT} tmp/nightlies/$$(date "+%Y%m%d")
4a1f4f8 @eddiemonge Add quiet option to scp
eddiemonge authored
176 @@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
177 # -------------------------------------------------
178
179
180 # Deploy a finished release. This is manually done.
5acc18a @eddiemonge Add images to the docs, fix cp syntax, rearrange build dependencies t…
eddiemonge authored
181 deploy: init css js docs zip
a213cfa @eddiemonge Complete overhaul of Make process to be cleaner, clearer and server-f…
eddiemonge authored
182 # Deploying all the files to the CDN
183 @@mkdir tmp
5acc18a @eddiemonge Add images to the docs, fix cp syntax, rearrange build dependencies t…
eddiemonge authored
184 @@cp -R ${OUTPUT} tmp/${VER_OFFICIAL}
4a1f4f8 @eddiemonge Add quiet option to scp
eddiemonge authored
185 @@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
186 @@rm -rf tmp/${VER_OFFICIAL}
187 @@mv ${OUTPUT}/demos tmp/${VER_OFFICIAL}
4a1f4f8 @eddiemonge Add quiet option to scp
eddiemonge authored
188 # Create the Demos/Docs/Tests/Tools for jQueryMobile.com
ecf0b97 @eddiemonge Update the deployed files to use the CDN for the resources
eddiemonge authored
189 # ... By first replacing the paths
5c04294 @johnbender TODO update jquery version in tag replace
johnbender authored
190 # TODO update jQuery Version replacement on deploy
ecf0b97 @eddiemonge Update the deployed files to use the CDN for the resources
eddiemonge authored
191 @@find tmp/${VER_OFFICIAL} -type f \
192 \( -name '*.html' -o -name '*.php' \) \
193 -exec perl -pi -e \
e74eeda @johnbender default to core 1.7.1 in the deploy of the demo
johnbender authored
194 '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
195 # ... So they can be copied to jquerymobile.com
45b71e1 @johnbender Makefile whitespace
johnbender authored
196 @@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
197 # Do some cleanup to wrap it up
198 @@rm -rf tmp
199 @@rm -rf ${OUTPUT}
200 # -------------------------------------------------
201
0d283cb @eddiemonge combine the css structure min and license files
eddiemonge authored
202
Something went wrong with that request. Please try again.