23541cd1a83cbb77dea59850625a9270e2dd1de5
[platform/framework/web/web-ui-fw.git] / libs / js / jquery-mobile-1.0.1pre / Makefile
1 # The files to include when compiling the JS files
2 JSFILES =         js/jquery.ui.widget.js \
3                           js/jquery.mobile.widget.js \
4                           js/jquery.mobile.media.js \
5                           js/jquery.mobile.support.js \
6                           js/jquery.mobile.vmouse.js \
7                           js/jquery.mobile.event.js \
8                           js/jquery.mobile.hashchange.js \
9                           js/jquery.mobile.page.js \
10                           js/jquery.mobile.core.js \
11                           js/jquery.mobile.navigation.js \
12                           js/jquery.mobile.navigation.pushstate.js \
13                           js/jquery.mobile.transition.js \
14                           js/jquery.mobile.degradeInputs.js \
15                           js/jquery.mobile.dialog.js \
16                           js/jquery.mobile.page.sections.js \
17                           js/jquery.mobile.collapsible.js \
18                           js/jquery.mobile.fieldContain.js \
19                           js/jquery.mobile.grid.js \
20                           js/jquery.mobile.navbar.js \
21                           js/jquery.mobile.listview.js \
22                           js/jquery.mobile.listview.filter.js \
23                           js/jquery.mobile.nojs.js \
24                           js/jquery.mobile.forms.checkboxradio.js \
25                           js/jquery.mobile.forms.button.js \
26                           js/jquery.mobile.forms.slider.js \
27                           js/jquery.mobile.forms.textinput.js \
28                           js/jquery.mobile.forms.select.custom.js \
29                           js/jquery.mobile.forms.select.js \
30                           js/jquery.mobile.buttonMarkup.js \
31                           js/jquery.mobile.controlGroup.js \
32                           js/jquery.mobile.links.js \
33                           js/jquery.mobile.fixHeaderFooter.js \
34                           js/jquery.mobile.fixHeaderFooter.native.js \
35                           js/jquery.mobile.init.js
36
37 # The files to include when compiling the CSS files
38 CSSFILES = css/structure/jquery.mobile.core.css \
39                           css/structure/jquery.mobile.transitions.css \
40                           css/structure/jquery.mobile.grids.css \
41                           css/structure/jquery.mobile.headerfooter.css \
42                           css/structure/jquery.mobile.navbar.css \
43                           css/structure/jquery.mobile.button.css \
44                           css/structure/jquery.mobile.collapsible.css \
45                           css/structure/jquery.mobile.controlgroup.css \
46                           css/structure/jquery.mobile.dialog.css \
47                           css/structure/jquery.mobile.forms.checkboxradio.css \
48                           css/structure/jquery.mobile.forms.fieldcontain.css \
49                           css/structure/jquery.mobile.forms.select.css \
50                           css/structure/jquery.mobile.forms.textinput.css \
51                           css/structure/jquery.mobile.listview.css \
52                           css/structure/jquery.mobile.forms.slider.css
53 CSSTHEMEFILES = css/themes/${THEME}/jquery.mobile.theme.css
54
55
56
57
58 # Helper Variables
59 # The command to replace the @VERSION in the files with the actual version
60 VER = sed "s/v@VERSION/$$(git log -1 --format=format:"Git Build: SHA1: %H <> Date: %cd")/"
61 VER_MIN = "/*! jQuery Mobile v${VER_OFFICIAL} jquerymobile.com | jquery.org/license */"
62 VER_OFFICIAL = $(shell cat version.txt)
63
64 # The output folder for the finished files
65 OUTPUT = compiled
66
67 # The name of the files
68 NAME = jquery.mobile
69 STRUCTURE = jquery.mobile.structure
70 deploy: NAME = jquery.mobile-${VER_OFFICIAL}
71 deploy: STRUCTURE = jquery.mobile.structure-${VER_OFFICIAL}
72
73 # The CSS theme being used
74 THEME = default
75
76
77
78
79
80 # Build Targets
81
82 # When no build target is specified, all gets ran
83 all: init css js zip notify
84
85
86 # Build and minify the CSS files
87 css: init
88         # Build the CSS file with the theme included
89         @@cat js/jquery.mobile.intro.js | ${VER} > ${OUTPUT}/${NAME}.css
90         @@cat ${CSSTHEMEFILES} ${CSSFILES} >> ${OUTPUT}/${NAME}.css
91         # ..... and then minify it
92         @@echo ${VER_MIN} > ${OUTPUT}/${NAME}.min.css
93         @@java -jar build/yuicompressor-2.4.6.jar --type css ${OUTPUT}/${NAME}.css >> ${OUTPUT}/${NAME}.min.css
94         # Build the CSS Structure-only file
95         @@cat js/jquery.mobile.intro.js | ${VER} > ${OUTPUT}/${STRUCTURE}.css
96         @@cat ${CSSFILES} >> ${OUTPUT}/${STRUCTURE}.css
97         # ..... and then minify it
98         @@echo ${VER_MIN} > ${OUTPUT}/${STRUCTURE}.min.css
99         @@java -jar build/yuicompressor-2.4.6.jar --type css ${OUTPUT}/${STRUCTURE}.css >> ${OUTPUT}/${STRUCTURE}.min.css
100         # ..... and then copy in the images
101         @@cp -R css/themes/${THEME}/images ${OUTPUT}/
102         # Css portion is complete.
103         # -------------------------------------------------
104
105
106 docs: init css js
107         # Create the Demos/Docs/Tests/Tools
108         @@mkdir -p tmp/${NAME}
109         @@cp -r index.html docs experiments external js/jquery.js tests tmp/${NAME}/
110         @@cp ${OUTPUT}/${NAME}.min.css ${OUTPUT}/${NAME}.min.js tmp/${NAME}/
111         # ... Update the JavaScript and CSS paths
112         @@find tmp/${NAME} -type f \
113                 \( -name '*.html' -o -name '*.php' \) \
114                 -exec perl -pi -e \
115                 's|js/"|${NAME}.min.js"|g;s|css/themes/default/|${NAME}.min.css|g;s|js/jquery.js"|jquery.js"|g' {} \;
116         # ... Move and zip up the the whole folder
117         @@zip -rq ${OUTPUT}/${NAME}.docs.zip tmp/${NAME}
118         @@mv tmp/${NAME} ${OUTPUT}/demos
119         # Finish by removing the temporary files
120         @@rm -rf tmp
121         # -------------------------------------------------
122
123
124 # Create the output directory. This is in a separate step so its not dependant on other targets
125 init:
126         # -------------------------------------------------
127         # Building jQuery Mobile in the "${OUTPUT}" folder
128         @@rm -rf ${OUTPUT}
129         @@rm -rf tmp
130         @@mkdir -p ${OUTPUT}
131         # -------------------------------------------------
132
133
134 # Build and minify the JS files
135 js: init
136         # Build the JavaScript file
137         @@cat js/jquery.mobile.intro.js | ${VER} > ${OUTPUT}/${NAME}.js
138         @@cat ${JSFILES} >> ${OUTPUT}/${NAME}.js
139         # ..... and then minify it
140         @@echo ${VER_MIN} > ${OUTPUT}/${NAME}.min.js
141         @@java -jar build/google-compiler-20111003.jar --js ${OUTPUT}/${NAME}.js --warning_level QUIET >> ${OUTPUT}/${NAME}.min.js
142         # -------------------------------------------------
143
144
145 # Output a message saying the process is complete
146 notify: init
147         @@echo "The files have been built and are in: " $$(pwd)/${OUTPUT}
148         # -------------------------------------------------
149
150
151 # Zip up the jQm files without docs
152 zip: init css js
153         # Packaging up the files into a zip archive
154         @@mkdir tmp
155         @@cp -r ${OUTPUT} tmp/${NAME} 
156         @@zip -rq ${OUTPUT}/${NAME}.zip tmp/${NAME}/
157         @@rm -rf tmp
158         # -------------------------------------------------
159         
160
161
162
163 # -------------------------------------------------
164 # -------------------------------------------------
165 # -------------------------------------------------
166 #
167 # For jQuery Team Use Only
168 #
169 # -------------------------------------------------
170
171 # Push the latest git version to the CDN. This is done on a post commit hook
172 latest: init js css zip
173         # Time to put these on the CDN
174         @@scp -qr ${OUTPUT}/* jqadmin@code.origin.jquery.com:/var/www/html/code.jquery.com/mobile/latest/
175         # Do some cleanup to wrap it up
176         @@rm -rf ${OUTPUT}
177         # -------------------------------------------------
178
179 # Build the nightly backups. This is done on a server cronjob
180 nightlies: init js css zip docs 
181         # Time to put these on the CDN
182         @@mkdir -p tmp/nightlies
183         @@mv ${OUTPUT} tmp/nightlies/$$(date "+%Y%m%d")
184         @@scp -qr tmp/nightlies/* jqadmin@code.origin.jquery.com:/var/www/html/code.jquery.com/mobile/nightlies/
185         # Do some cleanup to wrap it up
186         @@rm -rf tmp
187         # -------------------------------------------------
188
189
190 # Deploy a finished release. This is manually done.
191 deploy: init js css docs zip
192         # Deploying all the files to the CDN
193         @@mkdir tmp
194         @@cp -r ${OUTPUT} tmp/${VER_OFFICIAL}
195         @@scp -qr tmp/* jqadmin@code.origin.jquery.com:/var/www/html/code.jquery.com/mobile/
196         @@rm -rf tmp/${VER_OFFICIAL}
197         @@mv ${OUTPUT}/demos tmp/${VER_OFFICIAL}
198         # Create the Demos/Docs/Tests/Tools for jQueryMobile.com
199         # ... By first replacing the paths
200         @@find tmp/${VER_OFFICIAL} -type f \
201                 \( -name '*.html' -o -name '*.php' \) \
202                 -exec perl -pi -e \
203                 '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.6.4.js"|g' {} \;
204         # ... So they can be copied to jquerymobile.com
205         @@scp -qr tmp/* jqadmin@jquerymobile.com:/srv/jquerymobile.com/htdocs/demos/    
206         # Do some cleanup to wrap it up
207         @@rm -rf tmp
208         @@rm -rf ${OUTPUT}
209         # -------------------------------------------------
210
211