-
Notifications
You must be signed in to change notification settings - Fork 5
/
build
executable file
·52 lines (38 loc) · 1.05 KB
/
build
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
#!/bin/bash
appname="amdlite"
testpath="../amdjs-tests"
ccjarpath="../closure-compiler/compiler.jar"
status=""
# closure compiler
minify() {
echo -e "\n================ minifying ================\n"
status="Minify failed."
java -jar "$ccjarpath" "$appname.js" \
--warning_level VERBOSE --summary_detail_level 3 \
--compilation_level ADVANCED_OPTIMIZATIONS > "$appname.min.js"
}
# jshint
lint() {
echo -e "\n================ linting ================\n"
status="Lint failed."
jshint --show-non-errors "$appname.js"
}
# amdjs-tests
test() {
echo -e "\n================ testing ================\n"
status="Test failed."
node "$testpath/server/server.js" &
pid=$!
node "$testpath/server/server_wait.js"
node "test/client.js" "$appname"
kill $pid
}
pass() {
echo -e "\n================ SUCCESS ================\n"
echo -e "Build complete.\n"
}
fail() {
echo -e "\n================ FAILURE ================\n"
echo -e "$status\n"
}
minify && lint && test && pass || fail