forked from processing-js/processing-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
104 lines (76 loc) · 3.88 KB
/
Makefile
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# Make sure $JSSHELL points to your js shell binary in .profile or .bashrc
TOOLSDIR=./tools
# Rule for making pure JS code from a .pde (runs through parser + beautify)
%.js : %.pde
${TOOLSDIR}/pde2js.py ${JSSHELL} $?
all: release
create-release: clean
mkdir ./release
# Version number used in naming release files.
VERSION ?= $(error Specify a version for your release (e.g., VERSION=0.5))
release: release-files zipped
release-files: pjs yui example release-docs
zipped: release-files
gzip -c ./release/processing-${VERSION}.min.js > ./release/processing-${VERSION}.min.js.gz
find ./release -print | zip -j ./release/processing.js-${VERSION}.zip -@
release-docs: create-release
cp AUTHORS ./release
cat README | sed -e 's/@VERSION@/${VERSION}/' > ./release/README
cp LICENSE ./release
cp CHANGELOG ./release
example: create-release pjs
echo "<script src=\"processing-${VERSION}.js\"></script>" > ./release/example.html
echo "<canvas datasrc=\"example.pjs\" width=\"200\" height=\"200\"></canvas>" >> ./release/example.html
cp example.pjs ./release
pretty: create-release
${TOOLSDIR}/jsbeautify.py ${JSSHELL} processing.js > ./release/processing-${VERSION}.js.tmp
# check for any parsing errors in pretty version of processing.js
${JSSHELL} -f ${TOOLSDIR}/fake-dom.js -f ./release/processing-${VERSION}.js.tmp
cat ./release/processing-${VERSION}.js.tmp | sed -e 's/@VERSION@/${VERSION}/' > ./release/processing-${VERSION}.js
rm -f ./release/processing-${VERSION}.js.tmp
pjs: create-release
cp processing.js ./release/processing-${VERSION}.js.tmp
# check for any parsing errors in processing.js
${JSSHELL} -f ${TOOLSDIR}/fake-dom.js -f ./release/processing-${VERSION}.js.tmp
cat ./release/processing-${VERSION}.js.tmp | sed -e 's/@VERSION@/${VERSION}/' > ./release/processing-${VERSION}.js
rm -f ./release/processing-${VERSION}.js.tmp
packed: create-release
${TOOLSDIR}/packer.py ${JSSHELL} processing.js > ./release/processing-${VERSION}.packed.js
# check for any parsing errors in packed version of processing.js
${JSSHELL} -f ${TOOLSDIR}/fake-dom.js -f ./release/processing-${VERSION}.packed.js
minified: create-release
${TOOLSDIR}/minifier.py ${JSSHELL} processing.js > ./release/processing-${VERSION}.jsmin.js
# check for any parsing errors in minified version of processing.js
${JSSHELL} -f ${TOOLSDIR}/fake-dom.js -f ./release/processing-${VERSION}.jsmin.js
yui: create-release
java -jar ${TOOLSDIR}/yui/yuicompressor-2.4.2.jar --nomunge processing.js -o ./release/processing-${VERSION}.min.js
# check for any parsing errors in compiled version of processing.js
${JSSHELL} -f ${TOOLSDIR}/fake-dom.js -f ./release/processing-${VERSION}.min.js
check: check-globals
${TOOLSDIR}/runtests.py ${JSSHELL}
check-release: yui
${TOOLSDIR}/runtests.py ${JSSHELL} -l ./release/processing-${VERSION}.min.js
check-summary:
${TOOLSDIR}/runtests.py -s ${JSSHELL}
check-lint:
${TOOLSDIR}/jslint.py ${JSSHELL} processing.js
check-parser:
${TOOLSDIR}/runtests.py -p ${JSSHELL}
check-unit:
${TOOLSDIR}/runtests.py -u ${JSSHELL}
# If you want to test just one file or dir, use |make check-one TEST=<file or dir>|
TEST ?= $(error Specify a test filename/dir in TEST when using check-test)
# Most targets use commands that need a js shell path specified
JSSHELL ?= $(error Specify a valid path to a js shell binary in ~/.profile: export JSSHELL=C:\path\js.exe or /path/js)
check-one:
${TOOLSDIR}/runtests.py ${JSSHELL} -t ${TEST}
add-coverage: create-release
cat processing.js | ${JSSHELL} -f ${TOOLSDIR}/jscoverage.js > ./release/processing-cv.js
check-coverage: add-coverage
${TOOLSDIR}/runtests.py ${JSSHELL} -l ./release/processing-cv.js -c ./release/codecoverage.txt
check-globals:
${JSSHELL} -f ${TOOLSDIR}/fake-dom.js -f ${TOOLSDIR}/jsglobals.js -e "findDifference()" < processing.js
print-globals:
${JSSHELL} -f ${TOOLSDIR}/fake-dom.js -f ${TOOLSDIR}/jsglobals.js -e "printNames()" < processing.js
clean:
rm -fr ./release