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