Admin/build
author wenzelm
Mon Oct 27 16:11:24 2014 +0100 (2014-10-27)
changeset 58791 00916b0dd596
parent 57618 d762318438c3
child 64370 865b39487b5d
permissions -rwxr-xr-x
clarified ISABELLE_JDK_HOME vs. JAVA_HOME;
     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