Last active
December 20, 2020 14:18
-
-
Save wtakuo/917ac3dc7eb045af769962abf38d84ae to your computer and use it in GitHub Desktop.
UPPAAL startup script for macOS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# Run this script to start UPPAAL 4.1.x. | |
# | |
# Default options if needed. | |
# Add -Duppaal.extra if you want to force extra features. | |
# JAVA_DEF="-Duppaal.extra" | |
#JAVA_DEF=-Duppaal.lsc | |
#JAVA_DEF= | |
# Force language if LANG is defined. | |
if [ ! -z "$LANG" ]; then | |
JAVA_DEF="$JAVA_DEF -Duser.language=${LANG/_*/}" | |
fi | |
# Fix splash option if no splash is asked (Java 6). | |
NOJAR="" | |
for opt in $* ; do | |
if [ "$opt" = "--no-splash" ]; then | |
JAVA_DEF="$JAVA_DEF -Duppaal.extra -splash:/dev/null" | |
NOJAR="y" | |
break | |
fi | |
done | |
# Setup. | |
p=$0 | |
d=$(cd $(dirname $p) && pwd) | |
while [ -L $p ]; do | |
p=$(readlink $p) | |
d=$(cd $d && cd $(dirname $p) && pwd) | |
done | |
HERE=$d | |
if [ "`uname -s`" = "Cygwin" ]; then | |
HERE="${HERE/#\/cygdrive\//}" | |
HERE="${HERE/\//:/}" | |
ENGINE="$HERE/bin-Windows" | |
else | |
ENGINE="$HERE/bin-`uname`" | |
fi | |
JAR="$HERE/uppaal.jar" | |
# No antialias if remote execution (better performance). | |
EXTRADEF="" | |
EXTRAOPT="" | |
if [[ "$DISPLAY" != ":"* ]]; then | |
EXTRADEF="-splash:/dev/null" | |
EXTRAOPT="--no-antialias" | |
fi | |
# Start. | |
if [ -z "$NOJAR" ]; then | |
java $JAVA_DEF $EXTRADEF -jar "$JAR" --enginePath "$ENGINE" $EXTRAOPT "$@" | |
else | |
java $JAVA_DEF $EXTRADEF -classpath "$JAR" com.uppaal.gui.Main --enginePath "$ENGINE" $EXTRAOPT "$@" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment