Commit d33b9844 authored by Christophe Demarey's avatar Christophe Demarey
Browse files

Update frascati script in order to have an fscript profile for the explorer.

parent 2f1a01d8
......@@ -21,6 +21,8 @@
### BEGIN INIT INFO
# Provides: OW2 FraSCAti main script
# Short-Description: OW2 FraSCAti front-end for console mode
#
# Using getopts
### END INIT INFO
check_config() {
......@@ -42,7 +44,7 @@ check_config() {
echo "The FRASCATI_HOME variable is not set. Using $FRASCATI_HOME as default value."
fi
FRASCATI_VERSION=1.1-SNAPSHOT
FRASCATI_VERSION=1.1
FRASCATI_LIB=$FRASCATI_HOME/lib
LOGGING=$FRASCATI_HOME/conf/logging.properties
FRASCATI_MAIN=org.ow2.frascati.factory.FactoryCommandLine
......@@ -51,6 +53,27 @@ check_config() {
SCA_APPS_FOLDER=$FRASCATI_HOME/sca-apps
}
# Parse command options:
# * set flags if the option is found
# * remove all options from arguments at the end of the parsing.
# WARNING: Options MUST lead arguments
parse_opts() {
FRASCATI_SUB_CMD=$1
shift
FRASCATI_SCRIPT_FLAG=
while getopts 's' OPTION
do
case $OPTION in
s) FRASCATI_SCRIPT_FLAG=1
;;
?) printf "Usage: %s %s [-s] args\n" $(basename $0) $FRASCATI_SUB_CMD >&2
exit 2
;;
esac
done
shift $(($OPTIND - 1))
}
compile() {
echo "$1"
echo "$2"
......@@ -104,6 +127,7 @@ explorer() {
FRACTAL_PROVIDER=org.objectweb.fractal.julia.Julia
JULIA_CONFIG=julia.cfg
EXPLORER_LAUNCHER=org.ow2.frascati.explorer.FrascatiExplorerLauncher
EXPLORER_FSCRIPT_LAUNCHER=org.ow2.frascati.explorer.fscript.FrascatiScriptExplorerLauncher
EXPLORER_CLASSPATH=$FRASCATI_LIB
COMPOSITES=
......@@ -114,7 +138,7 @@ explorer() {
do
if [ -d $SCA_APPS_FOLDER/$folder ]
then
EXPLORER_CLASSPATH=$EXPLORER_CLASSPATH,$SCA_APPS_FOLDER/$folder/
EXPLORER_CLASSPATH=$EXPLORER_CLASSPATH,$SCA_APPS_FOLDER/$folder/
fi
done
......@@ -126,6 +150,12 @@ explorer() {
done
fi
if [ "$FRASCATI_SCRIPT_FLAG" ]
then
EXPLORER_LAUNCHER=$EXPLORER_FSCRIPT_LAUNCHER
EXPLORER_CLASSPATH=$EXPLORER_CLASSPATH,$FRASCATI_LIB/explorer-fscript-plugin
printf -- "-\> FraSCAti Script plugin activated\n"
fi
$JAVA -Dfractal.provider=${FRACTAL_PROVIDER} -Djulia.config=${JULIA_CONFIG} -cp $LAUNCHER_LIB $LAUNCHER_MAIN $EXPLORER_LAUNCHER -lib $EXPLORER_CLASSPATH $COMPOSITES
}
......@@ -150,6 +180,7 @@ case "$1" in
;;
explorer)
check_config
parse_opts $*
echo "Running the OW2 FraSCAti Explorer ..."
explorer
echo "Exiting OW2 FraSCAti Explorer ..."
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment