# HG changeset patch # User wenzelm # Date 1262812885 -3600 # Node ID 33ad3571ad8355ef9a29e0a5bfb7db08204ecd53 # Parent 7911e83d06c0e3e9da524de63e25806ace5de3eb tuned Isabelle/Scala build; diff -r 7911e83d06c0 -r 33ad3571ad83 Admin/build --- a/Admin/build Wed Jan 06 22:18:52 2010 +0100 +++ b/Admin/build Wed Jan 06 22:21:25 2010 +0100 @@ -84,7 +84,7 @@ function build_jars () { pushd "$ISABELLE_HOME/src/Pure" >/dev/null - "$ISABELLE_TOOL" env ./mk-jars || fail "Failed." + "$ISABELLE_TOOL" env ./build-jars || fail "Failed!" popd >/dev/null } diff -r 7911e83d06c0 -r 33ad3571ad83 src/Pure/build-jars --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Pure/build-jars Wed Jan 06 22:21:25 2010 +0100 @@ -0,0 +1,101 @@ +#!/usr/bin/env bash +# +# Author: Makarius +# +# mk-jars - build Isabelle/Scala +# +# Requires proper Isabelle settings environment. + + +## diagnostics + +function fail() +{ + echo "$1" >&2 + exit 2 +} + +[ -n "$ISABELLE_HOME" ] || fail "Missing Isabelle settings environment" +[ -z "$SCALA_HOME" ] && fail "Scala unavailable: unknown SCALA_HOME" + + +## dependencies + +declare -a SOURCES=( + Concurrent/future.scala + General/download.scala + General/event_bus.scala + General/exn.scala + General/linear_set.scala + General/markup.scala + General/position.scala + General/scan.scala + General/swing_thread.scala + General/symbol.scala + General/xml.scala + General/yxml.scala + Isar/isar_document.scala + Isar/outer_keyword.scala + Isar/outer_lex.scala + Isar/outer_parse.scala + Isar/outer_syntax.scala + System/cygwin.scala + System/gui_setup.scala + System/isabelle_process.scala + System/isabelle_syntax.scala + System/isabelle_system.scala + System/platform.scala + System/session_manager.scala + System/standard_system.scala + Thy/completion.scala + Thy/html.scala + Thy/text_edit.scala + Thy/thy_header.scala + Thy/thy_syntax.scala + library.scala +) + +TARGET_DIR="$ISABELLE_HOME/lib/classes" +PURE_JAR="$TARGET_DIR/Pure.jar" +FULL_JAR="$TARGET_DIR/isabelle-scala.jar" + +declare -a TARGETS=("$PURE_JAR" "$FULL_JAR") + + +## main + +OUTDATED=false + +for SOURCE in "${SOURCES[@]}" +do + [ ! -e "$SOURCE" ] && fail "Missing source file: $SOURCE" + for TARGET in "${TARGETS[@]}" + do + [ ! -e "$TARGET" -o "$SOURCE" -nt "$TARGET" ] && OUTDATED=true + done +done + +if [ "$OUTDATED" = true ] +then + echo "###" + echo "### Building Isabelle/Scala components ..." + echo "###" + + rm -rf classes && mkdir classes + "$SCALA_HOME/bin/scalac" -unchecked -deprecation -d classes -target jvm-1.5 "${SOURCES[@]}" || \ + fail "Failed to compile sources" + mkdir -p "$TARGET_DIR" || fail "Failed to create directory $TARGET_DIR" + ( + cd classes + jar cfe "$(jvmpath "$PURE_JAR")" isabelle.GUI_Setup isabelle || \ + fail "Failed to produce $PURE_JAR" + + cp "$SCALA_HOME/lib/scala-swing.jar" . + jar xf scala-swing.jar + + cp "$SCALA_HOME/lib/scala-library.jar" "$FULL_JAR" + jar ufe "$(jvmpath "$FULL_JAR")" isabelle.GUI_Setup isabelle scala || \ + fail "Failed to produce $FULL_JAR" + ) + rm -rf classes +fi diff -r 7911e83d06c0 -r 33ad3571ad83 src/Pure/mk-jars --- a/src/Pure/mk-jars Wed Jan 06 22:18:52 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,98 +0,0 @@ -#!/usr/bin/env bash -# -# Author: Makarius -# -# mk-jars - build Isabelle/Scala -# -# Requires proper Isabelle settings environment. - - -## diagnostics - -function fail() -{ - echo "$1" >&2 - exit 2 -} - -[ -n "$ISABELLE_HOME" ] || fail "Missing Isabelle settings environment" -[ -z "$SCALA_HOME" ] && fail "Scala unavailable: unknown SCALA_HOME" - - -## dependencies - -declare -a SOURCES=( - Concurrent/future.scala - General/download.scala - General/event_bus.scala - General/exn.scala - General/linear_set.scala - General/markup.scala - General/position.scala - General/scan.scala - General/swing_thread.scala - General/symbol.scala - General/xml.scala - General/yxml.scala - Isar/isar_document.scala - Isar/outer_keyword.scala - Isar/outer_lex.scala - Isar/outer_parse.scala - Isar/outer_syntax.scala - System/cygwin.scala - System/gui_setup.scala - System/isabelle_process.scala - System/isabelle_syntax.scala - System/isabelle_system.scala - System/platform.scala - System/session_manager.scala - System/standard_system.scala - Thy/completion.scala - Thy/html.scala - Thy/text_edit.scala - Thy/thy_header.scala - Thy/thy_syntax.scala - library.scala -) - -JAR_DIR="$ISABELLE_HOME/lib/classes" -PURE_JAR="$JAR_DIR/Pure.jar" -FULL_JAR="$JAR_DIR/isabelle-scala.jar" - - -## main - -OUTDATED=false - -for SOURCE in "${SOURCES[@]}" -do - [ ! -e "$SOURCE" ] && fail "Missing source file: $SOURCE" - for TARGET in "$PURE_JAR" "$FULL_JAR" - do - [ ! -e "$TARGET" -o "$SOURCE" -nt "$TARGET" ] && OUTDATED=true - done -done - -if [ "$OUTDATED" = true ]; then - echo "###" - echo "### Building Isabelle/Scala components ..." - echo "###" - - rm -rf classes && mkdir classes - "$SCALA_HOME/bin/scalac" -unchecked -deprecation -d classes -target jvm-1.5 "${SOURCES[@]}" || \ - fail "Failed to compile sources" - mkdir -p "$JAR_DIR" || fail "Failed to create directory $JAR_DIR" - ( - cd classes - jar cfe "$(jvmpath "$PURE_JAR")" isabelle.GUI_Setup isabelle || \ - fail "Failed to produce $PURE_JAR" - - cp "$SCALA_HOME/lib/scala-swing.jar" . - jar xf scala-swing.jar - - cp "$SCALA_HOME/lib/scala-library.jar" "$FULL_JAR" - jar ufe "$(jvmpath "$FULL_JAR")" isabelle.GUI_Setup isabelle scala || \ - fail "Failed to produce $FULL_JAR" - ) - rm -rf classes -fi