author | wenzelm |
Thu, 23 Jun 2011 16:10:22 +0200 | |
changeset 43521 | d477b92109b8 |
parent 43518 | 7cad71ca9bcc |
child 43522 | 2562d6c81b03 |
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 |
||
27 |
rm -rf classes && mkdir classes |
|
28 |
javac -d classes -source 1.5 "$SOURCE" || fail "Failed to compile sources" |
|
29 |
jar cf "$(jvmpath "$TARGET")" -C classes . || fail "Failed to produce $TARGET" |
|
30 |
rm -rf classes |
|
31 |
||
32 |
popd >/dev/null |
|
33 |
fi |
|
34 |
||
35 |
||
36 |
## main |
|
37 |
||
38 |
JAVA_EXE="${THIS_JAVA:-$ISABELLE_JAVA}" |
|
43521
d477b92109b8
provide Isabelle/Scala environment as Java extension, instead of user classpath
wenzelm
parents:
43518
diff
changeset
|
39 |
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
|
40 |
"$(jvmpath "$ISABELLE_HOME/lib/classes/ext")" |
43518 | 41 |