Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

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