Admin/build
author wenzelm
Wed, 23 Apr 2014 10:38:56 +0200
changeset 58006 8ff8e5d00115
parent 54715 838d9e058a1a
child 58960 d762318438c3
permissions -rwxr-xr-x
updated workaround;
     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 (requires jdk)
    28     jars            Isabelle/Scala (requires \$ISABELLE_JDK_HOME and \$SCALA_HOME)
    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 workaround for scalac 2.11.0
    78 function stty() { :; }
    79 export -f stty
    80 
    81 for MODULE in $MODULES
    82 do
    83   case $MODULE in
    84     all) build_all;;
    85     browser) build_browser;;
    86     jars) build_jars;;
    87     jars_fresh) build_jars -f;;
    88     jars_test) build_jars -t;;
    89     *) fail "Bad module $MODULE"
    90   esac
    91 done