author | wenzelm |
Wed, 05 Dec 2012 18:09:38 +0100 | |
changeset 50373 | 025f758fa24b |
parent 50306 | b655d2d0406d |
child 50403 | 87868964733c |
permissions | -rwxr-xr-x |
34333 | 1 |
#!/usr/bin/env bash |
2 |
# |
|
34664 | 3 |
# Author: Makarius |
4 |
# |
|
5 |
# DESCRIPTION: Isabelle/jEdit interface wrapper |
|
6 |
||
34333 | 7 |
|
43285 | 8 |
## sources |
9 |
||
43320 | 10 |
declare -a SOURCES=( |
43285 | 11 |
"src/dockable.scala" |
12 |
"src/document_model.scala" |
|
13 |
"src/document_view.scala" |
|
49570 | 14 |
"src/graphview_dockable.scala" |
43285 | 15 |
"src/html_panel.scala" |
48921
5d8d409b897e
support for direct hyperlinks, without the Hyperlinks plugin;
wenzelm
parents:
48791
diff
changeset
|
16 |
"src/hyperlink.scala" |
49726 | 17 |
"src/info_dockable.scala" |
50208 | 18 |
"src/isabelle.scala" |
43285 | 19 |
"src/isabelle_encoding.scala" |
49246 | 20 |
"src/isabelle_logic.scala" |
43285 | 21 |
"src/isabelle_options.scala" |
22 |
"src/isabelle_sidekick.scala" |
|
49406 | 23 |
"src/jedit_lib.scala" |
49600 | 24 |
"src/jedit_main.scala" |
50202 | 25 |
"src/jedit_options.scala" |
44577
96b6388d06c4
separate module for jEdit primitives for loading theory files;
wenzelm
parents:
44565
diff
changeset
|
26 |
"src/jedit_thy_load.scala" |
43285 | 27 |
"src/output_dockable.scala" |
28 |
"src/plugin.scala" |
|
49398
0fa4389c04f9
alternative output panel, based on Pretty_Text_Area, based on JEditEmbeddedTextArea;
wenzelm
parents:
49246
diff
changeset
|
29 |
"src/pretty_text_area.scala" |
49702 | 30 |
"src/pretty_tooltip.scala" |
43285 | 31 |
"src/protocol_dockable.scala" |
32 |
"src/raw_output_dockable.scala" |
|
48014
63021e59cbf0
separate README dockable, which allows to make it more prominent first and remove it later;
wenzelm
parents:
47995
diff
changeset
|
33 |
"src/readme_dockable.scala" |
50202 | 34 |
"src/rendering.scala" |
49411 | 35 |
"src/rich_text_area.scala" |
43285 | 36 |
"src/scala_console.scala" |
49492 | 37 |
"src/sendback.scala" |
50143
4ff5d795ed08
dockable with buttons for symbols, grouped and sorted in tabs according to ~~/etc/symbols;
immler
parents:
50120
diff
changeset
|
38 |
"src/symbols_dockable.scala" |
48021
d899be1cfe6d
separate syslog dockable -- discontinued tendency of sub-window management via tabs;
wenzelm
parents:
48014
diff
changeset
|
39 |
"src/syslog_dockable.scala" |
46572 | 40 |
"src/text_overview.scala" |
50299 | 41 |
"src/theories_dockable.scala" |
43414 | 42 |
"src/token_markup.scala" |
43285 | 43 |
) |
44 |
||
43320 | 45 |
declare -a RESOURCES=( |
43286 | 46 |
"src/actions.xml" |
47 |
"src/dockables.xml" |
|
48 |
"src/Isabelle.props" |
|
50306 | 49 |
"src/jEdit.props" |
43286 | 50 |
"src/services.xml" |
43285 | 51 |
) |
52 |
||
53 |
||
34333 | 54 |
## diagnostics |
55 |
||
34664 | 56 |
PRG="$(basename "$0")" |
57 |
||
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
58 |
function usage() |
34333 | 59 |
{ |
60 |
echo |
|
34664 | 61 |
echo "Usage: isabelle $PRG [OPTIONS] [FILES ...]" |
34333 | 62 |
echo |
63 |
echo " Options are:" |
|
64 |
echo " -J OPTION add JVM runtime option" |
|
34409 | 65 |
echo " (default JEDIT_JAVA_OPTIONS=$JEDIT_JAVA_OPTIONS)" |
43285 | 66 |
echo " -b build only" |
48791 | 67 |
echo " -d DIR include session directory" |
43285 | 68 |
echo " -f fresh build" |
34333 | 69 |
echo " -j OPTION add jEdit runtime option" |
70 |
echo " (default JEDIT_OPTIONS=$JEDIT_OPTIONS)" |
|
50373 | 71 |
echo " -l NAME logic session name (default ISABELLE_LOGIC=$ISABELLE_LOGIC)" |
34333 | 72 |
echo " -m MODE add print mode for output" |
50373 | 73 |
echo " -s system build mode for session image" |
34333 | 74 |
echo |
34664 | 75 |
echo "Start jEdit with Isabelle plugin setup and opens theory FILES" |
50114 | 76 |
echo "(default \"$USER_HOME/Scratch.thy\")." |
34333 | 77 |
echo |
78 |
exit 1 |
|
79 |
} |
|
80 |
||
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
81 |
function fail() |
34333 | 82 |
{ |
83 |
echo "$1" >&2 |
|
84 |
exit 2 |
|
85 |
} |
|
86 |
||
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
87 |
function failed() |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
88 |
{ |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
89 |
fail "Failed!" |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
90 |
} |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
91 |
|
34333 | 92 |
|
93 |
## process command line |
|
94 |
||
95 |
# options |
|
96 |
||
50373 | 97 |
declare -a BUILD_DIALOG_OPTIONS=() |
98 |
||
43285 | 99 |
BUILD_ONLY=false |
100 |
BUILD_JARS="jars" |
|
48791 | 101 |
JEDIT_SESSION_DIRS="" |
34333 | 102 |
JEDIT_LOGIC="$ISABELLE_LOGIC" |
103 |
JEDIT_PRINT_MODE="" |
|
104 |
||
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
105 |
function getoptions() |
34780 | 106 |
{ |
107 |
OPTIND=1 |
|
50373 | 108 |
while getopts "J:bd:fj:l:m:s" OPT |
34780 | 109 |
do |
110 |
case "$OPT" in |
|
111 |
J) |
|
112 |
JAVA_ARGS["${#JAVA_ARGS[@]}"]="$OPTARG" |
|
113 |
;; |
|
43285 | 114 |
b) |
115 |
BUILD_ONLY=true |
|
116 |
;; |
|
48791 | 117 |
d) |
118 |
if [ -z "$JEDIT_SESSION_DIRS" ]; then |
|
119 |
JEDIT_SESSION_DIRS="$OPTARG" |
|
120 |
else |
|
121 |
JEDIT_SESSION_DIRS="$JEDIT_SESSION_DIRS:$OPTARG" |
|
122 |
fi |
|
50373 | 123 |
BUILD_DIALOG_OPTIONS["${#BUILD_DIALOG_OPTIONS[@]}"]="-d" |
124 |
BUILD_DIALOG_OPTIONS["${#BUILD_DIALOG_OPTIONS[@]}"]="$OPTARG" |
|
48791 | 125 |
;; |
43285 | 126 |
f) |
127 |
BUILD_JARS="jars_fresh" |
|
128 |
;; |
|
34780 | 129 |
j) |
130 |
ARGS["${#ARGS[@]}"]="$OPTARG" |
|
131 |
;; |
|
132 |
l) |
|
133 |
JEDIT_LOGIC="$OPTARG" |
|
134 |
;; |
|
135 |
m) |
|
136 |
if [ -z "$JEDIT_PRINT_MODE" ]; then |
|
137 |
JEDIT_PRINT_MODE="$OPTARG" |
|
138 |
else |
|
139 |
JEDIT_PRINT_MODE="$JEDIT_PRINT_MODE,$OPTARG" |
|
140 |
fi |
|
141 |
;; |
|
50373 | 142 |
s) |
143 |
BUILD_DIALOG_OPTIONS["${#BUILD_DIALOG_OPTIONS[@]}"]="-s" |
|
144 |
;; |
|
34780 | 145 |
\?) |
146 |
usage |
|
147 |
;; |
|
148 |
esac |
|
149 |
done |
|
150 |
} |
|
34581
abab3a577e10
slightly more robust treatment of options via arrays;
wenzelm
parents:
34412
diff
changeset
|
151 |
|
38257
f0fd14a9c11f
clarified JEDIT_JAVA_OPTIONS vs. JEDIT_SYSTEM_OPTIONS -- discontinued JEDIT_APPLE_PROPERTIES;
wenzelm
parents:
34881
diff
changeset
|
152 |
declare -a JAVA_ARGS; eval "JAVA_ARGS=($JEDIT_JAVA_OPTIONS $JEDIT_SYSTEM_OPTIONS)" |
34843
eb8806a2e348
define scala.home, for more robust startup of Scala tools, notably the compiler;
wenzelm
parents:
34790
diff
changeset
|
153 |
[ -n "$SCALA_HOME" ] && JAVA_ARGS["${#JAVA_ARGS[@]}"]="-Dscala.home=$SCALA_HOME" |
eb8806a2e348
define scala.home, for more robust startup of Scala tools, notably the compiler;
wenzelm
parents:
34790
diff
changeset
|
154 |
|
34780 | 155 |
declare -a ARGS; eval "ARGS=($JEDIT_OPTIONS)" |
34333 | 156 |
|
34780 | 157 |
declare -a OPTIONS; eval "OPTIONS=($ISABELLE_JEDIT_OPTIONS)" |
158 |
getoptions "${OPTIONS[@]}" |
|
159 |
||
160 |
getoptions "$@" |
|
34333 | 161 |
shift $(($OPTIND - 1)) |
162 |
||
163 |
||
164 |
# args |
|
165 |
||
44485
2f0a34fc4d2d
back to tradition Scratch.thy default -- execution wrt. perspective overcomes the main problems of 226563829580;
wenzelm
parents:
43695
diff
changeset
|
166 |
if [ "$#" -eq 0 ]; then |
50120 | 167 |
ARGS["${#ARGS[@]}"]="$(jvmpath "$USER_HOME/Scratch.thy")" |
44485
2f0a34fc4d2d
back to tradition Scratch.thy default -- execution wrt. perspective overcomes the main problems of 226563829580;
wenzelm
parents:
43695
diff
changeset
|
168 |
else |
2f0a34fc4d2d
back to tradition Scratch.thy default -- execution wrt. perspective overcomes the main problems of 226563829580;
wenzelm
parents:
43695
diff
changeset
|
169 |
while [ "$#" -gt 0 ]; do |
2f0a34fc4d2d
back to tradition Scratch.thy default -- execution wrt. perspective overcomes the main problems of 226563829580;
wenzelm
parents:
43695
diff
changeset
|
170 |
ARGS["${#ARGS[@]}"]="$(jvmpath "$1")" |
2f0a34fc4d2d
back to tradition Scratch.thy default -- execution wrt. perspective overcomes the main problems of 226563829580;
wenzelm
parents:
43695
diff
changeset
|
171 |
shift |
2f0a34fc4d2d
back to tradition Scratch.thy default -- execution wrt. perspective overcomes the main problems of 226563829580;
wenzelm
parents:
43695
diff
changeset
|
172 |
done |
2f0a34fc4d2d
back to tradition Scratch.thy default -- execution wrt. perspective overcomes the main problems of 226563829580;
wenzelm
parents:
43695
diff
changeset
|
173 |
fi |
34333 | 174 |
|
175 |
||
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
176 |
## dependencies |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
177 |
|
49953 | 178 |
if [ -e "$ISABELLE_HOME/Admin/build" ]; then |
179 |
if [ "$BUILD_JARS" = jars_fresh ]; then |
|
180 |
"$ISABELLE_TOOL" graphview -b -f || exit $? |
|
181 |
else |
|
49566
66cbf8bb4693
basic integration of graphview into document model;
wenzelm
parents:
49494
diff
changeset
|
182 |
"$ISABELLE_HOME/Admin/build" "$BUILD_JARS" || exit $? |
49953 | 183 |
"$ISABELLE_TOOL" graphview -b || exit $? |
184 |
fi |
|
185 |
fi |
|
43413 | 186 |
|
43523 | 187 |
PURE_JAR="$ISABELLE_HOME/lib/classes/ext/Pure.jar" |
49566
66cbf8bb4693
basic integration of graphview into document model;
wenzelm
parents:
49494
diff
changeset
|
188 |
GRAPHVIEW_JAR="$ISABELLE_HOME/lib/classes/ext/Graphview.jar" |
43413 | 189 |
|
43285 | 190 |
pushd "$JEDIT_HOME" >/dev/null || failed |
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
191 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
192 |
JEDIT_JAR="$ISABELLE_JEDIT_BUILD_HOME/contrib/$ISABELLE_JEDIT_BUILD_VERSION/jedit.jar" |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
193 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
194 |
JEDIT_JARS=( |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
195 |
"$ISABELLE_JEDIT_BUILD_HOME/contrib/Console.jar" |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
196 |
"$ISABELLE_JEDIT_BUILD_HOME/contrib/ErrorList.jar" |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
197 |
"$ISABELLE_JEDIT_BUILD_HOME/contrib/SideKick.jar" |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
198 |
"$ISABELLE_JEDIT_BUILD_HOME/contrib/cobra.jar" |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
199 |
"$ISABELLE_JEDIT_BUILD_HOME/contrib/js.jar" |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
200 |
) |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
201 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
202 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
203 |
# target |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
204 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
205 |
TARGET="dist/jars/Isabelle-jEdit.jar" |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
206 |
|
43384 | 207 |
declare -a UPDATED=() |
208 |
||
43285 | 209 |
if [ "$BUILD_JARS" = jars_fresh ]; then |
210 |
OUTDATED=true |
|
211 |
else |
|
212 |
OUTDATED=false |
|
43368
0dc67b3cf8a5
check source dependencies only if jedit_build component is available;
wenzelm
parents:
43320
diff
changeset
|
213 |
if [ ! -e "$TARGET" ]; then |
0dc67b3cf8a5
check source dependencies only if jedit_build component is available;
wenzelm
parents:
43320
diff
changeset
|
214 |
OUTDATED=true |
43384 | 215 |
else |
216 |
if [ -n "$ISABELLE_JEDIT_BUILD_HOME" ]; then |
|
49566
66cbf8bb4693
basic integration of graphview into document model;
wenzelm
parents:
49494
diff
changeset
|
217 |
declare -a DEPS=( |
66cbf8bb4693
basic integration of graphview into document model;
wenzelm
parents:
49494
diff
changeset
|
218 |
"$JEDIT_JAR" "${JEDIT_JARS[@]}" |
66cbf8bb4693
basic integration of graphview into document model;
wenzelm
parents:
49494
diff
changeset
|
219 |
"$PURE_JAR" "$GRAPHVIEW_JAR" "${SOURCES[@]}" "${RESOURCES[@]}" |
66cbf8bb4693
basic integration of graphview into document model;
wenzelm
parents:
49494
diff
changeset
|
220 |
) |
47666
cf5fe7eb6793
pretend jedit is up-to-date if this is not a repository -- avoid accidental build attempts after touching files etc.;
wenzelm
parents:
47115
diff
changeset
|
221 |
elif [ -e "$ISABELLE_HOME/Admin/build" ]; then |
49566
66cbf8bb4693
basic integration of graphview into document model;
wenzelm
parents:
49494
diff
changeset
|
222 |
declare -a DEPS=("$PURE_JAR" "$GRAPHVIEW_JAR" "${SOURCES[@]}" "${RESOURCES[@]}") |
43384 | 223 |
else |
47666
cf5fe7eb6793
pretend jedit is up-to-date if this is not a repository -- avoid accidental build attempts after touching files etc.;
wenzelm
parents:
47115
diff
changeset
|
224 |
declare -a DEPS=() |
43384 | 225 |
fi |
226 |
for DEP in "${DEPS[@]}" |
|
43368
0dc67b3cf8a5
check source dependencies only if jedit_build component is available;
wenzelm
parents:
43320
diff
changeset
|
227 |
do |
43384 | 228 |
[ ! -e "$DEP" ] && fail "Missing file: $DEP" |
229 |
[ "$DEP" -nt "$TARGET" ] && { |
|
230 |
OUTDATED=true |
|
231 |
UPDATED["${#UPDATED[@]}"]="$DEP" |
|
232 |
} |
|
43368
0dc67b3cf8a5
check source dependencies only if jedit_build component is available;
wenzelm
parents:
43320
diff
changeset
|
233 |
done |
0dc67b3cf8a5
check source dependencies only if jedit_build component is available;
wenzelm
parents:
43320
diff
changeset
|
234 |
fi |
43285 | 235 |
fi |
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
236 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
237 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
238 |
# build |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
239 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
240 |
if [ "$OUTDATED" = true ] |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
241 |
then |
43405 | 242 |
echo "### Building Isabelle/jEdit ..." |
243 |
||
43384 | 244 |
[ "${#UPDATED[@]}" -gt 0 ] && { |
43405 | 245 |
echo "Changed files:" |
43384 | 246 |
for FILE in "${UPDATED[@]}" |
247 |
do |
|
248 |
echo " $FILE" |
|
249 |
done |
|
250 |
} |
|
251 |
||
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
252 |
[ -z "$ISABELLE_JEDIT_BUILD_HOME" ] && \ |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
253 |
fail "Unknown ISABELLE_JEDIT_BUILD_HOME -- missing auxiliary component" |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
254 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
255 |
rm -rf dist || failed |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
256 |
mkdir -p dist dist/classes || failed |
43287 | 257 |
|
46502
3d43d4d4d071
more uniform / portable representation of the idea of "copy_dir" (NB: cp -f dereferences symlinks on GNU/Linux, but does not on old-school Unixen including BSD/Mac OS X);
wenzelm
parents:
45665
diff
changeset
|
258 |
cp -p -R -f "$ISABELLE_JEDIT_BUILD_HOME/contrib/$ISABELLE_JEDIT_BUILD_VERSION/." dist/. |
3d43d4d4d071
more uniform / portable representation of the idea of "copy_dir" (NB: cp -f dereferences symlinks on GNU/Linux, but does not on old-school Unixen including BSD/Mac OS X);
wenzelm
parents:
45665
diff
changeset
|
259 |
cp -p -R -f "${RESOURCES[@]}" dist/classes/. |
43287 | 260 |
cp src/jEdit.props dist/properties/. |
46502
3d43d4d4d071
more uniform / portable representation of the idea of "copy_dir" (NB: cp -f dereferences symlinks on GNU/Linux, but does not on old-school Unixen including BSD/Mac OS X);
wenzelm
parents:
45665
diff
changeset
|
261 |
cp -p -R -f src/modes/. dist/modes/. |
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
262 |
|
43391 | 263 |
perl -i -e 'while (<>) { |
264 |
if (m/NAME="javacc"/) { |
|
265 |
print qq,<MODE NAME="isabelle" FILE="isabelle.xml" FILE_NAME_GLOB="*.thy"/>\n\n,; |
|
48366 | 266 |
print qq,<MODE NAME="isabelle-options" FILE="isabelle-options.xml"/>\n\n,; |
48575 | 267 |
print qq,<MODE NAME="isabelle-root" FILE="isabelle-root.xml" FILE_NAME_GLOB="ROOT"/>\n\n,; } |
43391 | 268 |
elsif (m/NAME="scheme"/) { |
269 |
print qq,<MODE NAME="scala" FILE="scala.xml" FILE_NAME_GLOB="*.scala" />\n\n,; } |
|
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
270 |
print; }' dist/modes/catalog |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
271 |
|
47995
72f52cd7c633
include scala-compiler.jar in basic Isabelle/Scala environment, to make Isabelle/jEdit console work with scala-2.10.0-M3;
wenzelm
parents:
47849
diff
changeset
|
272 |
cp -p -R -f "${JEDIT_JARS[@]}" dist/jars/. || failed |
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
273 |
( |
49566
66cbf8bb4693
basic integration of graphview into document model;
wenzelm
parents:
49494
diff
changeset
|
274 |
for JAR in "$JEDIT_JAR" "${JEDIT_JARS[@]}" "$PURE_JAR" "$GRAPHVIEW_JAR" \ |
66cbf8bb4693
basic integration of graphview into document model;
wenzelm
parents:
49494
diff
changeset
|
275 |
"$SCALA_HOME/lib/scala-compiler.jar" |
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
276 |
do |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
277 |
CLASSPATH="$CLASSPATH:$JAR" |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
278 |
done |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
279 |
CLASSPATH="$(jvmpath "$CLASSPATH")" |
47009 | 280 |
exec "$SCALA_HOME/bin/scalac" $ISABELLE_SCALA_BUILD_OPTIONS -d dist/classes "${SOURCES[@]}" |
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
281 |
) || fail "Failed to compile sources" |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
282 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
283 |
cd dist/classes |
47115
1a05adae1cc9
more robust command invocation via ISABELLE_JDK_HOME or SCALA_HOME (NB: bash exec requires genuine executable, not function);
wenzelm
parents:
47113
diff
changeset
|
284 |
isabelle_jdk jar cf "../jars/Isabelle-jEdit.jar" * || failed |
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
285 |
cd ../.. |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
286 |
rm -rf dist/classes |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
287 |
fi |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
288 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
289 |
popd >/dev/null |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
290 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
291 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
292 |
## main |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
293 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
294 |
# perspective |
34880 | 295 |
|
296 |
mkdir -p "$JEDIT_SETTINGS/DockableWindowManager" |
|
297 |
||
298 |
if [ ! -e "$JEDIT_SETTINGS/perspective.xml" ]; then |
|
299 |
cat > "$JEDIT_SETTINGS/DockableWindowManager/perspective-view0.xml" <<EOF |
|
48014
63021e59cbf0
separate README dockable, which allows to make it more prominent first and remove it later;
wenzelm
parents:
47995
diff
changeset
|
300 |
<DOCKING LEFT="" TOP="" RIGHT="" BOTTOM="isabelle-readme" LEFT_POS="0" TOP_POS="0" RIGHT_POS="250" BOTTOM_POS="250" /> |
34880 | 301 |
EOF |
302 |
cat > "$JEDIT_SETTINGS/perspective.xml" <<EOF |
|
303 |
<?xml version="1.0" encoding="UTF-8" ?> |
|
304 |
<!DOCTYPE PERSPECTIVE SYSTEM "perspective.dtd"> |
|
305 |
<PERSPECTIVE> |
|
306 |
<VIEW PLAIN="FALSE"> |
|
307 |
<GEOMETRY X="0" Y="35" WIDTH="1072" HEIGHT="787" EXT_STATE="0" /> |
|
308 |
</VIEW> |
|
309 |
</PERSPECTIVE> |
|
310 |
EOF |
|
311 |
fi |
|
312 |
||
313 |
||
50373 | 314 |
# build logic |
315 |
||
316 |
"$ISABELLE_TOOL" build_dialog "${BUILD_DIALOG_OPTIONS[@]}" -C "$JEDIT_LOGIC" |
|
317 |
RC="$?" |
|
318 |
[ "$RC" = 0 ] || exit "$RC" |
|
319 |
||
320 |
||
321 |
# main |
|
34333 | 322 |
|
43285 | 323 |
[ "$BUILD_ONLY" = true ] || { |
48791 | 324 |
export JEDIT_SESSION_DIRS JEDIT_LOGIC JEDIT_PRINT_MODE |
34333 | 325 |
|
43285 | 326 |
exec "$ISABELLE_TOOL" java "${JAVA_ARGS[@]}" \ |
327 |
-jar "$(jvmpath "$JEDIT_HOME/dist/jedit.jar")" \ |
|
328 |
"-settings=$(jvmpath "$JEDIT_SETTINGS")" "${ARGS[@]}" |
|
329 |
} |