| 
														
															@@ -7,7 +7,7 @@ JTALK=$(readlink -f `dirname ${0}`/..) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 function usage { 
														 | 
														
														 | 
														
															 function usage { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	cat <<ENDOFHELP 
														 | 
														
														 | 
														
															 	cat <<ENDOFHELP 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-Usage: $0 [-N|D|E] [-K|C] [-o] [-O] [-m class] [-M file] 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+Usage: $0 [-N|D|E] [-K|C|J] [-o] [-O] [-m class] [-M file] 
														 | 
													
												
											
												
													
														| 
														 | 
														
															           [-i] [-I file] file1 [file2 ...] [Program] 
														 | 
														
														 | 
														
															           [-i] [-I file] file1 [file2 ...] [Program] 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															    Will compile Jtalk files - either separately or into a runnable complete 
														 | 
														
														 | 
														
															    Will compile Jtalk files - either separately or into a runnable complete 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -34,10 +34,13 @@ Usage: $0 [-N|D|E] [-K|C] [-o] [-O] [-m class] [-M file] 
														 | 
													
												
											
												
													
														| 
														 | 
														
															      is added last. 
														 | 
														
														 | 
														
															      is added last. 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															   -K 
														 | 
														
														 | 
														
															   -K 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-     Add libraries to get minimal JTalk Kernel running. 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+     Add libraries to get minimal Jtalk Kernel running. 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															   -C 
														 | 
														
														 | 
														
															   -C 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-     Add libraries to get minimal JTalk Compiler running. 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+     Add libraries to get minimal Jtalk Compiler running. 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+  -J 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+     Add libraries to get minimal Jtalk IDE running. 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															   -o 
														 | 
														
														 | 
														
															   -o 
														 | 
													
												
											
												
													
														| 
														 | 
														
															      Optimize each js file using the Google closure compiler. 
														 | 
														
														 | 
														
															      Optimize each js file using the Google closure compiler. 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -95,10 +98,11 @@ if [ -z $1 ] ; then 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 fi 
														 | 
														
														 | 
														
															 fi 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 # Define our predefined library combinations 
														 | 
														
														 | 
														
															 # Define our predefined library combinations 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-BOOT="$JTALK/js/boot.js" 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-KERNEL="$BOOT $JTALK/js/Kernel.js" 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-COMPILER="$KERNEL $JTALK/js/Parser.js $JTALK/js/Compiler.js" 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-KITCHENSINK="$COMPILER $JTALK/js/Canvas.js" 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+BOOT="boot.js" 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+KERNEL="$BOOT Kernel.js" 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+COMPILER="$KERNEL Parser.js Compiler.js" 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+CANVAS="$COMPILER Canvas.js" 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+IDE="$CANVAS JQuery.js IDE.js SUnit.js Examples.js" 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 # Predefined initializer 
														 | 
														
														 | 
														
															 # Predefined initializer 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 INITIALIZER="$JTALK/js/init.js" 
														 | 
														
														 | 
														
															 INITIALIZER="$JTALK/js/init.js" 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -113,7 +117,7 @@ LOAD= 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 LOADANDADD= 
														 | 
														
														 | 
														
															 LOADANDADD= 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 # Read options and shift them away 
														 | 
														
														 | 
														
															 # Read options and shift them away 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-while getopts "NDEKCoOl:L:i:IM:m:h?" o; do 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+while getopts "NDEKCJoOl:L:i:IM:m:h?" o; do 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 case "$o" in 
														 | 
														
														 | 
														
															 case "$o" in 
														 | 
													
												
											
												
													
														| 
														 | 
														
															    N) ENV=NODE 
														 | 
														
														 | 
														
															    N) ENV=NODE 
														 | 
													
												
											
												
													
														| 
														 | 
														
															       BASE=$KERNEL 
														 | 
														
														 | 
														
															       BASE=$KERNEL 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -121,11 +125,12 @@ case "$o" in 
														 | 
													
												
											
												
													
														| 
														 | 
														
															    D) ENV=D8 
														 | 
														
														 | 
														
															    D) ENV=D8 
														 | 
													
												
											
												
													
														| 
														 | 
														
															       BASE=$KERNEL 
														 | 
														
														 | 
														
															       BASE=$KERNEL 
														 | 
													
												
											
												
													
														| 
														 | 
														
															       INIT=$INITIALIZER;; 
														 | 
														
														 | 
														
															       INIT=$INITIALIZER;; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-   D) ENV=ENYO 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+   E) ENV=ENYO 
														 | 
													
												
											
												
													
														| 
														 | 
														
															       BASE=$KERNEL 
														 | 
														
														 | 
														
															       BASE=$KERNEL 
														 | 
													
												
											
												
													
														| 
														 | 
														
															       INIT=$INITIALIZER;; 
														 | 
														
														 | 
														
															       INIT=$INITIALIZER;; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															    K) BASE=$KERNEL;; 
														 | 
														
														 | 
														
															    K) BASE=$KERNEL;; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															    C) BASE=$COMPILER;; 
														 | 
														
														 | 
														
															    C) BASE=$COMPILER;; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+   J) BASE=$IDE;; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															    o) CLOSURE=true 
														 | 
														
														 | 
														
															    o) CLOSURE=true 
														 | 
													
												
											
												
													
														| 
														 | 
														
															       CLOSUREPARTS=true;; 
														 | 
														
														 | 
														
															       CLOSUREPARTS=true;; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															    O) CLOSURE=true 
														 | 
														
														 | 
														
															    O) CLOSURE=true 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -170,6 +175,13 @@ function resolvejs { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															   fi 
														 | 
														
														 | 
														
															   fi 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 } 
														 | 
														
														 | 
														
															 } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+# Resolve listed libraries in $BASE separated by spaces 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+for FILE in $BASE 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+do 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+   resolvejs $FILE 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+   TOBASE="$TOBASE $RESOLVED" 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+done 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 # Resolve listed libraries in $LOAD separated by spaces 
														 | 
														
														 | 
														
															 # Resolve listed libraries in $LOAD separated by spaces 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 LOAD=${LOAD//,/\ } 
														 | 
														
														 | 
														
															 LOAD=${LOAD//,/\ } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 for FILE in $LOAD 
														 | 
														
														 | 
														
															 for FILE in $LOAD 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -188,10 +200,17 @@ do 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 done 
														 | 
														
														 | 
														
															 done 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 # Define our Compiler loading supplied libraries 
														 | 
														
														 | 
														
															 # Define our Compiler loading supplied libraries 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-OURCOMPILER="$KITCHENSINK $TOLOAD $JTALK/js/init.js $JTALK/nodejs/nodecompile.js" 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+OURCOMPILER="$COMPILER $TOLOAD init.js $JTALK/nodejs/nodecompile.js" 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+# Resolve OURCOMPILER 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+for FILE in $OURCOMPILER 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+do 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+   resolvejs $FILE 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+   TOOURCOMPILER="$TOOURCOMPILER $RESOLVED" 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+done 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 # Add supplied libraries 
														 | 
														
														 | 
														
															 # Add supplied libraries 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-LIBS="$BASE $TOADD" 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+LIBS="$TOBASE $TOADD" 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 # Get a unique tempdir and make it get auto removed on exit 
														 | 
														
														 | 
														
															 # Get a unique tempdir and make it get auto removed on exit 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 TMPDIR=`mktemp -d` 
														 | 
														
														 | 
														
															 TMPDIR=`mktemp -d` 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -239,10 +258,10 @@ done 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 # -------------------------------------------------- 
														 | 
														
														 | 
														
															 # -------------------------------------------------- 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 # Create compiler dynamically 
														 | 
														
														 | 
														
															 # Create compiler dynamically 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-cat $OURCOMPILER > $TMPDIR/compiler.js 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															- 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+cat $TOOURCOMPILER > $TMPDIR/compiler.js 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 # Compile all collected .st files to .js 
														 | 
														
														 | 
														
															 # Compile all collected .st files to .js 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-echo "Loading libraries $KITCHENSINK $TOLOAD and compiling ..." 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+echo "Loading libraries $TOOURCOMPILER and compiling ..." 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 node $TMPDIR/compiler.js $COMPILE 
														 | 
														
														 | 
														
															 node $TMPDIR/compiler.js $COMPILE 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 # Verify all .js files corresponding to .st files were created, otherwise exit 
														 | 
														
														 | 
														
															 # Verify all .js files corresponding to .st files were created, otherwise exit 
														 |