Admin/build
author wenzelm
Sun Dec 03 19:09:42 2017 +0100 (18 months ago)
changeset 67122 85b40f300fab
parent 64370 865b39487b5d
permissions -rwxr-xr-x
simplified session (again, see 39e29972cb96): WordExamples requires < 1s;
     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_fresh      fresh build of jars
    30 
    31 EOF
    32   exit 1
    33 }
    34 
    35 function fail()
    36 {
    37   echo "$1" >&2
    38   exit 2
    39 }
    40 
    41 
    42 ## process command line
    43 
    44 [ "$#" -eq 0 ] && usage
    45 
    46 MODULES="$@"; shift "$#"
    47 
    48 
    49 ## modules
    50 
    51 function build_all ()
    52 {
    53   build_browser
    54   build_jars
    55 }
    56 
    57 
    58 function build_browser ()
    59 {
    60   pushd "$ISABELLE_HOME/lib/browser" >/dev/null
    61   "$ISABELLE_TOOL" env ./build || exit $?
    62   popd >/dev/null
    63 }
    64 
    65 
    66 function build_jars ()
    67 {
    68   pushd "$ISABELLE_HOME/src/Pure" >/dev/null
    69   "$ISABELLE_TOOL" env ./build-jars "$@" || exit $?
    70   popd >/dev/null
    71 }
    72 
    73 
    74 ## main
    75 
    76 #FIXME workarounds for scalac 2.11.0
    77 export CYGWIN="nodosfilewarning"
    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     *) fail "Bad module $MODULE"
    89   esac
    90 done