-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathbuild.sh
executable file
·96 lines (71 loc) · 3.73 KB
/
build.sh
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
#!/bin/sh
# The location of your yuidoc install
yuidoc_bin=$1
#Location of project
project=$2
#Location of Google Clojure Compiler (https://github.com/google/closure-compiler)
googleClojure=$3
#Location of Node.js
nodejs=$4
#Location of Rhino (js.jar) (http://www.mozilla.org/rhino/)
rhino=$5
# The location of the files to parse. Parses subdirectories, but will fail if
# there are duplicate file names in these directories. You can specify multiple
# source trees:
parser_in=$project/src/js
# The location to output the parser data. This output is a file containing a
# json string, and copies of the parsed files.
parser_out=$project/API/parser
# The directory to put the html file outputted by the generator
generator_out=$project/API/generator
# The version of your project to display within the documentation.
version=0.5.6
# The version of YUI the project is using. This effects the output for
# YUI configuration attributes. This should start with '2' or '3'.
yuiversion=3
projecturl=http://www.kickjs.org/
projectname="KickJS"
#####
echo "Clean"
rm -rf $parser_out
rm -rf $generator_out
##############################################################################
echo "Include GLSL files as constants"
$nodejs $project/dependencies/build/include_glsl_files $project/src/glsl/ $project/src/js/kick/material/glslconstants.js
echo $nodejs $project/dependencies/build/include_glsl_files $project/src/glsl/ $project/src/js/kick/material/glslconstants.js
##############################################################################
echo "Running Precompiler dev"
mkdir $project/build
rm -rf $project/build/pre
mkdir $project/build/pre
echo $nodejs $project/dependencies/build/preprocessor $project/src/js $project/build/pre true true
$nodejs $project/dependencies/build/preprocessor $project/src/js $project/build/pre true true
echo "Package AMD and compress (debug)"
echo java -classpath $rhino:$googleClojure org.mozilla.javascript.tools.shell.Main -opt -1 $project/dependencies/build/r.js -o name=kick out=$project/build/kick-debug.js.tmp baseUrl=$project/build/pre optimize=none
java -classpath $rhino:$googleClojure org.mozilla.javascript.tools.shell.Main -opt -1 $project/dependencies/build/r.js -o name=kick out=$project/build/kick-debug.js.tmp baseUrl=$project/build/pre optimize=none
##############################################################################
echo "Generating documentation (YUI Doc)"
# Install (when running NodeJS using sudo npm -g i yuidocjs
# Unix specific and specific for (!!!)
export PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:$PATH
cd $parser_in
echo $yuidoc_bin $parser_in -o $generator_out
$yuidoc_bin -c $project/yuidoc.json . -o $generator_out
cp -R $project/API/images $generator_out
##############################################################################
echo "Running Precompiler release"
mkdir $project/build
rm -rf $project/build/pre
mkdir $project/build/pre
echo "$nodejs $project/dependencies/build/preprocessor $project/src/js $project/build/pre false false"
$nodejs $project/dependencies/build/preprocessor $project/src/js $project/build/pre false false
echo "Package AMD and compress (release)"
java -classpath $rhino:$googleClojure org.mozilla.javascript.tools.shell.Main -opt -1 $project/dependencies/build/r.js -o name=kick out=$project/build/kick.js.tmp baseUrl=$project/build/pre
##############################################################################
echo "Adding license info compiler"
cat "$project/dependencies/build/license_min.txt" "$project/build/kick-debug.js.tmp" > "$project/build/kick-debug.js"
cat "$project/dependencies/build/license_min.txt" "$project/build/kick.js.tmp" > "$project/build/kick.js"
rm "$project/build/kick-debug.js.tmp"
rm "$project/build/kick.js.tmp"
echo "Build finished"
date