author | blanchet |
Thu, 06 Jun 2013 21:32:39 +0200 | |
changeset 52326 | a9f75d64b3f4 |
parent 50546 | 1b01a57d2749 |
child 52443 | 725916b7dee5 |
permissions | -rwxr-xr-x |
50365 | 1 |
#!/usr/bin/env bash |
2 |
# |
|
3 |
# Author: Makarius |
|
4 |
# |
|
5 |
# DESCRIPTION: build Isabelle session images via GUI dialog |
|
6 |
||
7 |
||
8 |
## diagnostics |
|
9 |
||
10 |
PRG="$(basename "$0")" |
|
11 |
||
12 |
function usage() |
|
13 |
{ |
|
14 |
echo |
|
50546 | 15 |
echo "Usage: isabelle $PRG [OPTIONS]" |
50365 | 16 |
echo |
17 |
echo " Options are:" |
|
50403
87868964733c
more uniform default logic, using settings, options, args etc.;
wenzelm
parents:
50370
diff
changeset
|
18 |
echo " -L OPTION default logic via system option" |
50365 | 19 |
echo " -d DIR include session directory" |
50546 | 20 |
echo " -l NAME logic session name" |
50369 | 21 |
echo " -s system build mode: produce output in ISABELLE_HOME" |
50365 | 22 |
echo |
50546 | 23 |
echo " Build Isabelle logic session image via GUI dialog (default: $ISABELLE_LOGIC)." |
50365 | 24 |
echo |
25 |
exit 1 |
|
26 |
} |
|
27 |
||
28 |
function fail() |
|
29 |
{ |
|
30 |
echo "$1" >&2 |
|
31 |
exit 2 |
|
32 |
} |
|
33 |
||
34 |
||
35 |
## process command line |
|
36 |
||
50403
87868964733c
more uniform default logic, using settings, options, args etc.;
wenzelm
parents:
50370
diff
changeset
|
37 |
LOGIC_OPTION="" |
50365 | 38 |
declare -a INCLUDE_DIRS=() |
50546 | 39 |
LOGIC="" |
50369 | 40 |
SYSTEM_MODE=false |
50365 | 41 |
|
50546 | 42 |
while getopts "L:d:l:s" OPT |
50365 | 43 |
do |
44 |
case "$OPT" in |
|
50403
87868964733c
more uniform default logic, using settings, options, args etc.;
wenzelm
parents:
50370
diff
changeset
|
45 |
L) |
87868964733c
more uniform default logic, using settings, options, args etc.;
wenzelm
parents:
50370
diff
changeset
|
46 |
LOGIC_OPTION="$OPTARG" |
87868964733c
more uniform default logic, using settings, options, args etc.;
wenzelm
parents:
50370
diff
changeset
|
47 |
;; |
50365 | 48 |
d) |
49 |
INCLUDE_DIRS["${#INCLUDE_DIRS[@]}"]="$OPTARG" |
|
50 |
;; |
|
50546 | 51 |
l) |
52 |
LOGIC="$OPTARG" |
|
53 |
;; |
|
50369 | 54 |
s) |
55 |
SYSTEM_MODE="true" |
|
56 |
;; |
|
50365 | 57 |
\?) |
58 |
usage |
|
59 |
;; |
|
60 |
esac |
|
61 |
done |
|
62 |
||
63 |
shift $(($OPTIND - 1)) |
|
64 |
||
65 |
||
66 |
# args |
|
67 |
||
50546 | 68 |
[ "$#" -ne 0 ] && usage |
50365 | 69 |
|
70 |
||
50403
87868964733c
more uniform default logic, using settings, options, args etc.;
wenzelm
parents:
50370
diff
changeset
|
71 |
## main |
50365 | 72 |
|
50403
87868964733c
more uniform default logic, using settings, options, args etc.;
wenzelm
parents:
50370
diff
changeset
|
73 |
[ -e "$ISABELLE_HOME/Admin/build" ] && { "$ISABELLE_HOME/Admin/build" jars || exit $?; } |
50365 | 74 |
|
50403
87868964733c
more uniform default logic, using settings, options, args etc.;
wenzelm
parents:
50370
diff
changeset
|
75 |
"$ISABELLE_TOOL" java isabelle.Build_Dialog \ |
50546 | 76 |
"$LOGIC_OPTION" "$LOGIC" "$SYSTEM_MODE" "${INCLUDE_DIRS[@]}" |
50365 | 77 |