remove old output heaps, to ensure that result is valid wrt. check_stamps;
tuned signature;
5 # DESCRIPTION: build and manage Isabelle sessions
10 PRG="$(basename "$0")"
12 function show_settings()
15 echo "${PREFIX}ISABELLE_BUILD_OPTIONS=\"$ISABELLE_BUILD_OPTIONS\""
17 echo "${PREFIX}ML_PLATFORM=\"$ML_PLATFORM\""
18 echo "${PREFIX}ML_HOME=\"$ML_HOME\""
19 echo "${PREFIX}ML_SYSTEM=\"$ML_SYSTEM\""
20 echo "${PREFIX}ML_OPTIONS=\"$ML_OPTIONS\""
26 echo "Usage: isabelle $PRG [OPTIONS] [SESSIONS ...]"
29 echo " -a all sessions"
30 echo " -b build heap images"
31 echo " -d DIR include session directory with ROOT file"
32 echo " -g NAME include session group NAME"
33 echo " -j INT maximum number of jobs (default 1)"
34 echo " -n no build -- test dependencies only"
35 echo " -o OPTION override session configuration OPTION (via NAME=VAL or NAME)"
36 echo " -s system build mode: produce output in ISABELLE_HOME"
37 echo " -t inner session timing"
40 echo " Build and manage Isabelle sessions, depending on implicit"
52 function check_number()
54 [ -n "$1" -a -z "$(echo "$1" | tr -d '[0-9]')" ] || fail "Bad number: \"$1\""
58 ## process command line
62 declare -a MORE_DIRS=()
63 declare -a SESSION_GROUPS=()
66 eval "declare -a BUILD_OPTIONS=($ISABELLE_BUILD_OPTIONS)"
71 while getopts "abd:g:j:no:stv" OPT
81 MORE_DIRS["${#MORE_DIRS[@]}"]="$OPTARG"
84 SESSION_GROUPS["${#SESSION_GROUPS[@]}"]="$OPTARG"
87 check_number "$OPTARG"
94 BUILD_OPTIONS["${#BUILD_OPTIONS[@]}"]="$OPTARG"
111 shift $(($OPTIND - 1))
116 [ -e "$ISABELLE_HOME/Admin/build" ] && { "$ISABELLE_HOME/Admin/build" jars || exit $?; }
118 if [ "$NO_BUILD" = false ]; then
119 echo "Started at $(date) ($ML_IDENTIFIER on $(hostname))"
121 if [ "$VERBOSE" = true ]; then
125 . "$ISABELLE_HOME/lib/scripts/timestart.bash"
128 "$ISABELLE_TOOL" java isabelle.Build \
129 "$ALL_SESSIONS" "$BUILD_HEAP" "$MAX_JOBS" "$NO_BUILD" "$SYSTEM_MODE" "$TIMING" "$VERBOSE" \
130 "${MORE_DIRS[@]}" $'\n' "${SESSION_GROUPS[@]}" $'\n' "${BUILD_OPTIONS[@]}" $'\n' "$@"
133 if [ "$NO_BUILD" = false ]; then
134 echo -n "Finished at "; date
136 . "$ISABELLE_HOME/lib/scripts/timestop.bash"