author | noschinl |
Fri, 16 Sep 2011 20:02:35 +0200 | |
changeset 44940 | 56fd289398a2 |
parent 43536 | 6eec653d5599 |
permissions | -rwxr-xr-x |
43518 | 1 |
#!/usr/bin/env bash |
2 |
# |
|
3 |
# Author: Makarius |
|
4 |
# |
|
5 |
# Augment Java extension directories. |
|
6 |
||
7 |
## diagnostics |
|
8 |
||
9 |
function fail() |
|
10 |
{ |
|
11 |
echo "$1" >&2 |
|
12 |
exit 2 |
|
13 |
} |
|
14 |
||
15 |
||
16 |
## dependencies |
|
17 |
||
18 |
SOURCE="$ISABELLE_HOME/src/Pure/System/Java_Ext_Dirs.java" |
|
19 |
||
20 |
TARGET_DIR="$ISABELLE_HOME/lib/classes" |
|
21 |
TARGET="$TARGET_DIR/java_ext_dirs.jar" |
|
22 |
||
23 |
if [ ! -e "$TARGET" -o "$SOURCE" -nt "$TARGET" ]; then |
|
24 |
mkdir -p "$TARGET_DIR" || fail "Bad directory: \"$TARGET_DIR\"" |
|
25 |
pushd "$TARGET_DIR" >/dev/null |
|
26 |
||
43536 | 27 |
BUILD="build$$" |
28 |
TMP_JAR="java_ext_dirs$$.jar" |
|
29 |
||
30 |
rm -rf "$BUILD" && mkdir "$BUILD" |
|
31 |
javac -d "$BUILD" -source 1.5 "$(jvmpath "$SOURCE")" || fail "Failed to compile sources" |
|
32 |
jar cf "$TMP_JAR" -C "$BUILD" . || fail "Failed to produce $TMP_JAR" |
|
33 |
mv "$TMP_JAR" "$TARGET" |
|
34 |
rm -rf "$BUILD" |
|
43518 | 35 |
|
36 |
popd >/dev/null |
|
37 |
fi |
|
38 |
||
39 |
||
40 |
## main |
|
41 |
||
42 |
JAVA_EXE="${THIS_JAVA:-$ISABELLE_JAVA}" |
|
43521
d477b92109b8
provide Isabelle/Scala environment as Java extension, instead of user classpath
wenzelm
parents:
43518
diff
changeset
|
43 |
exec "$JAVA_EXE" -classpath "$(jvmpath "$TARGET")" isabelle.Java_Ext_Dirs \ |
d477b92109b8
provide Isabelle/Scala environment as Java extension, instead of user classpath
wenzelm
parents:
43518
diff
changeset
|
44 |
"$(jvmpath "$ISABELLE_HOME/lib/classes/ext")" |
43518 | 45 |