forked from kpuputti/JSONCache
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
35 lines (24 loc) · 863 Bytes
/
Copy pathMakefile
File metadata and controls
35 lines (24 loc) · 863 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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}/*