df009fd1 by Nathan Lighthart

Update run scripts

- Do not force java memory options -Xms and -Xmx (moved to comment)
- Separate class path into variables that allow easy change of the jar path and library path
- Add path separator detection to the shell script to detect the correct path separator for windows(";") and unix(":")
- Fix bashism "==" in shell script replacing with the standard shell script "="
1 parent 0e29d5f5
......@@ -45,9 +45,17 @@ if not exist "%sim%" (
goto sim_loop
)
rem Setup Java command options
set options=-Doms_prj=. -Xms512M -Xmx4G
set classpath="dist/AgES.jar;dist/lib"
rem Setup Java environment options
rem optional java memory parameters -Xms512M -Xmx4G
set options=-Doms_prj=.
rem Setup classpath
set jar=dist/AgES.jar
set lib=dist/lib
set path_separator=;
set classpath="%jar%%path_separator%%lib%"
rem Setup oms command line arguments
set args=-l OFF -r "%sim%"
rem Run the Java command
......
......@@ -8,7 +8,7 @@
# 1) Passed as first argument
# 2) Prompted as input value
name=""
if [ "$1" == "" ]; then
if [ "$1" = "" ]; then
read -p "Enter project name: " name
else
name=$1
......@@ -32,7 +32,7 @@ fi
# 1) Passed as second argument
# 2) Default to project name
sim_name=""
if [ "$2" == "" ]; then
if [ "$2" = "" ]; then
sim_name=$name.sim
else
sim_name=$2
......@@ -47,13 +47,45 @@ while [ ! -e "$sim" ]; do
done
# Setup Java command options
options="-Doms_prj=. -Xms512M -Xmx4G"
# note on windows machines the path separator is ; and on linux it is :
classpath="\"dist/AgES.jar:dist/lib\""
# optional java memory parameters -Xms512M -Xmx4G
options="-Doms_prj=."
# Setup classpath
jar="dist/AgES.jar"
lib="dist/lib"
# Find path separator
# unix-based machines use ":" while windows uses ";"
case "$(uname -s)" in
CYGWIN*|MINGW*|MSYS*)
# Windows through Cygwin, MinGW, or Msys
path_separator=";"
;;
Linux)
# Linux
path_separator=":"
;;
Darwin)
# Mac OS X
path_separator=":"
;;
*)
# other OS
path_separator=":"
;;
esac
# Finalize classpath
classpath="\"${jar}${path_separator}${lib}\""
# Setup oms command line arguments
args="-l OFF -r \"$sim\""
# Run the Java command
# command needs to be evaluated as there are syntatic quotes in $args
# command needs to be evaluated as there are syntatic quotes in $classpath and $args
command="java $options -cp $classpath oms3.CLI $args"
echo $command
eval $command
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!