Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

36 lines (24 sloc) 0.863 kb
SRC_DIR=src
BUILD_DIR=build
VERSION=$(shell cat VERSION)
SOURCE_FILE=${SRC_DIR}/jsoncache.js
OUTPUT_FILE=${BUILD_DIR}/jsoncache-${VERSION}.min.js
JSMIN=java -jar ~/programs/closure-compiler/compiler.jar
PHANTOMJS=phantomjs
all: clean minify set_version
minify: ${SOURCE_FILE}
@ echo "\nMinifying source file."
${JSMIN} --js ${SOURCE_FILE} --js_output_file ${OUTPUT_FILE}
set_version: minify
@ echo "\nSetting build version to ${VERSION}"
@ sed -i "s/#VERSION#/${VERSION}/g" ${OUTPUT_FILE}
test_dev:
@ echo "\n== Development tests =="
${PHANTOMJS} tests/run-jasmine.js file://$(shell pwd)/tests/development-jasmine.html
test_prod: all
@ echo "\n== Production tests =="
${PHANTOMJS} tests/run-jasmine.js file://$(shell pwd)/tests/production-jasmine.html
test: test_dev test_prod
clean:
@ echo "\nCleaning build directory."
rm -f ${BUILD_DIR}/*
Jump to Line
Something went wrong with that request. Please try again.