bin/isabelle
author wenzelm
Sun Mar 24 13:48:46 2019 +0100 (3 months ago)
changeset 69962 82e945d472d5
parent 66906 03a96b8c7c06
permissions -rwxr-xr-x
documentation of document markers and re-interpreted command tags;
     1 #!/usr/bin/env bash
     2 #
     3 # Author: Markus Wenzel, TU Muenchen
     4 #
     5 # Isabelle tool wrapper.
     6 
     7 if [ -L "$0" ]; then
     8   TARGET="$(LC_ALL=C ls -l "$0" | sed 's/.* -> //')"
     9   exec "$(cd "$(dirname "$0")"; cd "$(pwd -P)"; cd "$(dirname "$TARGET")"; pwd)/$(basename "$TARGET")" "$@"
    10 fi
    11 
    12 
    13 ## settings
    14 
    15 PRG="$(basename "$0")"
    16 
    17 ISABELLE_HOME="$(cd "$(dirname "$0")"; cd "$(pwd -P)"; cd ..; pwd)"
    18 source "$ISABELLE_HOME/lib/scripts/getsettings" || exit 2
    19 
    20 
    21 ## external tool (shell script)
    22 
    23 if [ "$#" -ge 1 -a "$1" != "-?" ]
    24 then
    25   TOOL_NAME="$1"
    26 
    27   splitarray ":" "$ISABELLE_TOOLS"; TOOLS=("${SPLITARRAY[@]}")
    28   for DIR in "${TOOLS[@]}"
    29   do
    30     TOOL="$DIR/$TOOL_NAME"
    31     case "$TOOL" in
    32       *~ | *.orig) ;;
    33       *)
    34         if [ -f "$TOOL" -a -x "$TOOL" ]; then
    35           shift
    36           exec "$TOOL" "$@"
    37         fi
    38         ;;
    39     esac
    40   done
    41 fi
    42 
    43 
    44 ## internal tool or usage (Scala)
    45 
    46 isabelle_admin_build jars || exit $?
    47 
    48 eval "declare -a JAVA_ARGS=($ISABELLE_TOOL_JAVA_OPTIONS)"
    49 exec isabelle java "${JAVA_ARGS[@]}" isabelle.Isabelle_Tool "$@"