lib/Tools/build
changeset 60106 e0d1d9203275
parent 59892 2a616319c171
child 61131 83459eb76fe3
equal deleted inserted replaced
60105:8614f8f0fb4b 60106:e0d1d9203275
    26   echo "Usage: isabelle $PRG [OPTIONS] [SESSIONS ...]"
    26   echo "Usage: isabelle $PRG [OPTIONS] [SESSIONS ...]"
    27   echo
    27   echo
    28   echo "  Options are:"
    28   echo "  Options are:"
    29   echo "    -D DIR       include session directory and select its sessions"
    29   echo "    -D DIR       include session directory and select its sessions"
    30   echo "    -R           operate on requirements of selected sessions"
    30   echo "    -R           operate on requirements of selected sessions"
       
    31   echo "    -X NAME      exclude sessions from group NAME and all descendants"
    31   echo "    -a           select all sessions"
    32   echo "    -a           select all sessions"
    32   echo "    -b           build heap images"
    33   echo "    -b           build heap images"
    33   echo "    -c           clean build"
    34   echo "    -c           clean build"
    34   echo "    -d DIR       include session directory"
    35   echo "    -d DIR       include session directory"
    35   echo "    -g NAME      select session group NAME"
    36   echo "    -g NAME      select session group NAME"
    38   echo "    -l           list session source files"
    39   echo "    -l           list session source files"
    39   echo "    -n           no build -- test dependencies only"
    40   echo "    -n           no build -- test dependencies only"
    40   echo "    -o OPTION    override Isabelle system OPTION (via NAME=VAL or NAME)"
    41   echo "    -o OPTION    override Isabelle system OPTION (via NAME=VAL or NAME)"
    41   echo "    -s           system build mode: produce output in ISABELLE_HOME"
    42   echo "    -s           system build mode: produce output in ISABELLE_HOME"
    42   echo "    -v           verbose"
    43   echo "    -v           verbose"
    43   echo "    -x SESSION   exclude SESSION and all its descendants"
    44   echo "    -x NAME      exclude session NAME and all descendants"
    44   echo
    45   echo
    45   echo "  Build and manage Isabelle sessions, depending on implicit"
    46   echo "  Build and manage Isabelle sessions, depending on implicit"
    46   show_settings "  "
    47   show_settings "  "
    47   echo
    48   echo
    48   exit 1
    49   exit 1
    62 
    63 
    63 ## process command line
    64 ## process command line
    64 
    65 
    65 declare -a SELECT_DIRS=()
    66 declare -a SELECT_DIRS=()
    66 REQUIREMENTS=false
    67 REQUIREMENTS=false
       
    68 declare -a EXCLUDE_SESSION_GROUPS=()
    67 ALL_SESSIONS=false
    69 ALL_SESSIONS=false
    68 BUILD_HEAP=false
    70 BUILD_HEAP=false
    69 CLEAN_BUILD=false
    71 CLEAN_BUILD=false
    70 declare -a INCLUDE_DIRS=()
    72 declare -a INCLUDE_DIRS=()
    71 declare -a SESSION_GROUPS=()
    73 declare -a SESSION_GROUPS=()
    76 eval "declare -a BUILD_OPTIONS=($ISABELLE_BUILD_OPTIONS)"
    78 eval "declare -a BUILD_OPTIONS=($ISABELLE_BUILD_OPTIONS)"
    77 SYSTEM_MODE=false
    79 SYSTEM_MODE=false
    78 VERBOSE=false
    80 VERBOSE=false
    79 declare -a EXCLUDE_SESSIONS=()
    81 declare -a EXCLUDE_SESSIONS=()
    80 
    82 
    81 while getopts "D:Rabcd:g:j:k:lno:svx:" OPT
    83 while getopts "D:RX:abcd:g:j:k:lno:svx:" OPT
    82 do
    84 do
    83   case "$OPT" in
    85   case "$OPT" in
    84     D)
    86     D)
    85       SELECT_DIRS["${#SELECT_DIRS[@]}"]="$OPTARG"
    87       SELECT_DIRS["${#SELECT_DIRS[@]}"]="$OPTARG"
    86       ;;
    88       ;;
    87     R)
    89     R)
    88       REQUIREMENTS="true"
    90       REQUIREMENTS="true"
       
    91       ;;
       
    92     X)
       
    93       EXCLUDE_SESSION_GROUPS["${#EXCLUDE_SESSION_GROUPS[@]}"]="$OPTARG"
    89       ;;
    94       ;;
    90     a)
    95     a)
    91       ALL_SESSIONS="true"
    96       ALL_SESSIONS="true"
    92       ;;
    97       ;;
    93     b)
    98     b)
   154 "$ISABELLE_TOOL" java "${JAVA_ARGS[@]}" isabelle.Build \
   159 "$ISABELLE_TOOL" java "${JAVA_ARGS[@]}" isabelle.Build \
   155   "$REQUIREMENTS" "$ALL_SESSIONS" "$BUILD_HEAP" "$CLEAN_BUILD" "$MAX_JOBS" \
   160   "$REQUIREMENTS" "$ALL_SESSIONS" "$BUILD_HEAP" "$CLEAN_BUILD" "$MAX_JOBS" \
   156   "$LIST_FILES" "$NO_BUILD" "$SYSTEM_MODE" "$VERBOSE" \
   161   "$LIST_FILES" "$NO_BUILD" "$SYSTEM_MODE" "$VERBOSE" \
   157   "${INCLUDE_DIRS[@]}" $'\n' "${SELECT_DIRS[@]}" $'\n' \
   162   "${INCLUDE_DIRS[@]}" $'\n' "${SELECT_DIRS[@]}" $'\n' \
   158   "${SESSION_GROUPS[@]}" $'\n' "${CHECK_KEYWORDS[@]}" $'\n' \
   163   "${SESSION_GROUPS[@]}" $'\n' "${CHECK_KEYWORDS[@]}" $'\n' \
   159   "${BUILD_OPTIONS[@]}" $'\n' "${EXCLUDE_SESSIONS[@]}" $'\n' "$@"
   164   "${BUILD_OPTIONS[@]}" $'\n' "${EXCLUDE_SESSION_GROUPS[@]}" $'\n' \
       
   165   "${EXCLUDE_SESSIONS[@]}" $'\n' "$@"
   160 RC="$?"
   166 RC="$?"
   161 
   167 
   162 if [ "$NO_BUILD" = false -a "$VERBOSE" = true ]; then
   168 if [ "$NO_BUILD" = false -a "$VERBOSE" = true ]; then
   163   echo -n "Finished at "; date
   169   echo -n "Finished at "; date
   164 fi
   170 fi