5 # build-jars - build Isabelle/Scala
7 # Requires proper Isabelle settings environment.
12 Concurrent/future.scala
13 Concurrent/simple_thread.scala
14 Concurrent/volatile.scala
17 General/linear_set.scala
19 General/position.scala
25 General/xml_data.scala
28 Isar/outer_syntax.scala
33 PIDE/isar_document.scala
34 PIDE/markup_tree.scala
38 System/event_bus.scala
39 System/gui_setup.scala
40 System/isabelle_process.scala
41 System/isabelle_syntax.scala
42 System/isabelle_system.scala
45 System/session_manager.scala
46 System/standard_system.scala
47 System/swing_thread.scala
59 PRG="$(basename "$0")"
64 echo "Usage: isabelle $PRG [OPTIONS]"
67 echo " -f fresh build"
78 [ -z "$ISABELLE_HOME" ] && fail "Missing Isabelle settings environment"
79 [ -z "$SCALA_HOME" ] && fail "Unknown SCALA_HOME -- Scala unavailable"
82 ## process command line
100 shift $(($OPTIND - 1))
105 [ "$#" -ne 0 ] && usage
111 TARGET_DIR="$ISABELLE_HOME/lib/classes"
112 PURE_JAR="$TARGET_DIR/Pure.jar"
113 FULL_JAR="$TARGET_DIR/isabelle-scala.jar"
115 declare -a TARGETS=("$PURE_JAR" "$FULL_JAR")
120 declare -a UPDATED=()
122 if [ -n "$FRESH" ]; then
126 for TARGET in "${TARGETS[@]}"
128 [ ! -e "$TARGET" ] && OUTDATED=true
130 if [ "$OUTDATED" = false ]; then
131 for DEP in "${SOURCES[@]}"
133 [ ! -e "$DEP" ] && fail "Missing file: $DEP"
135 for TARGET in "${TARGETS[@]}"
137 [ "$DEP" -nt "$TARGET" ] && {
142 [ -n "$UPDATE" ] && UPDATED["${#UPDATED[@]}"]="$DEP"
147 if [ "$OUTDATED" = true ]
150 echo "### Building Isabelle/Scala layer ..."
153 [ "${#UPDATED[@]}" -gt 0 ] && {
154 echo "Changed files:"
155 for FILE in "${UPDATED[@]}"
161 rm -rf classes && mkdir classes
162 "$SCALA_HOME/bin/scalac" -unchecked -deprecation -d classes -target:jvm-1.5 "${SOURCES[@]}" || \
163 fail "Failed to compile sources"
164 mkdir -p "$TARGET_DIR" || fail "Failed to create directory $TARGET_DIR"
166 pushd classes >/dev/null
168 jar cfe "$(jvmpath "$PURE_JAR")" isabelle.GUI_Setup isabelle || \
169 fail "Failed to produce $PURE_JAR"
171 cp "$SCALA_HOME/lib/scala-swing.jar" .
172 jar xf scala-swing.jar
174 cp "$SCALA_HOME/lib/scala-library.jar" "$FULL_JAR"
175 jar ufe "$(jvmpath "$FULL_JAR")" isabelle.GUI_Setup isabelle scala || \
176 fail "Failed to produce $FULL_JAR"