Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100755 186 lines (152 sloc) 7.961 kB
38b8ee5 @eddiemonge Changed Makefile to include nightly build script and other misc fixes
eddiemonge authored
1 # The system generated date in YYYYMMDD format
2 DATE = $(shell date "+%Y%m%d")
ac62052 @jeresig Add a way to build copies of jQuery Mobile.
jeresig authored
3
96c1647 @eddiemonge Changes so make can be run with just make nightly for the nightly builds
eddiemonge authored
4 # The version according to the source file. If this is the nightly build, use a different version
ac62052 @jeresig Add a way to build copies of jQuery Mobile.
jeresig authored
5 VER = $(shell cat version.txt)
96c1647 @eddiemonge Changes so make can be run with just make nightly for the nightly builds
eddiemonge authored
6 nightly: VER = nightly
38b8ee5 @eddiemonge Changed Makefile to include nightly build script and other misc fixes
eddiemonge authored
7
8 # The command to replace the @VERSION in the files with the actual version
c9a34f1 @jeresig Add versioning information to the headers of the CSS and JS files.
jeresig authored
9 SED_VER = sed "s/@VERSION/${VER}/"
96c1647 @eddiemonge Changes so make can be run with just make nightly for the nightly builds
eddiemonge authored
10 nightly: SED_VER = sed "s/@VERSION/Nightly-${DATE}/"
ac62052 @jeresig Add a way to build copies of jQuery Mobile.
jeresig authored
11
96c1647 @eddiemonge Changes so make can be run with just make nightly for the nightly builds
eddiemonge authored
12 # The version of jQuery core used
13 JQUERY = 1.5.2
14
15 # The directory to create the zipped files in and also serves as the filenames
0e76a6c @jeresig Add a way to generate a single zip file of a release.
jeresig authored
16 DIR = jquery.mobile-${VER}
96c1647 @eddiemonge Changes so make can be run with just make nightly for the nightly builds
eddiemonge authored
17
18 # The output folder for the finished files
19 OUTPUT = compiled
20
21 # The filenames
22 JS = ${DIR}.js
0e76a6c @jeresig Add a way to generate a single zip file of a release.
jeresig authored
23 MIN = ${DIR}.min.js
24 CSS = ${DIR}.css
25 CSSMIN = ${DIR}.min.css
ac62052 @jeresig Add a way to build copies of jQuery Mobile.
jeresig authored
26
96c1647 @eddiemonge Changes so make can be run with just make nightly for the nightly builds
eddiemonge authored
27 # The files to include when compiling the JS files
28 JSFILES = js/jquery.ui.widget.js \
38b8ee5 @eddiemonge Changed Makefile to include nightly build script and other misc fixes
eddiemonge authored
29 js/jquery.mobile.widget.js \
30 js/jquery.mobile.media.js \
31 js/jquery.mobile.support.js \
32 js/jquery.mobile.vmouse.js \
33 js/jquery.mobile.event.js \
34 js/jquery.mobile.hashchange.js \
35 js/jquery.mobile.page.js \
36 js/jquery.mobile.core.js \
37 js/jquery.mobile.navigation.js \
38 js/jquery.mobile.fixHeaderFooter.js \
39 js/jquery.mobile.forms.checkboxradio.js \
40 js/jquery.mobile.forms.textinput.js \
41 js/jquery.mobile.forms.select.js \
42 js/jquery.mobile.buttonMarkup.js \
43 js/jquery.mobile.forms.button.js \
44 js/jquery.mobile.forms.slider.js \
45 js/jquery.mobile.collapsible.js \
46 js/jquery.mobile.controlGroup.js \
47 js/jquery.mobile.fieldContain.js \
48 js/jquery.mobile.listview.js \
49 js/jquery.mobile.listview.filter.js \
50 js/jquery.mobile.dialog.js \
51 js/jquery.mobile.navbar.js \
52 js/jquery.mobile.grid.js \
53 js/jquery.mobile.init.js
54
96c1647 @eddiemonge Changes so make can be run with just make nightly for the nightly builds
eddiemonge authored
55 # The files to include when compiling the CSS files
38b8ee5 @eddiemonge Changed Makefile to include nightly build script and other misc fixes
eddiemonge authored
56 CSSFILES = themes/default/jquery.mobile.theme.css \
57 themes/default/jquery.mobile.core.css \
58 themes/default/jquery.mobile.transitions.css \
59 themes/default/jquery.mobile.grids.css \
60 themes/default/jquery.mobile.headerfooter.css \
61 themes/default/jquery.mobile.navbar.css \
62 themes/default/jquery.mobile.button.css \
63 themes/default/jquery.mobile.collapsible.css \
64 themes/default/jquery.mobile.controlgroup.css \
65 themes/default/jquery.mobile.dialog.css \
66 themes/default/jquery.mobile.forms.checkboxradio.css \
67 themes/default/jquery.mobile.forms.fieldcontain.css \
68 themes/default/jquery.mobile.forms.select.css \
69 themes/default/jquery.mobile.forms.textinput.css \
70 themes/default/jquery.mobile.listview.css \
71 themes/default/jquery.mobile.forms.slider.css
72
96c1647 @eddiemonge Changes so make can be run with just make nightly for the nightly builds
eddiemonge authored
73 # By default, this is what get runs when make is called without any arguments.
74 # Min and un-min CSS and JS files are the only things built
75 all: init js min css cssmin notify
38b8ee5 @eddiemonge Changed Makefile to include nightly build script and other misc fixes
eddiemonge authored
76
96c1647 @eddiemonge Changes so make can be run with just make nightly for the nightly builds
eddiemonge authored
77 # Build the normal CSS file.
38b8ee5 @eddiemonge Changed Makefile to include nightly build script and other misc fixes
eddiemonge authored
78 css: init
79 @@head -8 js/jquery.mobile.core.js | ${SED_VER} > ${OUTPUT}/${CSS}
80 @@cat ${CSSFILES} >> ${OUTPUT}/${CSS}
81
96c1647 @eddiemonge Changes so make can be run with just make nightly for the nightly builds
eddiemonge authored
82 # Build the minified CSS file
38b8ee5 @eddiemonge Changed Makefile to include nightly build script and other misc fixes
eddiemonge authored
83 cssmin: init css
84 @@head -8 js/jquery.mobile.core.js | ${SED_VER} > ${OUTPUT}/${CSSMIN}
85 @@java -jar build/yuicompressor-2.4.4.jar --type css ${OUTPUT}/${CSS} >> ${OUTPUT}/${CSSMIN}
86
96c1647 @eddiemonge Changes so make can be run with just make nightly for the nightly builds
eddiemonge authored
87 # Build the normal JS file
88 js: init
89 @@head -8 js/jquery.mobile.core.js | ${SED_VER} > ${OUTPUT}/${JS}
90 @@cat ${JSFILES} >> ${OUTPUT}/${JS}
38b8ee5 @eddiemonge Changed Makefile to include nightly build script and other misc fixes
eddiemonge authored
91
96c1647 @eddiemonge Changes so make can be run with just make nightly for the nightly builds
eddiemonge authored
92 # Build the minified JS file
93 min: init js
38b8ee5 @eddiemonge Changed Makefile to include nightly build script and other misc fixes
eddiemonge authored
94 @@head -8 js/jquery.mobile.core.js | ${SED_VER} > ${OUTPUT}/${MIN}
96c1647 @eddiemonge Changes so make can be run with just make nightly for the nightly builds
eddiemonge authored
95 @@java -jar build/google-compiler-20100917.jar --js ${OUTPUT}/${JS} --warning_level QUIET --js_output_file ${MIN}.tmp
38b8ee5 @eddiemonge Changed Makefile to include nightly build script and other misc fixes
eddiemonge authored
96 @@cat ${MIN}.tmp >> ${OUTPUT}/${MIN}
97 @@rm -f ${MIN}.tmp
98
96c1647 @eddiemonge Changes so make can be run with just make nightly for the nightly builds
eddiemonge authored
99 # Let the user know the files were built and where they are
100 notify:
101 @@echo "The files have been built and are in " $$(pwd)/${OUTPUT}
102
103 # Create the output directory. This is in a separate step so its not dependant on other targets
38b8ee5 @eddiemonge Changed Makefile to include nightly build script and other misc fixes
eddiemonge authored
104 init:
96c1647 @eddiemonge Changes so make can be run with just make nightly for the nightly builds
eddiemonge authored
105 @@rm -rf ${OUTPUT}
38b8ee5 @eddiemonge Changed Makefile to include nightly build script and other misc fixes
eddiemonge authored
106 @@mkdir ${OUTPUT}
107
96c1647 @eddiemonge Changes so make can be run with just make nightly for the nightly builds
eddiemonge authored
108 # Pull the latest commits. This is used for the nightly build but can be used to save some keystrokes
38b8ee5 @eddiemonge Changed Makefile to include nightly build script and other misc fixes
eddiemonge authored
109 pull:
96c1647 @eddiemonge Changes so make can be run with just make nightly for the nightly builds
eddiemonge authored
110 @@git pull --quiet upstream master
38b8ee5 @eddiemonge Changed Makefile to include nightly build script and other misc fixes
eddiemonge authored
111
96c1647 @eddiemonge Changes so make can be run with just make nightly for the nightly builds
eddiemonge authored
112 # Zip the 4 files and the theme images into one convenient package
113 zip: init js min css cssmin
38b8ee5 @eddiemonge Changed Makefile to include nightly build script and other misc fixes
eddiemonge authored
114 @@rm -rf ${DIR}
47a45f5 @jeresig Add deploy functionality to the build script.
jeresig authored
115 @@mkdir -p ${DIR}
38b8ee5 @eddiemonge Changed Makefile to include nightly build script and other misc fixes
eddiemonge authored
116 @@cp ${OUTPUT}/${DIR}*.js ${DIR}/
117 @@cp ${OUTPUT}/${DIR}*.css ${DIR}/
47a45f5 @jeresig Add deploy functionality to the build script.
jeresig authored
118 @@cp -R themes/default/images ${DIR}/
96c1647 @eddiemonge Changes so make can be run with just make nightly for the nightly builds
eddiemonge authored
119 @@zip -rq ${OUTPUT}/${DIR}.zip ${DIR}
8822132 @eddiemonge Feature Request for issue 1177: Make Makefile output cleaner stuff
eddiemonge authored
120 @@rm -fr ${DIR}
47a45f5 @jeresig Add deploy functionality to the build script.
jeresig authored
121
38b8ee5 @eddiemonge Changed Makefile to include nightly build script and other misc fixes
eddiemonge authored
122
123 # Used by the jQuery team to make the nightly builds
124 nightly: pull zip
96c1647 @eddiemonge Changes so make can be run with just make nightly for the nightly builds
eddiemonge authored
125 # Create a log that lists the current version according to the code and the git information for the last commit
126 @@echo $$"\nGit Release Version: " >> ${OUTPUT}/log.txt
38b8ee5 @eddiemonge Changed Makefile to include nightly build script and other misc fixes
eddiemonge authored
127 @@cat version.txt >> ${OUTPUT}/log.txt
96c1647 @eddiemonge Changes so make can be run with just make nightly for the nightly builds
eddiemonge authored
128 @@echo $$"\nGit Information for this build:" >> ${OUTPUT}/log.txt
38b8ee5 @eddiemonge Changed Makefile to include nightly build script and other misc fixes
eddiemonge authored
129 @@git log -1 --format=format:"SHA1: %H %nDate: %cd %nTitle: %s" >> ${OUTPUT}/log.txt
130
131 # Create the folder to hold the files for the demos
132 @@mkdir -p ${VER}
133
134 # Copy in the base stuff for the demos
135 @@cp -r index.html themes experiments docs ${VER}/
136
137 # First change all the paths from super deep to the same level for JS files
138 @@find ${VER} -type f -name '*.html' -exec sed -i 's|src="../../../js|src="js|g' {} \;
139 @@find ${VER} -type f -name '*.html' -exec sed -i 's|src="../../js|src="js|g' {} \;
140 @@find ${VER} -type f -name '*.html' -exec sed -i 's|src="../js|src="js|g' {} \;
141
142 # Then change all the paths from super deep to the same level for CSS files
143 @@find ${VER} -type f -name '*.html' -exec sed -i 's|media="only all"||g' {} \;
144 @@find ${VER} -type f -name '*.html' -exec sed -i 's|rel="stylesheet" href="../../../|rel="stylesheet" href="|g' {} \;
145 @@find ${VER} -type f -name '*.html' -exec sed -i 's|rel="stylesheet" href="../../|rel="stylesheet" href="|g' {} \;
146 @@find ${VER} -type f -name '*.html' -exec sed -i 's|rel="stylesheet" href="../|rel="stylesheet" href="|g' {} \;
147
148 # Change the empty paths to the location of this nightly file
149 @@find ${VER} -type f -name '*.html' -exec sed -i 's|href="themes/default/"|href="http://jquerymobile.com/nightlies/${DATE}/${DIR}.min.css"|g' {} \;
96c1647 @eddiemonge Changes so make can be run with just make nightly for the nightly builds
eddiemonge authored
150 @@find ${VER} -type f -name '*.html' -exec sed -i 's|src="js/jquery.js"|src="http://code.jquery.com/jquery-${JQUERY}.min.js"|' {} \;
38b8ee5 @eddiemonge Changed Makefile to include nightly build script and other misc fixes
eddiemonge authored
151 @@find ${VER} -type f -name '*.html' -exec sed -i 's|src="js/"|src="http://jquerymobile.com/nightlies/${DATE}/${DIR}.min.js"|g' {} \;
152
153 # Move the demos into the output folder
154 @@mv ${VER} ${OUTPUT}/demos
155
156 # Move the output folder to the nightlies folder
157 @@mv ${OUTPUT} ../htdocs/nightlies/${DATE}
158
159
47a45f5 @jeresig Add deploy functionality to the build script.
jeresig authored
160 # Used by the jQuery team to deploy a build to the CDN
161 deploy: zip
7e115d6 @jeresig Add in ability to push demos to the jQueryMobile.com server.
jeresig authored
162 # Deploy to CDN
f9ec1e4 @jeresig Fix mistake in Makefile deploy script.
jeresig authored
163 @@mv ${DIR} ${VER}
164 @@cp ${DIR}.zip ${VER}/
165 @@scp -r ${VER} jqadmin@code.origin.jquery.com:/var/www/html/code.jquery.com/mobile/
166 @@mv ${VER} ${DIR}
7e115d6 @jeresig Add in ability to push demos to the jQueryMobile.com server.
jeresig authored
167
168 # Deploy Demos
169 @@mkdir -p ${VER}
170 @@cp -r index.html themes experiments docs ${VER}/
e2fa299 @jeresig Adjust sub-directory URLs before deploying the demos.
jeresig authored
171
ac519ba @jeresig Simplifying the build script some more.
jeresig authored
172 @@find ${VER} -type f -name '*.html' -exec sed -i "" -e 's|src="../../../js|src="js|g' {} \;
173 @@find ${VER} -type f -name '*.html' -exec sed -i "" -e 's|src="../../js|src="js|g' {} \;
174 @@find ${VER} -type f -name '*.html' -exec sed -i "" -e 's|src="../js|src="js|g' {} \;
e2fa299 @jeresig Adjust sub-directory URLs before deploying the demos.
jeresig authored
175
950784e @jeresig Make some tweaks to the deploy script.
jeresig authored
176 @@find ${VER} -type f -name '*.html' -exec sed -i "" -e 's|media="only all"||g' {} \;
e2fa299 @jeresig Adjust sub-directory URLs before deploying the demos.
jeresig authored
177 @@find ${VER} -type f -name '*.html' -exec sed -i "" -e 's|rel="stylesheet" href="../../../|rel="stylesheet" href="|g' {} \;
178 @@find ${VER} -type f -name '*.html' -exec sed -i "" -e 's|rel="stylesheet" href="../../|rel="stylesheet" href="|g' {} \;
179 @@find ${VER} -type f -name '*.html' -exec sed -i "" -e 's|rel="stylesheet" href="../|rel="stylesheet" href="|g' {} \;
180
38f09ee @jblas Sweep through all files to add a trailing slash to <link> tags that i…
jblas authored
181 @@find ${VER} -type f -name '*.html' -exec sed -i "" -e 's|href="themes/default/"|href="http://code.jquery.com/mobile/${VER}/${DIR}.min.css"|g' {} \;
96c1647 @eddiemonge Changes so make can be run with just make nightly for the nightly builds
eddiemonge authored
182 @@find ${VER} -type f -name '*.html' -exec sed -i "" -e 's|src="js/jquery.js"|src="http://code.jquery.com/jquery-${JQUERY}.min.js"|' {} \;
950784e @jeresig Make some tweaks to the deploy script.
jeresig authored
183 @@find ${VER} -type f -name '*.html' -exec sed -i "" -e 's|src="js/"|src="http://code.jquery.com/mobile/${VER}/${DIR}.min.js"|g' {} \;
e2fa299 @jeresig Adjust sub-directory URLs before deploying the demos.
jeresig authored
184
7e115d6 @jeresig Add in ability to push demos to the jQueryMobile.com server.
jeresig authored
185 @@scp -r ${VER} jqadmin@jquerymobile.com:/srv/jquerymobile.com/htdocs/demos/
Something went wrong with that request. Please try again.