2010-02-07 06:25:44 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
2010-02-08 00:15:50 +01:00
|
|
|
##########################################################
|
|
|
|
# Gridworks Control System #
|
|
|
|
##########################################################
|
|
|
|
|
2010-03-30 23:24:04 +02:00
|
|
|
# -------------- functions ------------------------------------
|
|
|
|
|
2010-02-09 21:21:10 +01:00
|
|
|
fail () {
|
|
|
|
cat <<EOF
|
2010-02-07 06:25:44 +01:00
|
|
|
ERROR: $1
|
2010-02-09 21:21:10 +01:00
|
|
|
Type '$0 -h' for usage information.
|
2010-02-07 06:25:44 +01:00
|
|
|
EOF
|
2010-02-09 21:21:10 +01:00
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
error() {
|
|
|
|
echo "$1"
|
2010-02-08 00:15:50 +01:00
|
|
|
exit 1
|
2010-02-07 06:25:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
usage() {
|
2010-02-08 00:15:50 +01:00
|
|
|
cat <<EOF
|
2010-02-07 06:25:44 +01:00
|
|
|
Usage: $0 [options] <action>
|
|
|
|
where [options] include:
|
|
|
|
|
|
|
|
-h print this message and exit
|
|
|
|
|
2010-02-07 06:32:07 +01:00
|
|
|
-p <port> the port that gridworks will listen to
|
2010-02-07 06:25:44 +01:00
|
|
|
default: 3333
|
|
|
|
|
2010-02-08 00:15:50 +01:00
|
|
|
-i <interface> the host interface gridworks should bind to
|
|
|
|
default: 127.0.0.1
|
|
|
|
|
|
|
|
-w <path> path to the webapp
|
|
|
|
default: src/main/webapp
|
2010-03-03 03:53:07 +01:00
|
|
|
|
|
|
|
-d <path> path to the data directory
|
|
|
|
default: OS dependent
|
2010-03-30 23:24:04 +02:00
|
|
|
|
|
|
|
-m <memory> max memory heap size to use
|
|
|
|
default: 1024M
|
2010-03-03 03:53:07 +01:00
|
|
|
|
|
|
|
--debug enable JVM debugging (on port 8000)
|
2010-02-08 00:15:50 +01:00
|
|
|
|
2010-03-30 23:24:04 +02:00
|
|
|
--jmx enable JMX monitoring (for jconsole and jvisualvm)
|
2010-02-07 06:25:44 +01:00
|
|
|
|
|
|
|
and <action> is one of
|
|
|
|
|
2010-02-09 21:21:10 +01:00
|
|
|
build ..................... Build Gridworks
|
|
|
|
run ....................... Run Gridworks
|
2010-03-09 09:08:35 +01:00
|
|
|
|
|
|
|
test ...................... Test Gridworks
|
2010-02-09 21:21:10 +01:00
|
|
|
|
|
|
|
make_dmg <version> ........ Make MacOSX DMG distribution
|
2010-02-10 08:30:16 +01:00
|
|
|
make_exe <version> ........ Make Windows EXE distribution
|
2010-03-30 23:24:04 +02:00
|
|
|
make_cli <version> ........ Make distributions to be run at command line
|
|
|
|
|
|
|
|
dist <version> ............ Make all distributions
|
2010-03-04 09:46:33 +01:00
|
|
|
|
2010-02-09 21:21:10 +01:00
|
|
|
clean ..................... Clean compiled classes
|
|
|
|
distclean ................. Remove all generated files
|
2010-02-08 00:15:50 +01:00
|
|
|
|
2010-02-07 06:25:44 +01:00
|
|
|
EOF
|
2010-02-09 21:21:10 +01:00
|
|
|
exit 1
|
2010-02-07 06:25:44 +01:00
|
|
|
}
|
2010-03-30 23:24:04 +02:00
|
|
|
|
2010-02-08 00:15:50 +01:00
|
|
|
add_option() {
|
|
|
|
OPTS="$OPTS $1"
|
2010-02-07 06:25:44 +01:00
|
|
|
}
|
2010-03-30 23:24:04 +02:00
|
|
|
|
|
|
|
load_configs() {
|
|
|
|
cat $1 | egrep "^[A-Z]" | sed 's/^\(.*\)$/export \1/' > .$1
|
|
|
|
. ./.$1
|
|
|
|
rm ./.$1
|
|
|
|
}
|
|
|
|
|
2010-02-09 21:21:10 +01:00
|
|
|
check_macosx() {
|
|
|
|
if [ "$SYSTEM" != 'Darwin' ] ; then
|
|
|
|
error "This action can only run on MacOSX"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
ant_prepare() {
|
2010-02-08 00:15:50 +01:00
|
|
|
if [ ! -d $GRIDWORKS_BUILD_DIR ] ; then
|
|
|
|
mkdir $GRIDWORKS_BUILD_DIR || exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
ANT=`which ant`
|
|
|
|
if [ "$ANT" = "" ] ; then
|
2010-03-04 09:46:33 +01:00
|
|
|
cd thirdparty
|
|
|
|
ANT_TAR=`ls | grep apache-ant | grep tar.gz | grep -v svn`
|
2010-02-10 08:30:16 +01:00
|
|
|
ANT_DIR=`echo $ANT_TAR | sed 's/.tar.gz//'`
|
2010-02-08 00:15:50 +01:00
|
|
|
if [ ! -d $ANT_DIR ] ; then
|
2010-03-04 09:46:33 +01:00
|
|
|
tar xzf $ANT_TAR -C . || exit 1
|
2010-02-08 00:15:50 +01:00
|
|
|
fi
|
2010-03-04 09:46:33 +01:00
|
|
|
ANT="`pwd`/$ANT_DIR/bin/ant"
|
|
|
|
cd ..
|
2010-02-08 00:15:50 +01:00
|
|
|
fi
|
2010-02-09 21:21:10 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
ant() {
|
2010-03-03 03:53:07 +01:00
|
|
|
ant_prepare
|
2010-03-30 23:24:04 +02:00
|
|
|
$ANT -f build.xml -Dbuild.dir="$GRIDWORKS_BUILD_DIR" -Ddist.dir="$GRIDWORKS_DIST_DIR" -Dversion="$VERSION" -Dnum_version="$NUM_VERSION" -Drevision="$REVISION" $1 || exit 1
|
2010-02-09 21:21:10 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
dist_prepare() {
|
|
|
|
if [ ! -d $GRIDWORKS_DIST_DIR ] ; then
|
|
|
|
mkdir $GRIDWORKS_DIST_DIR || exit 1
|
|
|
|
fi
|
|
|
|
}
|
2010-02-10 08:30:16 +01:00
|
|
|
|
|
|
|
launch4j_prepare() {
|
2010-03-04 09:46:33 +01:00
|
|
|
cd thirdparty
|
|
|
|
LAUNCH4J_TAR=`ls | grep launch4j | grep tar.gz | grep -v svn`
|
2010-03-09 21:16:04 +01:00
|
|
|
LAUNCH4J_DIR="launch4j"
|
2010-02-10 08:30:16 +01:00
|
|
|
if [ ! -d "$LAUNCH4J_DIR" ] ; then
|
|
|
|
tar xzf $LAUNCH4J_TAR -C thirdparty || exit 1
|
|
|
|
fi
|
2010-03-04 09:46:33 +01:00
|
|
|
cd ..
|
|
|
|
}
|
|
|
|
|
2010-02-25 00:52:20 +01:00
|
|
|
get_version() {
|
2010-02-10 08:30:16 +01:00
|
|
|
VERSION=$1
|
|
|
|
|
|
|
|
if [ "$VERSION" == "" ] ; then
|
|
|
|
fail "Must specify a version number"
|
|
|
|
fi
|
|
|
|
|
2010-03-03 03:53:07 +01:00
|
|
|
NUM_VERSION=`echo $VERSION | sed 's/[a-zA-Z]//g'`
|
2010-02-25 00:52:20 +01:00
|
|
|
}
|
2010-03-17 23:30:16 +01:00
|
|
|
|
2010-03-30 23:24:04 +02:00
|
|
|
get_revision() {
|
|
|
|
if [ -d ".svn" ]; then
|
|
|
|
INFO=`svn info`
|
|
|
|
elif [ -d ".git" ]; then
|
|
|
|
INFO=`git svn info`
|
|
|
|
else
|
|
|
|
error "cannot obtain revision, exiting!"
|
|
|
|
fi
|
|
|
|
|
|
|
|
REVISION=`echo $INFO | sed 's/.*Revision: /r/' | sed 's/ .*//'`
|
|
|
|
}
|
|
|
|
|
|
|
|
dist() {
|
2010-03-17 23:30:16 +01:00
|
|
|
make_dmg $1
|
|
|
|
make_exe $1
|
|
|
|
make_cli $1
|
|
|
|
}
|
|
|
|
|
2010-02-25 00:52:20 +01:00
|
|
|
make_exe() {
|
|
|
|
check_macosx
|
|
|
|
dist_prepare
|
|
|
|
launch4j_prepare
|
|
|
|
get_version $1
|
2010-03-30 23:24:04 +02:00
|
|
|
get_revision
|
2010-02-25 00:52:20 +01:00
|
|
|
|
2010-02-10 08:30:16 +01:00
|
|
|
ant exe
|
2010-03-30 23:24:04 +02:00
|
|
|
|
|
|
|
echo ""
|
|
|
|
echo "Built exe ZIP for version $VERSION-$REVISION"
|
2010-02-10 08:30:16 +01:00
|
|
|
}
|
2010-03-17 23:30:16 +01:00
|
|
|
|
|
|
|
make_cli() {
|
|
|
|
dist_prepare
|
|
|
|
get_version $1
|
2010-03-30 23:24:04 +02:00
|
|
|
get_revision
|
2010-03-17 23:30:16 +01:00
|
|
|
|
|
|
|
ant cli
|
2010-03-30 23:24:04 +02:00
|
|
|
|
|
|
|
echo ""
|
|
|
|
echo "Built cli ZIP for version $VERSION-$REVISION"
|
2010-03-17 23:30:16 +01:00
|
|
|
}
|
2010-02-10 08:30:16 +01:00
|
|
|
|
2010-02-09 21:21:10 +01:00
|
|
|
make_dmg() {
|
|
|
|
check_macosx
|
|
|
|
dist_prepare
|
2010-02-25 00:52:20 +01:00
|
|
|
get_version $1
|
2010-03-30 23:24:04 +02:00
|
|
|
get_revision
|
2010-02-09 21:21:10 +01:00
|
|
|
|
|
|
|
ant bundle
|
|
|
|
|
|
|
|
mkdir "$GRIDWORKS_BUILD_DIR/bundle/.background"
|
|
|
|
cp src/graphics/dmg_background/dmg_background.png "$GRIDWORKS_BUILD_DIR/bundle/.background/dmg_background.png"
|
|
|
|
|
|
|
|
SIZE=30
|
|
|
|
|
|
|
|
TITLE="Gridworks $VERSION"
|
|
|
|
echo "Building MacOSX DMG for $TITLE"
|
|
|
|
hdiutil create -srcfolder "$GRIDWORKS_BUILD_DIR/bundle" -volname "$TITLE" -fs HFS+ -fsargs "-c c=64,a=16,e=16" -format UDRW -size ${SIZE}m "$GRIDWORKS_BUILD_DIR/temp_gridworks.dmg"
|
|
|
|
DEVICE=$(hdiutil attach -readwrite -noverify -noautoopen "$GRIDWORKS_BUILD_DIR/temp_gridworks.dmg" | egrep '^/dev/' | sed 1q | awk '{print $1}')
|
|
|
|
hdiutil attach "$GRIDWORKS_BUILD_DIR/temp_gridworks.dmg"
|
2010-02-08 00:15:50 +01:00
|
|
|
|
2010-02-09 21:21:10 +01:00
|
|
|
echo '
|
|
|
|
tell application "Finder"
|
|
|
|
tell disk "'$TITLE'"
|
|
|
|
open
|
|
|
|
set current view of container window to icon view
|
|
|
|
set toolbar visible of container window to false
|
|
|
|
set statusbar visible of container window to false
|
2010-02-25 00:28:24 +01:00
|
|
|
set the bounds of container window to {200, 100, 760, 460}
|
2010-02-09 21:21:10 +01:00
|
|
|
set theViewOptions to the icon view options of container window
|
|
|
|
set arrangement of theViewOptions to not arranged
|
|
|
|
set icon size of theViewOptions to 100
|
|
|
|
set background picture of theViewOptions to file ".background:'dmg_background.png'"
|
|
|
|
make new alias file at container window to POSIX file "/Applications" with properties {name:"Applications"}
|
2010-02-25 00:28:24 +01:00
|
|
|
set position of item "'Gridworks'" of container window to {170, 175}
|
|
|
|
set position of item "Applications" of container window to {380, 175}
|
2010-02-09 21:21:10 +01:00
|
|
|
close
|
|
|
|
open
|
|
|
|
update without registering applications
|
|
|
|
delay 2
|
|
|
|
eject
|
|
|
|
end tell
|
|
|
|
end tell
|
|
|
|
' | osascript
|
|
|
|
|
|
|
|
chmod -Rf go-w /Volumes/Gridworks
|
|
|
|
sync
|
|
|
|
sync
|
|
|
|
hdiutil detach $DEVICE
|
|
|
|
hdiutil convert "$GRIDWORKS_BUILD_DIR/temp_gridworks.dmg" -format UDZO -imagekey zlib-level=9 -o "$GRIDWORKS_DIST_DIR/gridworks-$VERSION.dmg"
|
2010-03-30 23:24:04 +02:00
|
|
|
hdiutil internet-enable -yes "$GRIDWORKS_DIST_DIR/gridworks-$VERSION-$REVISION.dmg"
|
2010-02-09 21:21:10 +01:00
|
|
|
rm -f "$GRIDWORKS_BUILD_DIR/temp_gridworks.dmg"
|
2010-03-30 23:24:04 +02:00
|
|
|
|
|
|
|
echo ""
|
|
|
|
echo "Built DMG for version $VERSION-$REVISION"
|
2010-02-07 06:25:44 +01:00
|
|
|
}
|
|
|
|
|
2010-03-09 09:08:35 +01:00
|
|
|
test() {
|
|
|
|
if [ ! -d $GRIDWORKS_TEST_DIR/classes ] ; then
|
|
|
|
ant build_tests
|
|
|
|
echo ""
|
|
|
|
fi
|
|
|
|
|
|
|
|
CLASSPATH="$GRIDWORKS_BUILD_DIR/classes:$GRIDWORKS_TEST_DIR/classes:$GRIDWORKS_TEST_DIR/lib/*:$GRIDWORKS_LIB_DIR/*"
|
|
|
|
|
|
|
|
if [ "$1" == "" ] ; then
|
|
|
|
cd $GRIDWORKS_TEST_DIR/classes
|
|
|
|
TESTS=`find . -name '*.class' | sed s@/@.@g | sed s@.class@@ | sed s@..@@`
|
|
|
|
cd ../..
|
|
|
|
else
|
|
|
|
TESTS=$1
|
|
|
|
fi
|
|
|
|
|
|
|
|
RUN_CMD="$JAVA -cp $CLASSPATH $OPTS org.junit.runner.JUnitCore $TESTS"
|
|
|
|
|
|
|
|
echo "$RUN_CMD"
|
|
|
|
echo ""
|
|
|
|
|
|
|
|
exec $RUN_CMD
|
|
|
|
}
|
|
|
|
|
2010-02-08 00:15:50 +01:00
|
|
|
run() {
|
|
|
|
if [ ! -d $GRIDWORKS_BUILD_DIR/classes ] ; then
|
2010-03-30 23:24:04 +02:00
|
|
|
if [ `ls $GRIDWORKS_LIB_DIR | grep gridworks` == "" ] ; then
|
|
|
|
ant build
|
|
|
|
echo ""
|
|
|
|
fi
|
2010-02-08 00:15:50 +01:00
|
|
|
fi
|
2010-03-03 03:53:07 +01:00
|
|
|
|
|
|
|
if [ "$SYSTEM" == 'Darwin' ] ; then
|
|
|
|
OPTS="-Xdock:name=Gridworks -Xdock:icon=src/graphics/icon/gridworks.icns $OPTS"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$GRIDWORKS_DATA_DIR" != "" ] ; then
|
|
|
|
OPTS="-Dgridworks.data_dir=$GRIDWORKS_DATA_DIR $OPTS"
|
|
|
|
fi
|
2010-02-08 00:15:50 +01:00
|
|
|
|
2010-02-08 20:48:28 +01:00
|
|
|
CLASSPATH="$GRIDWORKS_BUILD_DIR/classes:$GRIDWORKS_LIB_DIR/*"
|
2010-02-08 00:15:50 +01:00
|
|
|
|
2010-03-03 03:53:07 +01:00
|
|
|
RUN_CMD="$JAVA -cp $CLASSPATH $OPTS com.metaweb.gridworks.Gridworks"
|
2010-02-08 00:15:50 +01:00
|
|
|
|
|
|
|
echo "Starting Gridworks at 'http://${GRIDWORKS_HOST}:${GRIDWORKS_PORT}/'"
|
|
|
|
echo ""
|
|
|
|
#echo "$RUN_CMD"
|
|
|
|
#echo ""
|
|
|
|
|
|
|
|
exec $RUN_CMD
|
|
|
|
}
|
2010-03-12 08:37:37 +01:00
|
|
|
|
|
|
|
execute() {
|
|
|
|
if [ ! -d $GRIDWORKS_BUILD_DIR/classes ] ; then
|
|
|
|
ant build
|
|
|
|
echo ""
|
|
|
|
fi
|
|
|
|
|
|
|
|
CLASSPATH="$GRIDWORKS_BUILD_DIR/classes:$GRIDWORKS_LIB_DIR/*"
|
|
|
|
|
|
|
|
RUN_CMD="$JAVA -cp $CLASSPATH $OPTS $*"
|
|
|
|
|
|
|
|
echo "$RUN_CMD"
|
|
|
|
echo ""
|
|
|
|
|
|
|
|
exec $RUN_CMD $*
|
|
|
|
}
|
2010-02-08 00:15:50 +01:00
|
|
|
|
2010-03-30 23:24:04 +02:00
|
|
|
# -------------------------- script -----------------------------
|
|
|
|
|
2010-02-08 00:15:50 +01:00
|
|
|
# ----- We called without arguments print the usage -------------
|
2010-02-07 06:25:44 +01:00
|
|
|
|
2010-02-08 00:15:50 +01:00
|
|
|
[ $# -gt 0 ] || usage
|
|
|
|
|
|
|
|
# ----- Normalize the current directory -------------------------
|
|
|
|
|
|
|
|
cd `dirname $0`
|
|
|
|
|
2010-03-30 23:24:04 +02:00
|
|
|
# ----- Default values ------------------------------------------
|
|
|
|
|
|
|
|
OPTS=""
|
|
|
|
|
|
|
|
SYSTEM=`uname`
|
|
|
|
|
|
|
|
if [ "$SYSTEM" == "Darwin" ] && [ "$JAVA_HOME" == "" ] ; then
|
|
|
|
export JAVA_HOME="/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# ----- Load configurations -------------------------------------
|
|
|
|
|
|
|
|
load_configs gridworks.ini
|
|
|
|
|
|
|
|
# ----- Make sure there is an appropriate java environment is available -------------
|
2010-02-08 00:15:50 +01:00
|
|
|
|
|
|
|
if [ ! -z "$JAVA_HOME" ] ; then
|
|
|
|
JAVA="$JAVA_HOME/bin/java"
|
|
|
|
else
|
|
|
|
JAVA=`which java`
|
|
|
|
if [ -z "$JAVA" ] ; then
|
2010-02-09 21:21:10 +01:00
|
|
|
if [ "$SYSTEM" = 'Darwin' ] ; then
|
2010-02-08 00:15:50 +01:00
|
|
|
JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home
|
|
|
|
else
|
2010-02-09 21:21:10 +01:00
|
|
|
error "The 'java' command should be in your path or the 'JAVA_HOME' environment variable should be set"
|
2010-02-08 00:15:50 +01:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2010-02-08 20:48:28 +01:00
|
|
|
JAVA_VERSION=`java -version 2>&1 | grep version | cut -d ' ' -f 3 | egrep ^\"1.6`
|
|
|
|
if [ -z "$JAVA_VERSION" ] ; then
|
2010-02-09 21:21:10 +01:00
|
|
|
error "Gridworks requires java version 6 or later."
|
2010-02-08 20:48:28 +01:00
|
|
|
fi
|
|
|
|
|
2010-02-08 00:15:50 +01:00
|
|
|
# ----- Parse the command line args ------------------------------------------
|
2010-02-07 06:25:44 +01:00
|
|
|
|
|
|
|
while [ $# -ne 0 ] ; do
|
2010-02-08 00:15:50 +01:00
|
|
|
case "$1" in
|
2010-03-17 02:51:29 +01:00
|
|
|
-h) usage;;
|
2010-02-08 00:15:50 +01:00
|
|
|
-p) shift; GRIDWORKS_PORT="$1"; shift; continue;;
|
|
|
|
-i) shift; GRIDWORKS_HOST="$1"; shift; continue;;
|
|
|
|
-w) shift; GRIDWORKS_WEBAPP="$1"; shift; continue;;
|
2010-03-03 03:53:07 +01:00
|
|
|
-d) shift; GRIDWORKS_DATA_DIR="$1"; shift; continue;;
|
2010-03-30 23:24:04 +02:00
|
|
|
-m) shift; GRIDWORKS_MEMORY="$1"; shift; continue;;
|
2010-03-03 03:53:07 +01:00
|
|
|
--debug) shift; add_option '-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n'; continue;;
|
|
|
|
--jmx) shift; add_option '-Dcom.sun.management.jmxremote'; continue;;
|
2010-02-08 00:15:50 +01:00
|
|
|
-*) fail "Invalid option: $1";;
|
|
|
|
*) break;;
|
2010-02-07 06:25:44 +01:00
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
2010-02-08 00:15:50 +01:00
|
|
|
ACTION=$1; shift
|
|
|
|
|
2010-02-07 06:25:44 +01:00
|
|
|
# ----- Verify and Set Required Environment Variables -------------------------
|
|
|
|
|
2010-02-08 00:15:50 +01:00
|
|
|
if [ "$JAVA_OPTIONS" == "" ] ; then
|
2010-03-30 23:24:04 +02:00
|
|
|
JAVA_OPTIONS=""
|
2010-02-07 06:25:44 +01:00
|
|
|
fi
|
|
|
|
add_option "$JAVA_OPTIONS"
|
|
|
|
|
2010-03-30 23:24:04 +02:00
|
|
|
if [ "$GRIDWORKS_MEMORY" == "" ] ; then
|
|
|
|
GRIDWORKS_MEMORY="1024M"
|
|
|
|
fi
|
|
|
|
add_option "-Xms256M -Xmx$GRIDWORKS_MEMORY"
|
|
|
|
|
2010-02-08 00:15:50 +01:00
|
|
|
if [ "$GRIDWORKS_PORT" == "" ] ; then
|
2010-02-07 06:25:44 +01:00
|
|
|
GRIDWORKS_PORT="3333"
|
|
|
|
fi
|
2010-02-08 00:15:50 +01:00
|
|
|
add_option "-Dgridworks.port=$GRIDWORKS_PORT"
|
2010-02-07 06:25:44 +01:00
|
|
|
|
2010-02-08 00:15:50 +01:00
|
|
|
if [ "$GRIDWORKS_HOST" == "" ] ; then
|
|
|
|
GRIDWORKS_HOST="127.0.0.1"
|
|
|
|
fi
|
|
|
|
add_option "-Dgridworks.host=$GRIDWORKS_HOST"
|
2010-02-07 06:25:44 +01:00
|
|
|
|
2010-02-08 00:15:50 +01:00
|
|
|
if [ "$GRIDWORKS_WEBAPP" == "" ] ; then
|
|
|
|
GRIDWORKS_WEBAPP="src/main/webapp"
|
2010-02-07 06:25:44 +01:00
|
|
|
fi
|
2010-02-08 00:15:50 +01:00
|
|
|
add_option "-Dgridworks.webapp=$GRIDWORKS_WEBAPP"
|
|
|
|
|
2010-03-09 09:08:35 +01:00
|
|
|
if [ "$GRIDWORKS_TEST_DIR" == "" ] ; then
|
|
|
|
GRIDWORKS_TEST_DIR="tests"
|
|
|
|
fi
|
|
|
|
|
2010-02-08 00:15:50 +01:00
|
|
|
if [ "$GRIDWORKS_BUILD_DIR" == "" ] ; then
|
|
|
|
GRIDWORKS_BUILD_DIR="build"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$GRIDWORKS_LIB_DIR" == "" ] ; then
|
|
|
|
GRIDWORKS_LIB_DIR="lib"
|
|
|
|
fi
|
|
|
|
|
2010-02-09 21:21:10 +01:00
|
|
|
if [ "$GRIDWORKS_DIST_DIR" == "" ] ; then
|
|
|
|
GRIDWORKS_DIST_DIR="dist"
|
|
|
|
fi
|
2010-02-08 00:15:50 +01:00
|
|
|
|
|
|
|
# ----- Respond to the action given --------------------------------------------
|
2010-02-07 06:25:44 +01:00
|
|
|
|
|
|
|
case "$ACTION" in
|
2010-03-04 09:46:33 +01:00
|
|
|
|
2010-02-08 00:15:50 +01:00
|
|
|
build)
|
2010-02-10 08:30:16 +01:00
|
|
|
ant build;;
|
2010-02-09 21:21:10 +01:00
|
|
|
|
|
|
|
bundle)
|
|
|
|
ant bundle;;
|
|
|
|
|
|
|
|
clean)
|
|
|
|
ant clean;;
|
|
|
|
|
|
|
|
distclean)
|
|
|
|
ant distclean;;
|
2010-02-08 00:15:50 +01:00
|
|
|
|
2010-03-09 09:08:35 +01:00
|
|
|
test)
|
|
|
|
test $1;;
|
|
|
|
|
2010-02-07 06:25:44 +01:00
|
|
|
run)
|
2010-02-08 00:15:50 +01:00
|
|
|
run;;
|
2010-03-12 08:37:37 +01:00
|
|
|
|
|
|
|
execute)
|
|
|
|
execute $*;;
|
2010-02-07 06:25:44 +01:00
|
|
|
|
2010-02-09 21:21:10 +01:00
|
|
|
make_dmg)
|
|
|
|
make_dmg $1;;
|
2010-02-10 08:30:16 +01:00
|
|
|
|
|
|
|
make_exe)
|
|
|
|
make_exe $1;;
|
2010-03-17 23:30:16 +01:00
|
|
|
|
|
|
|
make_cli)
|
|
|
|
make_cli $1;;
|
|
|
|
|
2010-03-30 23:24:04 +02:00
|
|
|
dist)
|
|
|
|
dist $1;;
|
2010-02-09 21:21:10 +01:00
|
|
|
|
2010-02-07 06:25:44 +01:00
|
|
|
*)
|
2010-02-08 00:15:50 +01:00
|
|
|
usage; ;;
|
2010-03-30 23:24:04 +02:00
|
|
|
|
2010-02-07 06:25:44 +01:00
|
|
|
esac
|