author | immler |
Wed, 21 Nov 2012 10:51:12 +0100 | |
changeset 50143 | 4ff5d795ed08 |
parent 50120 | 245f5947233c |
child 50183 | 2b3e24e1c9e7 |
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" |
43285 | 18 |
"src/isabelle_encoding.scala" |
49246 | 19 |
"src/isabelle_logic.scala" |
43285 | 20 |
"src/isabelle_options.scala" |
45665
129db1416717
renamed Isabelle_Markup to Isabelle_Rendering to emphasize its meaning and make room for Pure Isabelle_Markup module;
wenzelm
parents:
45158
diff
changeset
|
21 |
"src/isabelle_rendering.scala" |
43285 | 22 |
"src/isabelle_sidekick.scala" |
49406 | 23 |
"src/jedit_lib.scala" |
49600 | 24 |
"src/jedit_main.scala" |
44577
96b6388d06c4
separate module for jEdit primitives for loading theory files;
wenzelm
parents:
44565
diff
changeset
|
25 |
"src/jedit_thy_load.scala" |
49245
cb70157293c0
manage Isabelle/jEdit options as Isabelle/Scala options (with persistent preferences);
wenzelm
parents:
48921
diff
changeset
|
26 |
"src/jedit_options.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" |
49411 | 34 |
"src/rich_text_area.scala" |
43285 | 35 |
"src/scala_console.scala" |
49492 | 36 |
"src/sendback.scala" |
43285 | 37 |
"src/session_dockable.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" |
43414 | 41 |
"src/token_markup.scala" |
43285 | 42 |
) |
43 |
||
43320 | 44 |
declare -a RESOURCES=( |
43286 | 45 |
"src/actions.xml" |
46 |
"src/dockables.xml" |
|
47 |
"src/Isabelle.props" |
|
48 |
"src/services.xml" |
|
43285 | 49 |
) |
50 |
||
51 |
||
34333 | 52 |
## diagnostics |
53 |
||
34664 | 54 |
PRG="$(basename "$0")" |
55 |
||
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
56 |
function usage() |
34333 | 57 |
{ |
58 |
echo |
|
34664 | 59 |
echo "Usage: isabelle $PRG [OPTIONS] [FILES ...]" |
34333 | 60 |
echo |
61 |
echo " Options are:" |
|
62 |
echo " -J OPTION add JVM runtime option" |
|
34409 | 63 |
echo " (default JEDIT_JAVA_OPTIONS=$JEDIT_JAVA_OPTIONS)" |
43285 | 64 |
echo " -b build only" |
48791 | 65 |
echo " -d DIR include session directory" |
43285 | 66 |
echo " -f fresh build" |
34333 | 67 |
echo " -j OPTION add jEdit runtime option" |
68 |
echo " (default JEDIT_OPTIONS=$JEDIT_OPTIONS)" |
|
69 |
echo " -l NAME logic image name (default ISABELLE_LOGIC=$ISABELLE_LOGIC)" |
|
70 |
echo " -m MODE add print mode for output" |
|
71 |
echo |
|
34664 | 72 |
echo "Start jEdit with Isabelle plugin setup and opens theory FILES" |
50114 | 73 |
echo "(default \"$USER_HOME/Scratch.thy\")." |
34333 | 74 |
echo |
75 |
exit 1 |
|
76 |
} |
|
77 |
||
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
78 |
function fail() |
34333 | 79 |
{ |
80 |
echo "$1" >&2 |
|
81 |
exit 2 |
|
82 |
} |
|
83 |
||
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
84 |
function failed() |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
85 |
{ |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
86 |
fail "Failed!" |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
87 |
} |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
88 |
|
34333 | 89 |
|
90 |
## process command line |
|
91 |
||
92 |
# options |
|
93 |
||
43285 | 94 |
BUILD_ONLY=false |
95 |
BUILD_JARS="jars" |
|
48791 | 96 |
JEDIT_SESSION_DIRS="" |
34333 | 97 |
JEDIT_LOGIC="$ISABELLE_LOGIC" |
98 |
JEDIT_PRINT_MODE="" |
|
99 |
||
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
100 |
function getoptions() |
34780 | 101 |
{ |
102 |
OPTIND=1 |
|
48791 | 103 |
while getopts "J:bd:fj:l:m:" OPT |
34780 | 104 |
do |
105 |
case "$OPT" in |
|
106 |
J) |
|
107 |
JAVA_ARGS["${#JAVA_ARGS[@]}"]="$OPTARG" |
|
108 |
;; |
|
43285 | 109 |
b) |
110 |
BUILD_ONLY=true |
|
111 |
;; |
|
48791 | 112 |
d) |
113 |
if [ -z "$JEDIT_SESSION_DIRS" ]; then |
|
114 |
JEDIT_SESSION_DIRS="$OPTARG" |
|
115 |
else |
|
116 |
JEDIT_SESSION_DIRS="$JEDIT_SESSION_DIRS:$OPTARG" |
|
117 |
fi |
|
118 |
;; |
|
43285 | 119 |
f) |
120 |
BUILD_JARS="jars_fresh" |
|
121 |
;; |
|
34780 | 122 |
j) |
123 |
ARGS["${#ARGS[@]}"]="$OPTARG" |
|
124 |
;; |
|
125 |
l) |
|
126 |
JEDIT_LOGIC="$OPTARG" |
|
127 |
;; |
|
128 |
m) |
|
129 |
if [ -z "$JEDIT_PRINT_MODE" ]; then |
|
130 |
JEDIT_PRINT_MODE="$OPTARG" |
|
131 |
else |
|
132 |
JEDIT_PRINT_MODE="$JEDIT_PRINT_MODE,$OPTARG" |
|
133 |
fi |
|
134 |
;; |
|
135 |
\?) |
|
136 |
usage |
|
137 |
;; |
|
138 |
esac |
|
139 |
done |
|
140 |
} |
|
34581
abab3a577e10
slightly more robust treatment of options via arrays;
wenzelm
parents:
34412
diff
changeset
|
141 |
|
38257
f0fd14a9c11f
clarified JEDIT_JAVA_OPTIONS vs. JEDIT_SYSTEM_OPTIONS -- discontinued JEDIT_APPLE_PROPERTIES;
wenzelm
parents:
34881
diff
changeset
|
142 |
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
|
143 |
[ -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
|
144 |
|
34780 | 145 |
declare -a ARGS; eval "ARGS=($JEDIT_OPTIONS)" |
34333 | 146 |
|
34780 | 147 |
declare -a OPTIONS; eval "OPTIONS=($ISABELLE_JEDIT_OPTIONS)" |
148 |
getoptions "${OPTIONS[@]}" |
|
149 |
||
150 |
getoptions "$@" |
|
34333 | 151 |
shift $(($OPTIND - 1)) |
152 |
||
153 |
||
154 |
# args |
|
155 |
||
44485
2f0a34fc4d2d
back to tradition Scratch.thy default -- execution wrt. perspective overcomes the main problems of 226563829580;
wenzelm
parents:
43695
diff
changeset
|
156 |
if [ "$#" -eq 0 ]; then |
50120 | 157 |
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
|
158 |
else |
2f0a34fc4d2d
back to tradition Scratch.thy default -- execution wrt. perspective overcomes the main problems of 226563829580;
wenzelm
parents:
43695
diff
changeset
|
159 |
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
|
160 |
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
|
161 |
shift |
2f0a34fc4d2d
back to tradition Scratch.thy default -- execution wrt. perspective overcomes the main problems of 226563829580;
wenzelm
parents:
43695
diff
changeset
|
162 |
done |
2f0a34fc4d2d
back to tradition Scratch.thy default -- execution wrt. perspective overcomes the main problems of 226563829580;
wenzelm
parents:
43695
diff
changeset
|
163 |
fi |
34333 | 164 |
|
165 |
||
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
166 |
## dependencies |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
167 |
|
49953 | 168 |
if [ -e "$ISABELLE_HOME/Admin/build" ]; then |
169 |
if [ "$BUILD_JARS" = jars_fresh ]; then |
|
170 |
"$ISABELLE_TOOL" graphview -b -f || exit $? |
|
171 |
else |
|
49566
66cbf8bb4693
basic integration of graphview into document model;
wenzelm
parents:
49494
diff
changeset
|
172 |
"$ISABELLE_HOME/Admin/build" "$BUILD_JARS" || exit $? |
49953 | 173 |
"$ISABELLE_TOOL" graphview -b || exit $? |
174 |
fi |
|
175 |
fi |
|
43413 | 176 |
|
43523 | 177 |
PURE_JAR="$ISABELLE_HOME/lib/classes/ext/Pure.jar" |
49566
66cbf8bb4693
basic integration of graphview into document model;
wenzelm
parents:
49494
diff
changeset
|
178 |
GRAPHVIEW_JAR="$ISABELLE_HOME/lib/classes/ext/Graphview.jar" |
43413 | 179 |
|
43285 | 180 |
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
|
181 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
182 |
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
|
183 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
184 |
JEDIT_JARS=( |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
185 |
"$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
|
186 |
"$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
|
187 |
"$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
|
188 |
"$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
|
189 |
"$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
|
190 |
) |
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 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
193 |
# target |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
194 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
195 |
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
|
196 |
|
43384 | 197 |
declare -a UPDATED=() |
198 |
||
43285 | 199 |
if [ "$BUILD_JARS" = jars_fresh ]; then |
200 |
OUTDATED=true |
|
201 |
else |
|
202 |
OUTDATED=false |
|
43368
0dc67b3cf8a5
check source dependencies only if jedit_build component is available;
wenzelm
parents:
43320
diff
changeset
|
203 |
if [ ! -e "$TARGET" ]; then |
0dc67b3cf8a5
check source dependencies only if jedit_build component is available;
wenzelm
parents:
43320
diff
changeset
|
204 |
OUTDATED=true |
43384 | 205 |
else |
206 |
if [ -n "$ISABELLE_JEDIT_BUILD_HOME" ]; then |
|
49566
66cbf8bb4693
basic integration of graphview into document model;
wenzelm
parents:
49494
diff
changeset
|
207 |
declare -a DEPS=( |
66cbf8bb4693
basic integration of graphview into document model;
wenzelm
parents:
49494
diff
changeset
|
208 |
"$JEDIT_JAR" "${JEDIT_JARS[@]}" |
66cbf8bb4693
basic integration of graphview into document model;
wenzelm
parents:
49494
diff
changeset
|
209 |
"$PURE_JAR" "$GRAPHVIEW_JAR" "${SOURCES[@]}" "${RESOURCES[@]}" |
66cbf8bb4693
basic integration of graphview into document model;
wenzelm
parents:
49494
diff
changeset
|
210 |
) |
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
|
211 |
elif [ -e "$ISABELLE_HOME/Admin/build" ]; then |
49566
66cbf8bb4693
basic integration of graphview into document model;
wenzelm
parents:
49494
diff
changeset
|
212 |
declare -a DEPS=("$PURE_JAR" "$GRAPHVIEW_JAR" "${SOURCES[@]}" "${RESOURCES[@]}") |
43384 | 213 |
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
|
214 |
declare -a DEPS=() |
43384 | 215 |
fi |
216 |
for DEP in "${DEPS[@]}" |
|
43368
0dc67b3cf8a5
check source dependencies only if jedit_build component is available;
wenzelm
parents:
43320
diff
changeset
|
217 |
do |
43384 | 218 |
[ ! -e "$DEP" ] && fail "Missing file: $DEP" |
219 |
[ "$DEP" -nt "$TARGET" ] && { |
|
220 |
OUTDATED=true |
|
221 |
UPDATED["${#UPDATED[@]}"]="$DEP" |
|
222 |
} |
|
43368
0dc67b3cf8a5
check source dependencies only if jedit_build component is available;
wenzelm
parents:
43320
diff
changeset
|
223 |
done |
0dc67b3cf8a5
check source dependencies only if jedit_build component is available;
wenzelm
parents:
43320
diff
changeset
|
224 |
fi |
43285 | 225 |
fi |
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
226 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
227 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
228 |
# build |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
229 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
230 |
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
|
231 |
then |
43405 | 232 |
echo "### Building Isabelle/jEdit ..." |
233 |
||
43384 | 234 |
[ "${#UPDATED[@]}" -gt 0 ] && { |
43405 | 235 |
echo "Changed files:" |
43384 | 236 |
for FILE in "${UPDATED[@]}" |
237 |
do |
|
238 |
echo " $FILE" |
|
239 |
done |
|
240 |
} |
|
241 |
||
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
242 |
[ -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
|
243 |
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
|
244 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
245 |
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
|
246 |
mkdir -p dist dist/classes || failed |
43287 | 247 |
|
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
|
248 |
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
|
249 |
cp -p -R -f "${RESOURCES[@]}" dist/classes/. |
43287 | 250 |
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
|
251 |
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
|
252 |
|
43391 | 253 |
perl -i -e 'while (<>) { |
254 |
if (m/NAME="javacc"/) { |
|
255 |
print qq,<MODE NAME="isabelle" FILE="isabelle.xml" FILE_NAME_GLOB="*.thy"/>\n\n,; |
|
48366 | 256 |
print qq,<MODE NAME="isabelle-options" FILE="isabelle-options.xml"/>\n\n,; |
48575 | 257 |
print qq,<MODE NAME="isabelle-root" FILE="isabelle-root.xml" FILE_NAME_GLOB="ROOT"/>\n\n,; } |
43391 | 258 |
elsif (m/NAME="scheme"/) { |
259 |
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
|
260 |
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
|
261 |
|
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
|
262 |
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
|
263 |
( |
49566
66cbf8bb4693
basic integration of graphview into document model;
wenzelm
parents:
49494
diff
changeset
|
264 |
for JAR in "$JEDIT_JAR" "${JEDIT_JARS[@]}" "$PURE_JAR" "$GRAPHVIEW_JAR" \ |
66cbf8bb4693
basic integration of graphview into document model;
wenzelm
parents:
49494
diff
changeset
|
265 |
"$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
|
266 |
do |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
267 |
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
|
268 |
done |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
269 |
CLASSPATH="$(jvmpath "$CLASSPATH")" |
47009 | 270 |
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
|
271 |
) || 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
|
272 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
273 |
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
|
274 |
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
|
275 |
cd ../.. |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
276 |
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
|
277 |
fi |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
278 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
279 |
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
|
280 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
281 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
282 |
## main |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
283 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
284 |
# perspective |
34880 | 285 |
|
286 |
mkdir -p "$JEDIT_SETTINGS/DockableWindowManager" |
|
287 |
||
288 |
if [ ! -e "$JEDIT_SETTINGS/perspective.xml" ]; then |
|
289 |
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
|
290 |
<DOCKING LEFT="" TOP="" RIGHT="" BOTTOM="isabelle-readme" LEFT_POS="0" TOP_POS="0" RIGHT_POS="250" BOTTOM_POS="250" /> |
34880 | 291 |
EOF |
292 |
cat > "$JEDIT_SETTINGS/perspective.xml" <<EOF |
|
293 |
<?xml version="1.0" encoding="UTF-8" ?> |
|
294 |
<!DOCTYPE PERSPECTIVE SYSTEM "perspective.dtd"> |
|
295 |
<PERSPECTIVE> |
|
296 |
<VIEW PLAIN="FALSE"> |
|
297 |
<GEOMETRY X="0" Y="35" WIDTH="1072" HEIGHT="787" EXT_STATE="0" /> |
|
298 |
</VIEW> |
|
299 |
</PERSPECTIVE> |
|
300 |
EOF |
|
301 |
fi |
|
302 |
||
303 |
||
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
304 |
# run |
34333 | 305 |
|
43285 | 306 |
[ "$BUILD_ONLY" = true ] || { |
307 |
case "$JEDIT_LOGIC" in |
|
308 |
/*) |
|
309 |
;; |
|
310 |
*/*) |
|
311 |
JEDIT_LOGIC="$(pwd -P)/$JEDIT_LOGIC" |
|
312 |
;; |
|
313 |
esac |
|
34333 | 314 |
|
48791 | 315 |
export JEDIT_SESSION_DIRS JEDIT_LOGIC JEDIT_PRINT_MODE |
34333 | 316 |
|
43285 | 317 |
exec "$ISABELLE_TOOL" java "${JAVA_ARGS[@]}" \ |
318 |
-jar "$(jvmpath "$JEDIT_HOME/dist/jedit.jar")" \ |
|
319 |
"-settings=$(jvmpath "$JEDIT_SETTINGS")" "${ARGS[@]}" |
|
320 |
} |