tuned Isabelle/Scala build;
authorwenzelm
Wed Jan 06 22:21:25 2010 +0100 (2010-01-06)
changeset 3428433ad3571ad83
parent 34283 7911e83d06c0
child 34285 218fa4267718
tuned Isabelle/Scala build;
Admin/build
src/Pure/build-jars
src/Pure/mk-jars
     1.1 --- a/Admin/build	Wed Jan 06 22:18:52 2010 +0100
     1.2 +++ b/Admin/build	Wed Jan 06 22:21:25 2010 +0100
     1.3 @@ -84,7 +84,7 @@
     1.4  function build_jars ()
     1.5  {
     1.6    pushd "$ISABELLE_HOME/src/Pure" >/dev/null
     1.7 -  "$ISABELLE_TOOL" env ./mk-jars || fail "Failed."
     1.8 +  "$ISABELLE_TOOL" env ./build-jars || fail "Failed!"
     1.9    popd >/dev/null
    1.10  }
    1.11  
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/src/Pure/build-jars	Wed Jan 06 22:21:25 2010 +0100
     2.3 @@ -0,0 +1,101 @@
     2.4 +#!/usr/bin/env bash
     2.5 +#
     2.6 +# Author: Makarius
     2.7 +#
     2.8 +# mk-jars - build Isabelle/Scala
     2.9 +#
    2.10 +# Requires proper Isabelle settings environment.
    2.11 +
    2.12 +
    2.13 +## diagnostics
    2.14 +
    2.15 +function fail()
    2.16 +{
    2.17 +  echo "$1" >&2
    2.18 +  exit 2
    2.19 +}
    2.20 +
    2.21 +[ -n "$ISABELLE_HOME" ] || fail "Missing Isabelle settings environment"
    2.22 +[ -z "$SCALA_HOME" ] && fail "Scala unavailable: unknown SCALA_HOME"
    2.23 +
    2.24 +
    2.25 +## dependencies
    2.26 +
    2.27 +declare -a SOURCES=(
    2.28 +  Concurrent/future.scala
    2.29 +  General/download.scala
    2.30 +  General/event_bus.scala
    2.31 +  General/exn.scala
    2.32 +  General/linear_set.scala
    2.33 +  General/markup.scala
    2.34 +  General/position.scala
    2.35 +  General/scan.scala
    2.36 +  General/swing_thread.scala
    2.37 +  General/symbol.scala
    2.38 +  General/xml.scala
    2.39 +  General/yxml.scala
    2.40 +  Isar/isar_document.scala
    2.41 +  Isar/outer_keyword.scala
    2.42 +  Isar/outer_lex.scala
    2.43 +  Isar/outer_parse.scala
    2.44 +  Isar/outer_syntax.scala
    2.45 +  System/cygwin.scala
    2.46 +  System/gui_setup.scala
    2.47 +  System/isabelle_process.scala
    2.48 +  System/isabelle_syntax.scala
    2.49 +  System/isabelle_system.scala
    2.50 +  System/platform.scala
    2.51 +  System/session_manager.scala
    2.52 +  System/standard_system.scala
    2.53 +  Thy/completion.scala
    2.54 +  Thy/html.scala
    2.55 +  Thy/text_edit.scala
    2.56 +  Thy/thy_header.scala
    2.57 +  Thy/thy_syntax.scala
    2.58 +  library.scala
    2.59 +)
    2.60 +
    2.61 +TARGET_DIR="$ISABELLE_HOME/lib/classes"
    2.62 +PURE_JAR="$TARGET_DIR/Pure.jar"
    2.63 +FULL_JAR="$TARGET_DIR/isabelle-scala.jar"
    2.64 +
    2.65 +declare -a TARGETS=("$PURE_JAR" "$FULL_JAR")
    2.66 +
    2.67 +
    2.68 +## main
    2.69 +
    2.70 +OUTDATED=false
    2.71 +
    2.72 +for SOURCE in "${SOURCES[@]}"
    2.73 +do
    2.74 +  [ ! -e "$SOURCE" ] && fail "Missing source file: $SOURCE"
    2.75 +  for TARGET in "${TARGETS[@]}"
    2.76 +  do
    2.77 +    [ ! -e "$TARGET" -o "$SOURCE" -nt "$TARGET" ] && OUTDATED=true
    2.78 +  done
    2.79 +done
    2.80 +
    2.81 +if [ "$OUTDATED" = true ]
    2.82 +then
    2.83 +  echo "###"
    2.84 +  echo "### Building Isabelle/Scala components ..."
    2.85 +  echo "###"
    2.86 +
    2.87 +  rm -rf classes && mkdir classes
    2.88 +  "$SCALA_HOME/bin/scalac" -unchecked -deprecation -d classes -target jvm-1.5 "${SOURCES[@]}" || \
    2.89 +    fail "Failed to compile sources"
    2.90 +  mkdir -p "$TARGET_DIR" || fail "Failed to create directory $TARGET_DIR"
    2.91 +  (
    2.92 +    cd classes
    2.93 +    jar cfe "$(jvmpath "$PURE_JAR")" isabelle.GUI_Setup isabelle || \
    2.94 +      fail "Failed to produce $PURE_JAR"
    2.95 +
    2.96 +    cp "$SCALA_HOME/lib/scala-swing.jar" .
    2.97 +    jar xf scala-swing.jar
    2.98 +
    2.99 +    cp "$SCALA_HOME/lib/scala-library.jar" "$FULL_JAR"
   2.100 +    jar ufe "$(jvmpath "$FULL_JAR")" isabelle.GUI_Setup isabelle scala || \
   2.101 +      fail "Failed to produce $FULL_JAR"
   2.102 +  )
   2.103 +  rm -rf classes
   2.104 +fi
     3.1 --- a/src/Pure/mk-jars	Wed Jan 06 22:18:52 2010 +0100
     3.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.3 @@ -1,98 +0,0 @@
     3.4 -#!/usr/bin/env bash
     3.5 -#
     3.6 -# Author: Makarius
     3.7 -#
     3.8 -# mk-jars - build Isabelle/Scala
     3.9 -#
    3.10 -# Requires proper Isabelle settings environment.
    3.11 -
    3.12 -
    3.13 -## diagnostics
    3.14 -
    3.15 -function fail()
    3.16 -{
    3.17 -  echo "$1" >&2
    3.18 -  exit 2
    3.19 -}
    3.20 -
    3.21 -[ -n "$ISABELLE_HOME" ] || fail "Missing Isabelle settings environment"
    3.22 -[ -z "$SCALA_HOME" ] && fail "Scala unavailable: unknown SCALA_HOME"
    3.23 -
    3.24 -
    3.25 -## dependencies
    3.26 -
    3.27 -declare -a SOURCES=(
    3.28 -  Concurrent/future.scala
    3.29 -  General/download.scala
    3.30 -  General/event_bus.scala
    3.31 -  General/exn.scala
    3.32 -  General/linear_set.scala
    3.33 -  General/markup.scala
    3.34 -  General/position.scala
    3.35 -  General/scan.scala
    3.36 -  General/swing_thread.scala
    3.37 -  General/symbol.scala
    3.38 -  General/xml.scala
    3.39 -  General/yxml.scala
    3.40 -  Isar/isar_document.scala
    3.41 -  Isar/outer_keyword.scala
    3.42 -  Isar/outer_lex.scala
    3.43 -  Isar/outer_parse.scala
    3.44 -  Isar/outer_syntax.scala
    3.45 -  System/cygwin.scala
    3.46 -  System/gui_setup.scala
    3.47 -  System/isabelle_process.scala
    3.48 -  System/isabelle_syntax.scala
    3.49 -  System/isabelle_system.scala
    3.50 -  System/platform.scala
    3.51 -  System/session_manager.scala
    3.52 -  System/standard_system.scala
    3.53 -  Thy/completion.scala
    3.54 -  Thy/html.scala
    3.55 -  Thy/text_edit.scala
    3.56 -  Thy/thy_header.scala
    3.57 -  Thy/thy_syntax.scala
    3.58 -  library.scala
    3.59 -)
    3.60 -
    3.61 -JAR_DIR="$ISABELLE_HOME/lib/classes"
    3.62 -PURE_JAR="$JAR_DIR/Pure.jar"
    3.63 -FULL_JAR="$JAR_DIR/isabelle-scala.jar"
    3.64 -
    3.65 -
    3.66 -## main
    3.67 -
    3.68 -OUTDATED=false
    3.69 -
    3.70 -for SOURCE in "${SOURCES[@]}"
    3.71 -do
    3.72 -  [ ! -e "$SOURCE" ] && fail "Missing source file: $SOURCE"
    3.73 -  for TARGET in "$PURE_JAR" "$FULL_JAR"
    3.74 -  do
    3.75 -    [ ! -e "$TARGET" -o "$SOURCE" -nt "$TARGET" ] && OUTDATED=true
    3.76 -  done
    3.77 -done
    3.78 -
    3.79 -if [ "$OUTDATED" = true ]; then
    3.80 -  echo "###"
    3.81 -  echo "### Building Isabelle/Scala components ..."
    3.82 -  echo "###"
    3.83 -
    3.84 -  rm -rf classes && mkdir classes
    3.85 -  "$SCALA_HOME/bin/scalac" -unchecked -deprecation -d classes -target jvm-1.5 "${SOURCES[@]}" || \
    3.86 -    fail "Failed to compile sources"
    3.87 -  mkdir -p "$JAR_DIR" || fail "Failed to create directory $JAR_DIR"
    3.88 -  (
    3.89 -    cd classes
    3.90 -    jar cfe "$(jvmpath "$PURE_JAR")" isabelle.GUI_Setup isabelle || \
    3.91 -      fail "Failed to produce $PURE_JAR"
    3.92 -
    3.93 -    cp "$SCALA_HOME/lib/scala-swing.jar" .
    3.94 -    jar xf scala-swing.jar
    3.95 -
    3.96 -    cp "$SCALA_HOME/lib/scala-library.jar" "$FULL_JAR"
    3.97 -    jar ufe "$(jvmpath "$FULL_JAR")" isabelle.GUI_Setup isabelle scala || \
    3.98 -      fail "Failed to produce $FULL_JAR"
    3.99 -  )
   3.100 -  rm -rf classes
   3.101 -fi