author | wenzelm |
Thu, 26 Sep 2013 13:28:26 +0200 | |
changeset 53914 | 48072f049838 |
parent 53883 | f1c5f857df3d |
child 54660 | d9c88171b393 |
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=( |
50450
358b6020f8b6
generalized notion of active area, where sendback is just one application;
wenzelm
parents:
50433
diff
changeset
|
11 |
"src/active.scala" |
53023
f127e949389f
Completion popup based on javax.swing.PopupFactory, which has better cross-platform chances than JWindow (cf. org/gjt/jedit/gui/CompletionPopup.java);
wenzelm
parents:
52981
diff
changeset
|
12 |
"src/completion_popup.scala" |
43285 | 13 |
"src/dockable.scala" |
14 |
"src/document_model.scala" |
|
15 |
"src/document_view.scala" |
|
52445 | 16 |
"src/documentation_dockable.scala" |
52846 | 17 |
"src/find_dockable.scala" |
50542
58bd88159f8f
fold handling within Pretty_Text_Area, based on formal document content, which is static here;
wenzelm
parents:
50450
diff
changeset
|
18 |
"src/fold_handling.scala" |
49570 | 19 |
"src/graphview_dockable.scala" |
49726 | 20 |
"src/info_dockable.scala" |
50208 | 21 |
"src/isabelle.scala" |
43285 | 22 |
"src/isabelle_encoding.scala" |
49246 | 23 |
"src/isabelle_logic.scala" |
43285 | 24 |
"src/isabelle_options.scala" |
25 |
"src/isabelle_sidekick.scala" |
|
52971
31926d2c04ee
tuned signature -- more abstract PIDE editor operations;
wenzelm
parents:
52934
diff
changeset
|
26 |
"src/jedit_editor.scala" |
49406 | 27 |
"src/jedit_lib.scala" |
50202 | 28 |
"src/jedit_options.scala" |
44577
96b6388d06c4
separate module for jEdit primitives for loading theory files;
wenzelm
parents:
44565
diff
changeset
|
29 |
"src/jedit_thy_load.scala" |
50433
9131dadb2bf7
basic monitor panel, using the powerful jfreechart library;
wenzelm
parents:
50416
diff
changeset
|
30 |
"src/monitor_dockable.scala" |
43285 | 31 |
"src/output_dockable.scala" |
32 |
"src/plugin.scala" |
|
49398
0fa4389c04f9
alternative output panel, based on Pretty_Text_Area, based on JEditEmbeddedTextArea;
wenzelm
parents:
49246
diff
changeset
|
33 |
"src/pretty_text_area.scala" |
49702 | 34 |
"src/pretty_tooltip.scala" |
52934
bfb6873df88e
separate Process_Indicator -- simplified/clarified version of org.gjt.sp.jedit.gui.AnimatedIcon;
wenzelm
parents:
52908
diff
changeset
|
35 |
"src/process_indicator.scala" |
43285 | 36 |
"src/protocol_dockable.scala" |
37 |
"src/raw_output_dockable.scala" |
|
50202 | 38 |
"src/rendering.scala" |
49411 | 39 |
"src/rich_text_area.scala" |
43285 | 40 |
"src/scala_console.scala" |
52908
3461985dcbc3
dockable window for Sledgehammer, based on asynchronous/parallel query operation;
wenzelm
parents:
52865
diff
changeset
|
41 |
"src/sledgehammer_dockable.scala" |
50143
4ff5d795ed08
dockable with buttons for symbols, grouped and sorted in tabs according to ~~/etc/symbols;
immler
parents:
50120
diff
changeset
|
42 |
"src/symbols_dockable.scala" |
48021
d899be1cfe6d
separate syslog dockable -- discontinued tendency of sub-window management via tabs;
wenzelm
parents:
48014
diff
changeset
|
43 |
"src/syslog_dockable.scala" |
46572 | 44 |
"src/text_overview.scala" |
50299 | 45 |
"src/theories_dockable.scala" |
51533 | 46 |
"src/timing_dockable.scala" |
43414 | 47 |
"src/token_markup.scala" |
43285 | 48 |
) |
49 |
||
43320 | 50 |
declare -a RESOURCES=( |
43286 | 51 |
"src/actions.xml" |
52 |
"src/dockables.xml" |
|
53 |
"src/Isabelle.props" |
|
50306 | 54 |
"src/jEdit.props" |
43286 | 55 |
"src/services.xml" |
52540 | 56 |
"src/modes/isabelle-news.xml" |
57 |
"src/modes/isabelle-options.xml" |
|
58 |
"src/modes/isabelle-root.xml" |
|
59 |
"src/modes/isabelle.xml" |
|
43285 | 60 |
) |
61 |
||
62 |
||
34333 | 63 |
## diagnostics |
64 |
||
34664 | 65 |
PRG="$(basename "$0")" |
66 |
||
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
67 |
function usage() |
34333 | 68 |
{ |
69 |
echo |
|
34664 | 70 |
echo "Usage: isabelle $PRG [OPTIONS] [FILES ...]" |
34333 | 71 |
echo |
72 |
echo " Options are:" |
|
73 |
echo " -J OPTION add JVM runtime option" |
|
34409 | 74 |
echo " (default JEDIT_JAVA_OPTIONS=$JEDIT_JAVA_OPTIONS)" |
43285 | 75 |
echo " -b build only" |
48791 | 76 |
echo " -d DIR include session directory" |
43285 | 77 |
echo " -f fresh build" |
34333 | 78 |
echo " -j OPTION add jEdit runtime option" |
79 |
echo " (default JEDIT_OPTIONS=$JEDIT_OPTIONS)" |
|
50403
87868964733c
more uniform default logic, using settings, options, args etc.;
wenzelm
parents:
50373
diff
changeset
|
80 |
echo " -l NAME logic session name" |
34333 | 81 |
echo " -m MODE add print mode for output" |
50405
366c4a602500
clarified build_dialog: regular up-to-date check (extra cost of approx. 5s startup for HOL);
wenzelm
parents:
50403
diff
changeset
|
82 |
echo " -n no build dialog for session image on startup" |
50373 | 83 |
echo " -s system build mode for session image" |
34333 | 84 |
echo |
50550 | 85 |
echo "Start jEdit with Isabelle plugin setup and open theory FILES" |
50114 | 86 |
echo "(default \"$USER_HOME/Scratch.thy\")." |
34333 | 87 |
echo |
88 |
exit 1 |
|
89 |
} |
|
90 |
||
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
91 |
function fail() |
34333 | 92 |
{ |
93 |
echo "$1" >&2 |
|
94 |
exit 2 |
|
95 |
} |
|
96 |
||
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
97 |
function failed() |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
98 |
{ |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
99 |
fail "Failed!" |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
100 |
} |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
101 |
|
34333 | 102 |
|
103 |
## process command line |
|
104 |
||
105 |
# options |
|
106 |
||
43285 | 107 |
BUILD_ONLY=false |
108 |
BUILD_JARS="jars" |
|
48791 | 109 |
JEDIT_SESSION_DIRS="" |
50403
87868964733c
more uniform default logic, using settings, options, args etc.;
wenzelm
parents:
50373
diff
changeset
|
110 |
JEDIT_LOGIC="" |
34333 | 111 |
JEDIT_PRINT_MODE="" |
53449 | 112 |
JEDIT_BUILD_MODE="normal" |
34333 | 113 |
|
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
114 |
function getoptions() |
34780 | 115 |
{ |
116 |
OPTIND=1 |
|
50405
366c4a602500
clarified build_dialog: regular up-to-date check (extra cost of approx. 5s startup for HOL);
wenzelm
parents:
50403
diff
changeset
|
117 |
while getopts "J:bd:fj:l:m:ns" OPT |
34780 | 118 |
do |
119 |
case "$OPT" in |
|
120 |
J) |
|
121 |
JAVA_ARGS["${#JAVA_ARGS[@]}"]="$OPTARG" |
|
122 |
;; |
|
43285 | 123 |
b) |
124 |
BUILD_ONLY=true |
|
125 |
;; |
|
48791 | 126 |
d) |
127 |
if [ -z "$JEDIT_SESSION_DIRS" ]; then |
|
128 |
JEDIT_SESSION_DIRS="$OPTARG" |
|
129 |
else |
|
130 |
JEDIT_SESSION_DIRS="$JEDIT_SESSION_DIRS:$OPTARG" |
|
131 |
fi |
|
132 |
;; |
|
43285 | 133 |
f) |
134 |
BUILD_JARS="jars_fresh" |
|
135 |
;; |
|
34780 | 136 |
j) |
137 |
ARGS["${#ARGS[@]}"]="$OPTARG" |
|
138 |
;; |
|
139 |
l) |
|
140 |
JEDIT_LOGIC="$OPTARG" |
|
141 |
;; |
|
142 |
m) |
|
143 |
if [ -z "$JEDIT_PRINT_MODE" ]; then |
|
144 |
JEDIT_PRINT_MODE="$OPTARG" |
|
145 |
else |
|
146 |
JEDIT_PRINT_MODE="$JEDIT_PRINT_MODE,$OPTARG" |
|
147 |
fi |
|
148 |
;; |
|
50405
366c4a602500
clarified build_dialog: regular up-to-date check (extra cost of approx. 5s startup for HOL);
wenzelm
parents:
50403
diff
changeset
|
149 |
n) |
53449 | 150 |
JEDIT_BUILD_MODE="none" |
50405
366c4a602500
clarified build_dialog: regular up-to-date check (extra cost of approx. 5s startup for HOL);
wenzelm
parents:
50403
diff
changeset
|
151 |
;; |
50373 | 152 |
s) |
53449 | 153 |
JEDIT_BUILD_MODE="system" |
50373 | 154 |
;; |
34780 | 155 |
\?) |
156 |
usage |
|
157 |
;; |
|
158 |
esac |
|
159 |
done |
|
160 |
} |
|
34581
abab3a577e10
slightly more robust treatment of options via arrays;
wenzelm
parents:
34412
diff
changeset
|
161 |
|
38257
f0fd14a9c11f
clarified JEDIT_JAVA_OPTIONS vs. JEDIT_SYSTEM_OPTIONS -- discontinued JEDIT_APPLE_PROPERTIES;
wenzelm
parents:
34881
diff
changeset
|
162 |
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
|
163 |
|
53446
4adb2cce5fc6
use JEDIT_OPTIONS only once (in isabelle.Main.start_jedit);
wenzelm
parents:
53445
diff
changeset
|
164 |
declare -a ARGS=() |
34333 | 165 |
|
34780 | 166 |
declare -a OPTIONS; eval "OPTIONS=($ISABELLE_JEDIT_OPTIONS)" |
167 |
getoptions "${OPTIONS[@]}" |
|
168 |
||
169 |
getoptions "$@" |
|
34333 | 170 |
shift $(($OPTIND - 1)) |
171 |
||
172 |
||
173 |
# args |
|
174 |
||
44485
2f0a34fc4d2d
back to tradition Scratch.thy default -- execution wrt. perspective overcomes the main problems of 226563829580;
wenzelm
parents:
43695
diff
changeset
|
175 |
if [ "$#" -eq 0 ]; then |
50120 | 176 |
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
|
177 |
else |
2f0a34fc4d2d
back to tradition Scratch.thy default -- execution wrt. perspective overcomes the main problems of 226563829580;
wenzelm
parents:
43695
diff
changeset
|
178 |
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
|
179 |
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
|
180 |
shift |
2f0a34fc4d2d
back to tradition Scratch.thy default -- execution wrt. perspective overcomes the main problems of 226563829580;
wenzelm
parents:
43695
diff
changeset
|
181 |
done |
2f0a34fc4d2d
back to tradition Scratch.thy default -- execution wrt. perspective overcomes the main problems of 226563829580;
wenzelm
parents:
43695
diff
changeset
|
182 |
fi |
34333 | 183 |
|
184 |
||
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
185 |
## dependencies |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
186 |
|
49953 | 187 |
if [ -e "$ISABELLE_HOME/Admin/build" ]; then |
50782 | 188 |
"$ISABELLE_TOOL" browser -b || exit $? |
49953 | 189 |
if [ "$BUILD_JARS" = jars_fresh ]; then |
190 |
"$ISABELLE_TOOL" graphview -b -f || exit $? |
|
191 |
else |
|
49566
66cbf8bb4693
basic integration of graphview into document model;
wenzelm
parents:
49494
diff
changeset
|
192 |
"$ISABELLE_HOME/Admin/build" "$BUILD_JARS" || exit $? |
49953 | 193 |
"$ISABELLE_TOOL" graphview -b || exit $? |
194 |
fi |
|
195 |
fi |
|
43413 | 196 |
|
53577 | 197 |
PURE_JAR="$ISABELLE_HOME/lib/classes/Pure.jar" |
198 |
GRAPHVIEW_JAR="$ISABELLE_HOME/lib/classes/Graphview.jar" |
|
43413 | 199 |
|
43285 | 200 |
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
|
201 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
202 |
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
|
203 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
204 |
JEDIT_JARS=( |
53445
811db2b751ed
warm start of Isabelle/jEdit from Isabelle/Scala;
wenzelm
parents:
53441
diff
changeset
|
205 |
"$ISABELLE_JEDIT_BUILD_HOME/contrib/Console.jar" |
811db2b751ed
warm start of Isabelle/jEdit from Isabelle/Scala;
wenzelm
parents:
53441
diff
changeset
|
206 |
"$ISABELLE_JEDIT_BUILD_HOME/contrib/ErrorList.jar" |
811db2b751ed
warm start of Isabelle/jEdit from Isabelle/Scala;
wenzelm
parents:
53441
diff
changeset
|
207 |
"$ISABELLE_JEDIT_BUILD_HOME/contrib/Highlight.jar" |
53883
f1c5f857df3d
include MacOSX plugin by default -- disabled by default to avoid multiplatform confusion;
wenzelm
parents:
53882
diff
changeset
|
208 |
"$ISABELLE_JEDIT_BUILD_HOME/contrib/MacOSX.jar" |
53445
811db2b751ed
warm start of Isabelle/jEdit from Isabelle/Scala;
wenzelm
parents:
53441
diff
changeset
|
209 |
"$ISABELLE_JEDIT_BUILD_HOME/contrib/SideKick.jar" |
811db2b751ed
warm start of Isabelle/jEdit from Isabelle/Scala;
wenzelm
parents:
53441
diff
changeset
|
210 |
"$ISABELLE_JEDIT_BUILD_HOME/contrib/idea-icons.jar" |
811db2b751ed
warm start of Isabelle/jEdit from Isabelle/Scala;
wenzelm
parents:
53441
diff
changeset
|
211 |
"$ISABELLE_JEDIT_BUILD_HOME/contrib/jsr305-2.0.0.jar" |
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
212 |
) |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
213 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
214 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
215 |
# target |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
216 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
217 |
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
|
218 |
|
43384 | 219 |
declare -a UPDATED=() |
220 |
||
43285 | 221 |
if [ "$BUILD_JARS" = jars_fresh ]; then |
222 |
OUTDATED=true |
|
223 |
else |
|
224 |
OUTDATED=false |
|
43368
0dc67b3cf8a5
check source dependencies only if jedit_build component is available;
wenzelm
parents:
43320
diff
changeset
|
225 |
if [ ! -e "$TARGET" ]; then |
0dc67b3cf8a5
check source dependencies only if jedit_build component is available;
wenzelm
parents:
43320
diff
changeset
|
226 |
OUTDATED=true |
43384 | 227 |
else |
228 |
if [ -n "$ISABELLE_JEDIT_BUILD_HOME" ]; then |
|
49566
66cbf8bb4693
basic integration of graphview into document model;
wenzelm
parents:
49494
diff
changeset
|
229 |
declare -a DEPS=( |
53576
793a429c63e7
maintain classpath in more elementary manner: turn ISABELLE_CLASSPATH into -classpath option, so that all jars are covered by sun.misc.Launcher.AppClassLoader (e.g. relevant for loading add-on resources);
wenzelm
parents:
53451
diff
changeset
|
230 |
"$JEDIT_JAR" "${JEDIT_JARS[@]}" "$PURE_JAR" "$GRAPHVIEW_JAR" |
793a429c63e7
maintain classpath in more elementary manner: turn ISABELLE_CLASSPATH into -classpath option, so that all jars are covered by sun.misc.Launcher.AppClassLoader (e.g. relevant for loading add-on resources);
wenzelm
parents:
53451
diff
changeset
|
231 |
"${SOURCES[@]}" "${RESOURCES[@]}" |
49566
66cbf8bb4693
basic integration of graphview into document model;
wenzelm
parents:
49494
diff
changeset
|
232 |
) |
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
|
233 |
elif [ -e "$ISABELLE_HOME/Admin/build" ]; then |
49566
66cbf8bb4693
basic integration of graphview into document model;
wenzelm
parents:
49494
diff
changeset
|
234 |
declare -a DEPS=("$PURE_JAR" "$GRAPHVIEW_JAR" "${SOURCES[@]}" "${RESOURCES[@]}") |
43384 | 235 |
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
|
236 |
declare -a DEPS=() |
43384 | 237 |
fi |
238 |
for DEP in "${DEPS[@]}" |
|
43368
0dc67b3cf8a5
check source dependencies only if jedit_build component is available;
wenzelm
parents:
43320
diff
changeset
|
239 |
do |
43384 | 240 |
[ ! -e "$DEP" ] && fail "Missing file: $DEP" |
241 |
[ "$DEP" -nt "$TARGET" ] && { |
|
242 |
OUTDATED=true |
|
243 |
UPDATED["${#UPDATED[@]}"]="$DEP" |
|
244 |
} |
|
43368
0dc67b3cf8a5
check source dependencies only if jedit_build component is available;
wenzelm
parents:
43320
diff
changeset
|
245 |
done |
0dc67b3cf8a5
check source dependencies only if jedit_build component is available;
wenzelm
parents:
43320
diff
changeset
|
246 |
fi |
43285 | 247 |
fi |
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
248 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
249 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
250 |
# build |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
251 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
252 |
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
|
253 |
then |
43405 | 254 |
echo "### Building Isabelle/jEdit ..." |
255 |
||
43384 | 256 |
[ "${#UPDATED[@]}" -gt 0 ] && { |
43405 | 257 |
echo "Changed files:" |
43384 | 258 |
for FILE in "${UPDATED[@]}" |
259 |
do |
|
260 |
echo " $FILE" |
|
261 |
done |
|
262 |
} |
|
263 |
||
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
264 |
[ -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
|
265 |
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
|
266 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
267 |
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
|
268 |
mkdir -p dist dist/classes || failed |
43287 | 269 |
|
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
|
270 |
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
|
271 |
cp -p -R -f "${RESOURCES[@]}" dist/classes/. |
43287 | 272 |
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
|
273 |
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
|
274 |
|
43391 | 275 |
perl -i -e 'while (<>) { |
276 |
if (m/NAME="javacc"/) { |
|
277 |
print qq,<MODE NAME="isabelle" FILE="isabelle.xml" FILE_NAME_GLOB="*.thy"/>\n\n,; |
|
52539 | 278 |
print qq,<MODE NAME="isabelle-news" FILE="isabelle-news.xml"/>\n\n,; |
48366 | 279 |
print qq,<MODE NAME="isabelle-options" FILE="isabelle-options.xml"/>\n\n,; |
48575 | 280 |
print qq,<MODE NAME="isabelle-root" FILE="isabelle-root.xml" FILE_NAME_GLOB="ROOT"/>\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
|
281 |
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
|
282 |
|
53445
811db2b751ed
warm start of Isabelle/jEdit from Isabelle/Scala;
wenzelm
parents:
53441
diff
changeset
|
283 |
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
|
284 |
( |
53578 | 285 |
#workaround for scalac 2.10.2 |
53451 | 286 |
function stty() { :; } |
287 |
export -f stty |
|
288 |
||
53576
793a429c63e7
maintain classpath in more elementary manner: turn ISABELLE_CLASSPATH into -classpath option, so that all jars are covered by sun.misc.Launcher.AppClassLoader (e.g. relevant for loading add-on resources);
wenzelm
parents:
53451
diff
changeset
|
289 |
for JAR in "$JEDIT_JAR" "${JEDIT_JARS[@]}" "$PURE_JAR" "$GRAPHVIEW_JAR" |
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
290 |
do |
53576
793a429c63e7
maintain classpath in more elementary manner: turn ISABELLE_CLASSPATH into -classpath option, so that all jars are covered by sun.misc.Launcher.AppClassLoader (e.g. relevant for loading add-on resources);
wenzelm
parents:
53451
diff
changeset
|
291 |
classpath "$JAR" |
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
292 |
done |
53576
793a429c63e7
maintain classpath in more elementary manner: turn ISABELLE_CLASSPATH into -classpath option, so that all jars are covered by sun.misc.Launcher.AppClassLoader (e.g. relevant for loading add-on resources);
wenzelm
parents:
53451
diff
changeset
|
293 |
export CLASSPATH="$(jvmpath "$ISABELLE_CLASSPATH")" |
47009 | 294 |
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
|
295 |
) || 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
|
296 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
297 |
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
|
298 |
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
|
299 |
cd ../.. |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
300 |
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
|
301 |
fi |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
302 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
303 |
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
|
304 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
305 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
306 |
## main |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
307 |
|
53576
793a429c63e7
maintain classpath in more elementary manner: turn ISABELLE_CLASSPATH into -classpath option, so that all jars are covered by sun.misc.Launcher.AppClassLoader (e.g. relevant for loading add-on resources);
wenzelm
parents:
53451
diff
changeset
|
308 |
if [ "$BUILD_ONLY" = false ] |
793a429c63e7
maintain classpath in more elementary manner: turn ISABELLE_CLASSPATH into -classpath option, so that all jars are covered by sun.misc.Launcher.AppClassLoader (e.g. relevant for loading add-on resources);
wenzelm
parents:
53451
diff
changeset
|
309 |
then |
53449 | 310 |
export JEDIT_SESSION_DIRS JEDIT_LOGIC JEDIT_PRINT_MODE JEDIT_BUILD_MODE |
53576
793a429c63e7
maintain classpath in more elementary manner: turn ISABELLE_CLASSPATH into -classpath option, so that all jars are covered by sun.misc.Launcher.AppClassLoader (e.g. relevant for loading add-on resources);
wenzelm
parents:
53451
diff
changeset
|
311 |
classpath "$JEDIT_HOME/dist/jedit.jar" |
793a429c63e7
maintain classpath in more elementary manner: turn ISABELLE_CLASSPATH into -classpath option, so that all jars are covered by sun.misc.Launcher.AppClassLoader (e.g. relevant for loading add-on resources);
wenzelm
parents:
53451
diff
changeset
|
312 |
exec "$ISABELLE_TOOL" java "${JAVA_ARGS[@]}" isabelle.Main "${ARGS[@]}" |
50416
2e1b47e22fc6
more rigorous "build only" mode: avoid build dialog of logic image and its potential need for GUI display;
wenzelm
parents:
50405
diff
changeset
|
313 |
fi |