Created
September 28, 2011 18:04
-
-
Save pamelafox/1248696 to your computer and use it in GitHub Desktop.
My phonegap/web/gae makefile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Javascript/CSS Compressor Makefile - By Benjamin "balupton" Lupton (MIT Licenced) | |
MAKEFLAGS = --no-print-directory --always-make | |
MAKE = make $(MAKEFLAGS) | |
BUILDDIR = ./.build | |
CLOSUREURL = http://closure-compiler.googlecode.com/files/compiler-latest.zip | |
CLOSUREDIR = $(BUILDDIR)/closure | |
CLOSUREFILE = $(CLOSUREDIR)/compiler.jar | |
YUIURL = http://yui.zenfs.com/releases/yuicompressor/yuicompressor-2.4.6.zip | |
YUIDIR = $(BUILDDIR)/yui | |
YUIFILE = $(YUIDIR)/yuicompressor-2.4.6/build/yuicompressor-2.4.6.jar | |
GAEDIR = /usr/local/bin/ | |
STATICDIR = ./application/static | |
MOBILEDIR = ./mobile | |
ANDROIDDIR = ./android/assets/www | |
jshint: | |
jshint ./static/js/script.js; | |
pystyle: | |
pep8 local_apps/* --filename=*.py | |
pep8 *.py | |
pack: | |
cat \ | |
$(STATICDIR)/js/libs/jquery.tmpl.js \ | |
$(STATICDIR)/js/libs/jquery.calendrical.js \ | |
$(STATICDIR)/js/libs/jquery.autosuggest.js \ | |
$(STATICDIR)/js/libs/jquery.colorslider.js \ | |
$(STATICDIR)/js/libs/jquery.tooltip.js \ | |
$(STATICDIR)/js/libs/jquery.tablesorter.js \ | |
$(STATICDIR)/js/libs/jquery.sparkline.js \ | |
$(STATICDIR)/js/libs/jquery.tagfield.js \ | |
$(STATICDIR)/js/libs/jquery.fancybox.js \ | |
$(STATICDIR)/js/libs/lscache.js \ | |
$(STATICDIR)/js/libs/highcharts.js \ | |
$(STATICDIR)/js/libs/date.format.js \ | |
$(STATICDIR)/js/libs/humane.js \ | |
> $(STATICDIR)/js/libs.js; | |
cat \ | |
$(STATICDIR)/js/data.js \ | |
$(STATICDIR)/js/common.js \ | |
$(STATICDIR)/js/pages.js \ | |
> $(STATICDIR)/js/custom.js; | |
cat \ | |
$(STATICDIR)/js/libs/phonegap.js \ | |
$(STATICDIR)/js/libs/facebook.js \ | |
$(STATICDIR)/js/data.js \ | |
$(STATICDIR)/js/common.js \ | |
$(STATICDIR)/js/libs/date.format.js \ | |
$(STATICDIR)/js/libs/jquery.tmpl.js \ | |
$(STATICDIR)/js/libs/jquery.colorslider.js \ | |
$(STATICDIR)/js/libs/jquery.cursorend.js \ | |
$(STATICDIR)/js/libs/jquery.dateinput.min.js \ | |
$(STATICDIR)/js/libs/lscache.js \ | |
> $(STATICDIR)/js/all-phonegap.js; | |
cat \ | |
$(STATICDIR)/css/normalize.css \ | |
$(STATICDIR)/css/autosuggest.css \ | |
$(STATICDIR)/css/calendrical.css \ | |
$(STATICDIR)/css/colorslider.css \ | |
$(STATICDIR)/css/tooltip.css \ | |
$(STATICDIR)/css/tablesorter.css \ | |
$(STATICDIR)/css/tagfield.css \ | |
$(STATICDIR)/css/fancybox.css \ | |
$(STATICDIR)/css/bootstrap-1.2.0.min.css \ | |
$(STATICDIR)/css/web.css \ | |
> $(STATICDIR)/css/all-web.css; | |
compress: | |
java -jar $(CLOSUREFILE) --js_output_file=$(STATICDIR)/js/libs-min.js --js=$(STATICDIR)/js/libs.js; | |
sed -i '' "s/libs-min\.js?v=[0-9]*/libs-min\.js\?v=`date +%m%d%H%M`/" ./application/templates/base.html; | |
java -jar $(CLOSUREFILE) --js_output_file=$(STATICDIR)/js/custom-min.js --js=$(STATICDIR)/js/custom.js; | |
sed -i '' "s/custom-min\.js?v=[0-9]*/custom-min\.js\?v=`date +%m%d%H%M`/" ./application/templates/base.html; | |
java -jar $(YUIFILE) $(STATICDIR)/css/all-web.css -o $(STATICDIR)/css/all-web-min.css; | |
sed -i '' "s/all-web-min\.css?v=[0-9]*/all-web-min\.css\?v=`date +%m%d%H%M`/" ./application/templates/base.html; | |
jscss: | |
$(MAKE) pack; | |
$(MAKE) compress; | |
deploy: | |
/usr/local/bin/appcfg.py update .; | |
all: | |
$(MAKE) jscss; | |
$(MAKE) deploy; | |
androidfiles: | |
$(MAKE) jscss; | |
cp $(STATICDIR)/img/facebookbg.png $(ANDROIDDIR)/img/facebookbg.png; | |
cp $(STATICDIR)/img/sliderbg.png $(ANDROIDDIR)/img/sliderbg.png; | |
cp $(STATICDIR)/img/calendar.png $(ANDROIDDIR)/img/calendar.png; | |
cp $(STATICDIR)/img/headerlogo_trans.png $(ANDROIDDIR)/img/headerlogo_trans.png; | |
cp $(STATICDIR)/img/date_prev.gif $(ANDROIDDIR)/img/date_prev.gif; | |
cp $(STATICDIR)/img/date_next.gif $(ANDROIDDIR)/img/date_next.gif; | |
cp $(STATICDIR)/js/libs/jquery-1.6.2.min.js $(ANDROIDDIR)/js/libs/jquery-1.6.2.min.js; | |
cp $(STATICDIR)/js/all-phonegap.js $(ANDROIDDIR)/js/all-phonegap.js; | |
cp $(STATICDIR)/css/colorslider.css $(ANDROIDDIR)/css/colorslider.css; | |
cp $(STATICDIR)/css/dateinput.css $(ANDROIDDIR)/css/dateinput.css; | |
cp $(STATICDIR)/css/bootstrap-1.2.0.min.css $(ANDROIDDIR)/css/bootstrap-1.2.0.min.css | |
cp $(STATICDIR)/css/all-phonegap.css $(ANDROIDDIR)/css/all-phonegap.css; | |
androidindex: | |
python android_index.py > $(ANDROIDDIR)/index.html | |
androidall: | |
$(MAKE) androidfiles; | |
$(MAKE) androidindex; | |
androidapk: | |
cp ./android/bin/android.apk $(STATICDIR)/android.apk | |
cp $(ANDROIDDIR)/js/android.js $(STATICDIR)/android.js | |
downloadtools: | |
$(MAKE) clean; | |
mkdir $(BUILDDIR) $(CLOSUREDIR) $(YUIDIR); | |
cd $(CLOSUREDIR); curl -L $(CLOSUREURL) > file.zip; tar -xf file.zip; | |
cd $(YUIDIR); curl -L $(YUIURL) > file.zip; tar -xf file.zip; | |
runserver: | |
sudo /usr/local/bin/dev_appserver.py . --port=80 -a 0.0.0.0 | |
downloadlogs: | |
/usr/local/bin/appcfg.py request_logs . logs.txt | |
downloaderrors: | |
/usr/local/bin/appcfg.py request_logs --severity=3 . errors.txt | |
clean: | |
rm -Rf $(BUILDDIR); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment