Admin/build
author Walther Neuper <wneuper@ist.tugraz.at>
Tue, 07 Feb 2017 08:57:42 +0100
changeset 59316 3a60188d9cc3
parent 59180 85ec71012df8
permissions -rwxr-xr-x
separate structure Model : MODEL
     1 #!/usr/bin/env bash
     2 #
     3 # Administrative build for Isabelle source distribution.
     4 
     5 ## directory layout
     6 
     7 if [ -z "$ISABELLE_HOME" ]; then
     8   ISABELLE_HOME="$(cd "$(dirname "$0")"; cd "$(pwd -P)"; cd ..; pwd)"
     9   ISABELLE_TOOL="$ISABELLE_HOME/bin/isabelle"
    10 fi
    11 
    12 
    13 ## diagnostics
    14 
    15 PRG="$(basename "$0")"
    16 
    17 function usage()
    18 {
    19   cat <<EOF
    20 
    21 Usage: $PRG [MODULES]
    22 
    23   Produce Isabelle distribution modules from current repository sources.
    24   The MODULES list may contain any of the following:
    25 
    26     all             all modules below
    27     browser         graph browser
    28     jars            Isabelle/Scala
    29     jars_test       test separate build of jars
    30     jars_fresh      fresh build of jars
    31 
    32 EOF
    33   exit 1
    34 }
    35 
    36 function fail()
    37 {
    38   echo "$1" >&2
    39   exit 2
    40 }
    41 
    42 
    43 ## process command line
    44 
    45 [ "$#" -eq 0 ] && usage
    46 
    47 MODULES="$@"; shift "$#"
    48 
    49 
    50 ## modules
    51 
    52 function build_all ()
    53 {
    54   build_browser
    55   build_jars
    56 }
    57 
    58 
    59 function build_browser ()
    60 {
    61   pushd "$ISABELLE_HOME/lib/browser" >/dev/null
    62   "$ISABELLE_TOOL" env ./build || exit $?
    63   popd >/dev/null
    64 }
    65 
    66 
    67 function build_jars ()
    68 {
    69   pushd "$ISABELLE_HOME/src/Pure" >/dev/null
    70   "$ISABELLE_TOOL" env ./build-jars "$@" || exit $?
    71   popd >/dev/null
    72 }
    73 
    74 
    75 ## main
    76 
    77 #FIXME workarounds for scalac 2.11.0
    78 export CYGWIN="nodosfilewarning"
    79 function stty() { :; }
    80 export -f stty
    81 
    82 for MODULE in $MODULES
    83 do
    84   case $MODULE in
    85     all) build_all;;
    86     browser) build_browser;;
    87     jars) build_jars;;
    88     jars_fresh) build_jars -f;;
    89     jars_test) build_jars -t;;
    90     *) fail "Bad module $MODULE"
    91   esac
    92 done