lib/browser/build
author wenzelm
Fri Nov 03 19:20:47 2017 +0100 (19 months ago)
changeset 66997 17eb23e43630
parent 61294 2d3d26e9b191
child 68014 9096895dc2a6
permissions -rwxr-xr-x
avoid slow IntInf.pow in Poly/ML 5.7.1 testing version, e.g. relevant for AFP/Lorenz_C0;
     1 #!/usr/bin/env bash
     2 #
     3 # Author: Makarius
     4 #
     5 # mk - build graph browser
     6 #
     7 # Requires proper Isabelle settings environment.
     8 
     9 
    10 ## diagnostics
    11 
    12 function fail()
    13 {
    14   echo "$1" >&2
    15   exit 2
    16 }
    17 
    18 [ -n "$ISABELLE_HOME" ] || fail "Missing Isabelle settings environment"
    19 
    20 
    21 ## dependencies
    22 
    23 declare -a SOURCES=(
    24   GraphBrowser/AWTFontMetrics.java
    25   GraphBrowser/AbstractFontMetrics.java
    26   GraphBrowser/Box.java
    27   GraphBrowser/Console.java
    28   GraphBrowser/DefaultFontMetrics.java
    29   GraphBrowser/Directory.java
    30   GraphBrowser/DummyVertex.java
    31   GraphBrowser/Graph.java
    32   GraphBrowser/GraphBrowser.java
    33   GraphBrowser/GraphBrowserFrame.java
    34   GraphBrowser/GraphView.java
    35   GraphBrowser/NormalVertex.java
    36   GraphBrowser/ParseError.java
    37   GraphBrowser/Region.java
    38   GraphBrowser/Spline.java
    39   GraphBrowser/TreeBrowser.java
    40   GraphBrowser/TreeNode.java
    41   GraphBrowser/Vertex.java
    42   awtUtilities/Border.java
    43   awtUtilities/MessageDialog.java
    44   awtUtilities/TextFrame.java
    45 )
    46 
    47 TARGET="$ISABELLE_HOME/lib/browser/GraphBrowser.jar"
    48 
    49 
    50 ## main
    51 
    52 OUTDATED=false
    53 
    54 for SOURCE in "${SOURCES[@]}"
    55 do
    56   [ ! -e "$SOURCE" ] && fail "Missing source file: $SOURCE"
    57   [ ! -e "$TARGET" -o "$SOURCE" -nt "$TARGET" ] && OUTDATED=true
    58 done
    59 
    60 if [ "$OUTDATED" = true ]
    61 then
    62   echo "### Building graph browser ..."
    63 
    64   rm -rf classes && mkdir classes
    65 
    66   isabelle_jdk javac -d classes -source 1.4 "${SOURCES[@]}" || \
    67     fail "Failed to compile sources"
    68   isabelle_jdk jar cf "$(platform_path "$TARGET")" -C classes . ||
    69     fail "Failed to produce $TARGET"
    70 
    71   rm -rf classes
    72 fi