Last change
on this file since 532 was
483,
checked in by hendrikvanantwerpen, 11 years ago
|
Added Dojo 1.9.3 release.
|
-
Property svn:executable set to
*
|
File size:
2.4 KB
|
Line | |
---|
1 | #!/bin/sh |
---|
2 | usage() { |
---|
3 | cat <<-__EOF__; |
---|
4 | NAME |
---|
5 | build.sh - a convenience wrapper around the Dojo Build Application |
---|
6 | |
---|
7 | SYNOPSIS |
---|
8 | path/to/build.sh [--help] [--bin environment] [build system options] |
---|
9 | |
---|
10 | DESCRIPTION |
---|
11 | build.sh is a shell script that wraps the Dojo Build Application located at /util/build/main.js |
---|
12 | to simplify executing the application in various, selectable, Javascript environments. Currently |
---|
13 | both node.js and Java are supported. |
---|
14 | |
---|
15 | OPTIONS |
---|
16 | --help print the help message |
---|
17 | |
---|
18 | --bin environment |
---|
19 | Specifies the Javascript environment to use. Defaults to node, if available, java otherwise. |
---|
20 | |
---|
21 | node use node.js, if available, automatic downgrade to java |
---|
22 | node-debug same as node, with the --debug argument |
---|
23 | node-debug-brk same as node with the --debug-brk argument |
---|
24 | java use java |
---|
25 | |
---|
26 | Note: the alternative syntax bin=option is supported but deprecated. |
---|
27 | |
---|
28 | __EOF__ |
---|
29 | } |
---|
30 | |
---|
31 | if [ "$#" = "0" ]; then |
---|
32 | usage |
---|
33 | fi |
---|
34 | |
---|
35 | while [ -n "$1" ] |
---|
36 | do |
---|
37 | arg="$1" |
---|
38 | case $arg in |
---|
39 | --help) |
---|
40 | usage |
---|
41 | ba="$ba $arg" |
---|
42 | ;; |
---|
43 | bin=node) |
---|
44 | use_node=0 |
---|
45 | ;; |
---|
46 | bin=node-debug) |
---|
47 | use_node=0 |
---|
48 | debug_node="--debug" |
---|
49 | ;; |
---|
50 | bin=node-debug-brk) |
---|
51 | use_node=0 |
---|
52 | debug_node="--debug-brk" |
---|
53 | ;; |
---|
54 | bin=java) |
---|
55 | use_node=1 |
---|
56 | ;; |
---|
57 | bin=*) |
---|
58 | echo "Invalid bin= option: only node/java is supported" |
---|
59 | exit 1 |
---|
60 | ;; |
---|
61 | *) |
---|
62 | if [ "$arg" = "--bin" ]; then |
---|
63 | case $2 in |
---|
64 | node) |
---|
65 | use_node=0 |
---|
66 | ;; |
---|
67 | node-debug) |
---|
68 | use_node=0 |
---|
69 | debug_node="--debug" |
---|
70 | ;; |
---|
71 | node-debug-brk) |
---|
72 | use_node=0 |
---|
73 | debug_node="--debug-brk" |
---|
74 | ;; |
---|
75 | java) |
---|
76 | use_node=1 |
---|
77 | ;; |
---|
78 | *) |
---|
79 | echo "Invalid --bin option: only node/java is supported" |
---|
80 | exit 1 |
---|
81 | ;; |
---|
82 | esac |
---|
83 | shift |
---|
84 | else |
---|
85 | ba="$ba $arg" |
---|
86 | fi |
---|
87 | ;; |
---|
88 | esac |
---|
89 | shift |
---|
90 | done |
---|
91 | |
---|
92 | if [ -z "$use_node" ]; then |
---|
93 | which node > /dev/null 2>&1 |
---|
94 | use_node=$? |
---|
95 | fi |
---|
96 | |
---|
97 | if [ "$use_node" = "0" ]; then |
---|
98 | cmd="node $debug_node" |
---|
99 | cmdflags="`dirname $0`/../../dojo/dojo.js" |
---|
100 | else |
---|
101 | cmd="java" |
---|
102 | cmdflags="-Xms256m -Xmx256m -cp `dirname $0`/../shrinksafe/js.jar:`dirname $0`/../closureCompiler/compiler.jar:`dirname $0`/../shrinksafe/shrinksafe.jar org.mozilla.javascript.tools.shell.Main `dirname $0`/../../dojo/dojo.js baseUrl=`dirname $0`/../../dojo" |
---|
103 | fi |
---|
104 | |
---|
105 | $cmd $cmdflags load=build $ba |
---|
Note: See
TracBrowser
for help on using the repository browser.