Created
October 13, 2011 21:43
-
-
Save pamelafox/1285624 to your computer and use it in GitHub Desktop.
Closure/YUI/JsHint 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
# Makefile for JS/CSS: | |
# Uses Closure for JS compiling, YUI for CSS compiling, and JsHint for code quality checking | |
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 | |
JSHINTURL = https://github.com/jshint/jshint/zipball/master | |
JSHINTDIR = $(BUILDDIR)/jshint | |
STATICDIR = ./application/static | |
downloadtools: | |
rm -Rf $(BUILDDIR); | |
mkdir $(BUILDDIR) $(CLOSUREDIR) $(YUIDIR) $(JSHINTDIR); | |
cd $(CLOSUREDIR); curl -L $(CLOSUREURL) > file.zip; tar -xf file.zip; | |
cd $(YUIDIR); curl -L $(YUIURL) > file.zip; tar -xf file.zip; | |
cd $(JSHINTDIR); curl -L $(JSHINTURL) > file.zip; tar -xf file.zip; cp -R jshint-*/* .; rm -rf jshint-*/; | |
clean: | |
rm -f $(STATICDIR)/js/libs.js \ | |
$(STATICDIR)/css/all-web.css \ | |
$(STATICDIR)/css/all-web-min.css; | |
jshint: | |
find $(STATICDIR)/js -name "*.js" -exec $(JSHINTDIR)/env/jsc.sh {} \; | |
cat: | |
cat \ | |
$(STATICDIR)/js/libs/jquery.calendrical.js \ | |
$(STATICDIR)/js/libs/jquery.autosuggest.js \ | |
> $(STATICDIR)/js/libs.js; | |
cat \ | |
$(STATICDIR)/css/autosuggest.css \ | |
$(STATICDIR)/css/calendrical.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 $(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) clean; | |
$(MAKE) jshint; | |
$(MAKE) cat; | |
$(MAKE) compress; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment