author | wenzelm |
Mon, 10 May 2021 12:23:30 +0200 | |
changeset 73653 | d9823224fcfe |
parent 73652 | d5c3eee7da74 |
child 73660 | ff716ecb0805 |
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 |
||
71368 | 10 |
declare -a SOURCES0=( |
11 |
"src/Tools/jEdit/src-base/dockable.scala" |
|
12 |
"src/Tools/jEdit/src-base/isabelle_encoding.scala" |
|
13 |
"src/Tools/jEdit/src-base/jedit_lib.scala" |
|
14 |
"src/Tools/jEdit/src-base/pide_docking_framework.scala" |
|
15 |
"src/Tools/jEdit/src-base/plugin.scala" |
|
16 |
"src/Tools/jEdit/src-base/syntax_style.scala" |
|
66457
9098c36abd1a
separate base plugin for important services that should be always available, despite startup errors of the main plugin;
wenzelm
parents:
66120
diff
changeset
|
17 |
) |
9098c36abd1a
separate base plugin for important services that should be always available, despite startup errors of the main plugin;
wenzelm
parents:
66120
diff
changeset
|
18 |
|
71368 | 19 |
declare -a RESOURCES0=( |
20 |
"src/Tools/jEdit/src-base/Isabelle_Base.props" |
|
21 |
"src/Tools/jEdit/src-base/services.xml" |
|
66457
9098c36abd1a
separate base plugin for important services that should be always available, despite startup errors of the main plugin;
wenzelm
parents:
66120
diff
changeset
|
22 |
) |
9098c36abd1a
separate base plugin for important services that should be always available, despite startup errors of the main plugin;
wenzelm
parents:
66120
diff
changeset
|
23 |
|
43320 | 24 |
declare -a SOURCES=( |
71368 | 25 |
"src/Tools/jEdit/src/active.scala" |
26 |
"src/Tools/jEdit/src/completion_popup.scala" |
|
27 |
"src/Tools/jEdit/src/context_menu.scala" |
|
28 |
"src/Tools/jEdit/src/debugger_dockable.scala" |
|
29 |
"src/Tools/jEdit/src/document_model.scala" |
|
30 |
"src/Tools/jEdit/src/document_view.scala" |
|
31 |
"src/Tools/jEdit/src/documentation_dockable.scala" |
|
32 |
"src/Tools/jEdit/src/fold_handling.scala" |
|
33 |
"src/Tools/jEdit/src/font_info.scala" |
|
34 |
"src/Tools/jEdit/src/graphview_dockable.scala" |
|
35 |
"src/Tools/jEdit/src/info_dockable.scala" |
|
36 |
"src/Tools/jEdit/src/isabelle.scala" |
|
37 |
"src/Tools/jEdit/src/isabelle_encoding.scala" |
|
38 |
"src/Tools/jEdit/src/isabelle_export.scala" |
|
39 |
"src/Tools/jEdit/src/isabelle_options.scala" |
|
40 |
"src/Tools/jEdit/src/isabelle_session.scala" |
|
41 |
"src/Tools/jEdit/src/isabelle_sidekick.scala" |
|
42 |
"src/Tools/jEdit/src/isabelle_vfs.scala" |
|
43 |
"src/Tools/jEdit/src/jedit_bibtex.scala" |
|
44 |
"src/Tools/jEdit/src/jedit_editor.scala" |
|
45 |
"src/Tools/jEdit/src/jedit_lib.scala" |
|
46 |
"src/Tools/jEdit/src/jedit_options.scala" |
|
47 |
"src/Tools/jEdit/src/jedit_rendering.scala" |
|
48 |
"src/Tools/jEdit/src/jedit_resources.scala" |
|
49 |
"src/Tools/jEdit/src/jedit_sessions.scala" |
|
50 |
"src/Tools/jEdit/src/jedit_spell_checker.scala" |
|
51 |
"src/Tools/jEdit/src/keymap_merge.scala" |
|
52 |
"src/Tools/jEdit/src/monitor_dockable.scala" |
|
53 |
"src/Tools/jEdit/src/output_dockable.scala" |
|
54 |
"src/Tools/jEdit/src/plugin.scala" |
|
55 |
"src/Tools/jEdit/src/pretty_text_area.scala" |
|
56 |
"src/Tools/jEdit/src/pretty_tooltip.scala" |
|
57 |
"src/Tools/jEdit/src/process_indicator.scala" |
|
58 |
"src/Tools/jEdit/src/protocol_dockable.scala" |
|
59 |
"src/Tools/jEdit/src/query_dockable.scala" |
|
60 |
"src/Tools/jEdit/src/raw_output_dockable.scala" |
|
61 |
"src/Tools/jEdit/src/rich_text_area.scala" |
|
62 |
"src/Tools/jEdit/src/scala_console.scala" |
|
63 |
"src/Tools/jEdit/src/session_build.scala" |
|
64 |
"src/Tools/jEdit/src/simplifier_trace_dockable.scala" |
|
65 |
"src/Tools/jEdit/src/simplifier_trace_window.scala" |
|
66 |
"src/Tools/jEdit/src/sledgehammer_dockable.scala" |
|
67 |
"src/Tools/jEdit/src/state_dockable.scala" |
|
72248 | 68 |
"src/Tools/jEdit/src/status_widget.scala" |
71368 | 69 |
"src/Tools/jEdit/src/symbols_dockable.scala" |
70 |
"src/Tools/jEdit/src/syntax_style.scala" |
|
71 |
"src/Tools/jEdit/src/syslog_dockable.scala" |
|
72 |
"src/Tools/jEdit/src/text_overview.scala" |
|
73 |
"src/Tools/jEdit/src/text_structure.scala" |
|
74 |
"src/Tools/jEdit/src/theories_dockable.scala" |
|
75 |
"src/Tools/jEdit/src/timing_dockable.scala" |
|
76 |
"src/Tools/jEdit/src/token_markup.scala" |
|
43285 | 77 |
) |
78 |
||
43320 | 79 |
declare -a RESOURCES=( |
71368 | 80 |
"src/Tools/jEdit/src/actions.xml" |
81 |
"src/Tools/jEdit/src/dockables.xml" |
|
82 |
"src/Tools/jEdit/src/Isabelle.props" |
|
83 |
"src/Tools/jEdit/src/jEdit.props" |
|
84 |
"src/Tools/jEdit/src/services.xml" |
|
85 |
"src/Tools/jEdit/src/modes/isabelle-ml.xml" |
|
86 |
"src/Tools/jEdit/src/modes/isabelle-news.xml" |
|
87 |
"src/Tools/jEdit/src/modes/isabelle-options.xml" |
|
88 |
"src/Tools/jEdit/src/modes/isabelle-root.xml" |
|
89 |
"src/Tools/jEdit/src/modes/isabelle.xml" |
|
90 |
"src/Tools/jEdit/src/modes/sml.xml" |
|
43285 | 91 |
) |
92 |
||
93 |
||
34333 | 94 |
## diagnostics |
95 |
||
34664 | 96 |
PRG="$(basename "$0")" |
97 |
||
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
98 |
function usage() |
34333 | 99 |
{ |
100 |
echo |
|
34664 | 101 |
echo "Usage: isabelle $PRG [OPTIONS] [FILES ...]" |
34333 | 102 |
echo |
103 |
echo " Options are:" |
|
71548 | 104 |
echo " -A NAME ancestor session for option -R (default: parent)" |
62039 | 105 |
echo " -D NAME=X set JVM system property" |
66683 | 106 |
echo " -J OPTION add JVM runtime option" |
107 |
echo " (default $JEDIT_JAVA_SYSTEM_OPTIONS $JEDIT_JAVA_OPTIONS)" |
|
68370 | 108 |
echo " -R NAME build image with requirements from other sessions" |
43285 | 109 |
echo " -b build only" |
48791 | 110 |
echo " -d DIR include session directory" |
43285 | 111 |
echo " -f fresh build" |
68541 | 112 |
echo " -i NAME include session in name-space of theories" |
34333 | 113 |
echo " -j OPTION add jEdit runtime option" |
66683 | 114 |
echo " (default $JEDIT_OPTIONS)" |
50403
87868964733c
more uniform default logic, using settings, options, args etc.;
wenzelm
parents:
50373
diff
changeset
|
115 |
echo " -l NAME logic session name" |
34333 | 116 |
echo " -m MODE add print mode for output" |
57086 | 117 |
echo " -n no build of session image on startup" |
63986
c7a4b03727ae
options for process policy, notably for multiprocessor machines;
wenzelm
parents:
63734
diff
changeset
|
118 |
echo " -p CMD ML process command prefix (process policy)" |
69854
cc0b3e177b49
system option "system_heaps" supersedes various command-line options for "system build mode";
wenzelm
parents:
69762
diff
changeset
|
119 |
echo " -s system build mode for session image (system_heaps=true)" |
cc0b3e177b49
system option "system_heaps" supersedes various command-line options for "system build mode";
wenzelm
parents:
69762
diff
changeset
|
120 |
echo " -u user build mode for session image (system_heaps=false)" |
34333 | 121 |
echo |
61171 | 122 |
echo " Start jEdit with Isabelle plugin setup and open FILES" |
61512
933463440449
more uniform command-line for "isabelle jedit" and the isabelle.Main app wrapper;
wenzelm
parents:
61511
diff
changeset
|
123 |
echo " (default \"$USER_HOME/Scratch.thy\" or \":\" for empty buffer)." |
34333 | 124 |
echo |
125 |
exit 1 |
|
126 |
} |
|
127 |
||
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
128 |
function fail() |
34333 | 129 |
{ |
130 |
echo "$1" >&2 |
|
131 |
exit 2 |
|
132 |
} |
|
133 |
||
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
134 |
function failed() |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
135 |
{ |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
136 |
fail "Failed!" |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
137 |
} |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
138 |
|
34333 | 139 |
|
140 |
## process command line |
|
141 |
||
142 |
# options |
|
143 |
||
43285 | 144 |
BUILD_ONLY=false |
71372
85274743f789
clarified option -f: avoid accidental target_clean for proper release snapshot;
wenzelm
parents:
71371
diff
changeset
|
145 |
FRESH_BUILD="" |
63986
c7a4b03727ae
options for process policy, notably for multiprocessor machines;
wenzelm
parents:
63734
diff
changeset
|
146 |
ML_PROCESS_POLICY="" |
66988 | 147 |
JEDIT_LOGIC_ANCESTOR="" |
68370 | 148 |
JEDIT_LOGIC_REQUIREMENTS="" |
68541 | 149 |
JEDIT_INCLUDE_SESSIONS="" |
70382
23ba5a638e6d
more robust: avoid folding of jEdit file-names wrt. JEDIT_SESSION_DIRS;
wenzelm
parents:
70220
diff
changeset
|
150 |
JEDIT_SESSION_DIRS="-" |
50403
87868964733c
more uniform default logic, using settings, options, args etc.;
wenzelm
parents:
50373
diff
changeset
|
151 |
JEDIT_LOGIC="" |
34333 | 152 |
JEDIT_PRINT_MODE="" |
69854
cc0b3e177b49
system option "system_heaps" supersedes various command-line options for "system build mode";
wenzelm
parents:
69762
diff
changeset
|
153 |
JEDIT_NO_BUILD="" |
cc0b3e177b49
system option "system_heaps" supersedes various command-line options for "system build mode";
wenzelm
parents:
69762
diff
changeset
|
154 |
JEDIT_BUILD_MODE="default" |
34333 | 155 |
|
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
156 |
function getoptions() |
34780 | 157 |
{ |
158 |
OPTIND=1 |
|
70683
8c7706b053c7
find theory files via session structure: much faster Prover IDE startup;
wenzelm
parents:
70382
diff
changeset
|
159 |
while getopts "A:BFD:J:R:bd:fi:j:l:m:np:su" OPT |
34780 | 160 |
do |
161 |
case "$OPT" in |
|
66988 | 162 |
A) |
163 |
JEDIT_LOGIC_ANCESTOR="$OPTARG" |
|
164 |
;; |
|
62039 | 165 |
D) |
166 |
JAVA_ARGS["${#JAVA_ARGS[@]}"]="-D$OPTARG" |
|
167 |
;; |
|
34780 | 168 |
J) |
169 |
JAVA_ARGS["${#JAVA_ARGS[@]}"]="$OPTARG" |
|
170 |
;; |
|
64602 | 171 |
R) |
68370 | 172 |
JEDIT_LOGIC="$OPTARG" |
173 |
JEDIT_LOGIC_REQUIREMENTS="true" |
|
64602 | 174 |
;; |
43285 | 175 |
b) |
176 |
BUILD_ONLY=true |
|
177 |
;; |
|
48791 | 178 |
d) |
70382
23ba5a638e6d
more robust: avoid folding of jEdit file-names wrt. JEDIT_SESSION_DIRS;
wenzelm
parents:
70220
diff
changeset
|
179 |
JEDIT_SESSION_DIRS="$JEDIT_SESSION_DIRS:$OPTARG" |
48791 | 180 |
;; |
68541 | 181 |
i) |
182 |
if [ -z "$JEDIT_INCLUDE_SESSIONS" ]; then |
|
183 |
JEDIT_INCLUDE_SESSIONS="$OPTARG" |
|
184 |
else |
|
185 |
JEDIT_INCLUDE_SESSIONS="$JEDIT_INCLUDE_SESSIONS:$OPTARG" |
|
186 |
fi |
|
187 |
;; |
|
43285 | 188 |
f) |
71372
85274743f789
clarified option -f: avoid accidental target_clean for proper release snapshot;
wenzelm
parents:
71371
diff
changeset
|
189 |
FRESH_BUILD="true" |
43285 | 190 |
;; |
34780 | 191 |
j) |
192 |
ARGS["${#ARGS[@]}"]="$OPTARG" |
|
193 |
;; |
|
194 |
l) |
|
195 |
JEDIT_LOGIC="$OPTARG" |
|
196 |
;; |
|
197 |
m) |
|
198 |
if [ -z "$JEDIT_PRINT_MODE" ]; then |
|
199 |
JEDIT_PRINT_MODE="$OPTARG" |
|
200 |
else |
|
201 |
JEDIT_PRINT_MODE="$JEDIT_PRINT_MODE,$OPTARG" |
|
202 |
fi |
|
203 |
;; |
|
50405
366c4a602500
clarified build_dialog: regular up-to-date check (extra cost of approx. 5s startup for HOL);
wenzelm
parents:
50403
diff
changeset
|
204 |
n) |
69854
cc0b3e177b49
system option "system_heaps" supersedes various command-line options for "system build mode";
wenzelm
parents:
69762
diff
changeset
|
205 |
JEDIT_NO_BUILD="true" |
50405
366c4a602500
clarified build_dialog: regular up-to-date check (extra cost of approx. 5s startup for HOL);
wenzelm
parents:
50403
diff
changeset
|
206 |
;; |
63986
c7a4b03727ae
options for process policy, notably for multiprocessor machines;
wenzelm
parents:
63734
diff
changeset
|
207 |
p) |
c7a4b03727ae
options for process policy, notably for multiprocessor machines;
wenzelm
parents:
63734
diff
changeset
|
208 |
ML_PROCESS_POLICY="$OPTARG" |
c7a4b03727ae
options for process policy, notably for multiprocessor machines;
wenzelm
parents:
63734
diff
changeset
|
209 |
;; |
50373 | 210 |
s) |
53449 | 211 |
JEDIT_BUILD_MODE="system" |
50373 | 212 |
;; |
69854
cc0b3e177b49
system option "system_heaps" supersedes various command-line options for "system build mode";
wenzelm
parents:
69762
diff
changeset
|
213 |
u) |
cc0b3e177b49
system option "system_heaps" supersedes various command-line options for "system build mode";
wenzelm
parents:
69762
diff
changeset
|
214 |
JEDIT_BUILD_MODE="user" |
cc0b3e177b49
system option "system_heaps" supersedes various command-line options for "system build mode";
wenzelm
parents:
69762
diff
changeset
|
215 |
;; |
34780 | 216 |
\?) |
217 |
usage |
|
218 |
;; |
|
219 |
esac |
|
220 |
done |
|
221 |
} |
|
34581
abab3a577e10
slightly more robust treatment of options via arrays;
wenzelm
parents:
34412
diff
changeset
|
222 |
|
66906 | 223 |
eval "declare -a JAVA_ARGS=($JEDIT_JAVA_SYSTEM_OPTIONS $JEDIT_JAVA_OPTIONS)" |
34843
eb8806a2e348
define scala.home, for more robust startup of Scala tools, notably the compiler;
wenzelm
parents:
34790
diff
changeset
|
224 |
|
53446
4adb2cce5fc6
use JEDIT_OPTIONS only once (in isabelle.Main.start_jedit);
wenzelm
parents:
53445
diff
changeset
|
225 |
declare -a ARGS=() |
34333 | 226 |
|
34780 | 227 |
declare -a OPTIONS; eval "OPTIONS=($ISABELLE_JEDIT_OPTIONS)" |
228 |
getoptions "${OPTIONS[@]}" |
|
229 |
||
230 |
getoptions "$@" |
|
34333 | 231 |
shift $(($OPTIND - 1)) |
232 |
||
233 |
||
234 |
# args |
|
235 |
||
61512
933463440449
more uniform command-line for "isabelle jedit" and the isabelle.Main app wrapper;
wenzelm
parents:
61511
diff
changeset
|
236 |
while [ "$#" -gt 0 ]; do |
933463440449
more uniform command-line for "isabelle jedit" and the isabelle.Main app wrapper;
wenzelm
parents:
61511
diff
changeset
|
237 |
ARGS["${#ARGS[@]}"]="$(platform_path "$1")" |
933463440449
more uniform command-line for "isabelle jedit" and the isabelle.Main app wrapper;
wenzelm
parents:
61511
diff
changeset
|
238 |
shift |
933463440449
more uniform command-line for "isabelle jedit" and the isabelle.Main app wrapper;
wenzelm
parents:
61511
diff
changeset
|
239 |
done |
34333 | 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 |
## dependencies |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
243 |
|
49953 | 244 |
if [ -e "$ISABELLE_HOME/Admin/build" ]; then |
62589
b5783412bfed
prefer plain "isabelle" from PATH within Isabelle settings environment;
wenzelm
parents:
62039
diff
changeset
|
245 |
isabelle browser -b || exit $? |
71372
85274743f789
clarified option -f: avoid accidental target_clean for proper release snapshot;
wenzelm
parents:
71371
diff
changeset
|
246 |
if [ -n "$FRESH_BUILD" ]; then |
85274743f789
clarified option -f: avoid accidental target_clean for proper release snapshot;
wenzelm
parents:
71371
diff
changeset
|
247 |
"$ISABELLE_HOME/Admin/build" jars_fresh || exit $? |
85274743f789
clarified option -f: avoid accidental target_clean for proper release snapshot;
wenzelm
parents:
71371
diff
changeset
|
248 |
else |
85274743f789
clarified option -f: avoid accidental target_clean for proper release snapshot;
wenzelm
parents:
71371
diff
changeset
|
249 |
"$ISABELLE_HOME/Admin/build" jars || exit $? |
85274743f789
clarified option -f: avoid accidental target_clean for proper release snapshot;
wenzelm
parents:
71371
diff
changeset
|
250 |
fi |
85274743f789
clarified option -f: avoid accidental target_clean for proper release snapshot;
wenzelm
parents:
71371
diff
changeset
|
251 |
elif [ -n "$FRESH_BUILD" ]; then |
85274743f789
clarified option -f: avoid accidental target_clean for proper release snapshot;
wenzelm
parents:
71371
diff
changeset
|
252 |
echo >&2 "### Ignoring fresh build option: not a repository clone" |
85274743f789
clarified option -f: avoid accidental target_clean for proper release snapshot;
wenzelm
parents:
71371
diff
changeset
|
253 |
FRESH_BUILD="" |
49953 | 254 |
fi |
43413 | 255 |
|
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
256 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
257 |
# target |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
258 |
|
71368 | 259 |
pushd "$ISABELLE_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
|
260 |
|
71368 | 261 |
TARGET_DIR="src/Tools/jEdit/dist" |
262 |
TARGET_JAR0="$TARGET_DIR/jars/Isabelle-jEdit-base.jar" |
|
263 |
TARGET_JAR="$TARGET_DIR/jars/Isabelle-jEdit.jar" |
|
264 |
TARGET_SHASUM="$TARGET_DIR/Isabelle-jEdit.shasum" |
|
265 |
||
266 |
declare -a TARGET_DEPS=("lib/classes/Pure.jar" "$TARGET_DIR/jedit.jar") |
|
73653
d9823224fcfe
build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
73652
diff
changeset
|
267 |
for DEP in "$TARGET_DIR"/jars/*.jar |
71368 | 268 |
do |
73653
d9823224fcfe
build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
73652
diff
changeset
|
269 |
TARGET_DEPS["${#TARGET_DEPS[@]}"]="$DEP" |
71368 | 270 |
done |
43384 | 271 |
|
71368 | 272 |
function target_shasum() |
273 |
( |
|
274 |
shasum -a1 -b "$TARGET_JAR0" "$TARGET_JAR" "${TARGET_DEPS[@]}" \ |
|
275 |
"${SOURCES0[@]}" "${RESOURCES0[@]}" "${SOURCES[@]}" "${RESOURCES[@]}" 2>/dev/null |
|
276 |
) |
|
277 |
||
278 |
function target_clean() |
|
279 |
{ |
|
280 |
rm -rf "$ISABELLE_HOME/$TARGET_DIR" |
|
281 |
} |
|
282 |
||
71372
85274743f789
clarified option -f: avoid accidental target_clean for proper release snapshot;
wenzelm
parents:
71371
diff
changeset
|
283 |
[ -n "$FRESH_BUILD" ] && target_clean |
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
284 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
285 |
|
71368 | 286 |
## build |
287 |
||
288 |
BUILD_DIR="$TARGET_DIR/build" |
|
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
289 |
|
66457
9098c36abd1a
separate base plugin for important services that should be always available, despite startup errors of the main plugin;
wenzelm
parents:
66120
diff
changeset
|
290 |
function init_resources () |
9098c36abd1a
separate base plugin for important services that should be always available, despite startup errors of the main plugin;
wenzelm
parents:
66120
diff
changeset
|
291 |
{ |
71368 | 292 |
mkdir -p "$BUILD_DIR" || failed |
293 |
cp -p -R "$@" "$BUILD_DIR/." |
|
66457
9098c36abd1a
separate base plugin for important services that should be always available, despite startup errors of the main plugin;
wenzelm
parents:
66120
diff
changeset
|
294 |
} |
9098c36abd1a
separate base plugin for important services that should be always available, despite startup errors of the main plugin;
wenzelm
parents:
66120
diff
changeset
|
295 |
|
71368 | 296 |
function compile_sources() |
66457
9098c36abd1a
separate base plugin for important services that should be always available, despite startup errors of the main plugin;
wenzelm
parents:
66120
diff
changeset
|
297 |
{ |
9098c36abd1a
separate base plugin for important services that should be always available, despite startup errors of the main plugin;
wenzelm
parents:
66120
diff
changeset
|
298 |
( |
9098c36abd1a
separate base plugin for important services that should be always available, despite startup errors of the main plugin;
wenzelm
parents:
66120
diff
changeset
|
299 |
#FIXME workarounds for scalac 2.11.0 |
9098c36abd1a
separate base plugin for important services that should be always available, despite startup errors of the main plugin;
wenzelm
parents:
66120
diff
changeset
|
300 |
export CYGWIN="nodosfilewarning" |
9098c36abd1a
separate base plugin for important services that should be always available, despite startup errors of the main plugin;
wenzelm
parents:
66120
diff
changeset
|
301 |
function stty() { :; } |
9098c36abd1a
separate base plugin for important services that should be always available, despite startup errors of the main plugin;
wenzelm
parents:
66120
diff
changeset
|
302 |
export -f stty |
9098c36abd1a
separate base plugin for important services that should be always available, despite startup errors of the main plugin;
wenzelm
parents:
66120
diff
changeset
|
303 |
|
71368 | 304 |
for DEP in "${TARGET_DEPS[@]}" |
66457
9098c36abd1a
separate base plugin for important services that should be always available, despite startup errors of the main plugin;
wenzelm
parents:
66120
diff
changeset
|
305 |
do |
71368 | 306 |
classpath "$DEP" |
66457
9098c36abd1a
separate base plugin for important services that should be always available, despite startup errors of the main plugin;
wenzelm
parents:
66120
diff
changeset
|
307 |
done |
9098c36abd1a
separate base plugin for important services that should be always available, despite startup errors of the main plugin;
wenzelm
parents:
66120
diff
changeset
|
308 |
export CLASSPATH="$(platform_path "$ISABELLE_CLASSPATH")" |
71368 | 309 |
isabelle_scala scalac $ISABELLE_SCALAC_OPTIONS -d "$BUILD_DIR" "$@" |
66457
9098c36abd1a
separate base plugin for important services that should be always available, despite startup errors of the main plugin;
wenzelm
parents:
66120
diff
changeset
|
310 |
) || fail "Failed to compile sources" |
9098c36abd1a
separate base plugin for important services that should be always available, despite startup errors of the main plugin;
wenzelm
parents:
66120
diff
changeset
|
311 |
} |
9098c36abd1a
separate base plugin for important services that should be always available, despite startup errors of the main plugin;
wenzelm
parents:
66120
diff
changeset
|
312 |
|
71368 | 313 |
function make_jar() |
66457
9098c36abd1a
separate base plugin for important services that should be always available, despite startup errors of the main plugin;
wenzelm
parents:
66120
diff
changeset
|
314 |
{ |
71368 | 315 |
isabelle_jdk jar -c -f "$1" -C "$BUILD_DIR" . || failed |
316 |
rm -rf "$ISABELLE_HOME/$BUILD_DIR" |
|
66457
9098c36abd1a
separate base plugin for important services that should be always available, despite startup errors of the main plugin;
wenzelm
parents:
66120
diff
changeset
|
317 |
} |
9098c36abd1a
separate base plugin for important services that should be always available, despite startup errors of the main plugin;
wenzelm
parents:
66120
diff
changeset
|
318 |
|
71375 | 319 |
target_shasum | cmp "$TARGET_SHASUM" >/dev/null 2>/dev/null |
71371 | 320 |
if [ -e "$ISABELLE_HOME/Admin/build" -a "$?" -ne 0 ]; then |
43405 | 321 |
echo "### Building Isabelle/jEdit ..." |
322 |
||
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
323 |
[ -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
|
324 |
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
|
325 |
|
71368 | 326 |
target_clean || failed |
327 |
mkdir -p "$TARGET_DIR" || failed |
|
43287 | 328 |
|
73653
d9823224fcfe
build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
73652
diff
changeset
|
329 |
cp -p -R "$ISABELLE_JEDIT_BUILD_HOME/$ISABELLE_JEDIT_BUILD_VERSION/." "$TARGET_DIR/." |
71368 | 330 |
|
331 |
init_resources "${RESOURCES0[@]}" |
|
332 |
compile_sources "${SOURCES0[@]}" |
|
333 |
make_jar "$TARGET_JAR0" |
|
334 |
classpath "$TARGET_JAR0" |
|
66457
9098c36abd1a
separate base plugin for important services that should be always available, despite startup errors of the main plugin;
wenzelm
parents:
66120
diff
changeset
|
335 |
|
9098c36abd1a
separate base plugin for important services that should be always available, despite startup errors of the main plugin;
wenzelm
parents:
66120
diff
changeset
|
336 |
init_resources "${RESOURCES[@]}" |
71368 | 337 |
cp src/Tools/jEdit/src/jEdit.props "$TARGET_DIR/properties/." |
338 |
cp -p -R -f "src/Tools/jEdit/src/modes/." "$TARGET_DIR/modes/." |
|
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
339 |
|
43391 | 340 |
perl -i -e 'while (<>) { |
69202
e0c32187916b
suppress "FreeMarker Template Language" file extension for the sake of SAD3/ForTheL;
wenzelm
parents:
68541
diff
changeset
|
341 |
if (m/FILE="ml.xml"/ or m/FILE_NAME_GLOB="...sml,ml."/ or m/FILE_NAME_GLOB="..ftl"/) { } |
55500 | 342 |
elsif (m/NAME="javacc"/) { |
62932
db12de2367ca
support ROOT0.ML as well -- independently of ROOT.ML;
wenzelm
parents:
62917
diff
changeset
|
343 |
print qq!<MODE NAME="isabelle" FILE="isabelle.xml" FILE_NAME_GLOB="{*.thy,ROOT0.ML,ROOT.ML}"/>\n\n!; |
62908 | 344 |
print qq!<MODE NAME="isabelle-ml" FILE="isabelle-ml.xml" FILE_NAME_GLOB="*.ML"/>\n\n!; |
345 |
print qq!<MODE NAME="isabelle-news" FILE="isabelle-news.xml"/>\n\n!; |
|
346 |
print qq!<MODE NAME="isabelle-options" FILE="isabelle-options.xml"/>\n\n!; |
|
347 |
print qq!<MODE NAME="isabelle-root" FILE="isabelle-root.xml" FILE_NAME_GLOB="ROOT"/>\n\n!; |
|
55500 | 348 |
print; |
349 |
} |
|
56277
c4f75e733812
separate "sml" mode, suppress old "ml" mode altogether;
wenzelm
parents:
56208
diff
changeset
|
350 |
elsif (m/NAME="sqr"/) { |
c4f75e733812
separate "sml" mode, suppress old "ml" mode altogether;
wenzelm
parents:
56208
diff
changeset
|
351 |
print qq!<MODE NAME="sml" FILE="sml.xml" FILE_NAME_GLOB="*.{sml,sig}"/>\n\n!; |
c4f75e733812
separate "sml" mode, suppress old "ml" mode altogether;
wenzelm
parents:
56208
diff
changeset
|
352 |
print; |
c4f75e733812
separate "sml" mode, suppress old "ml" mode altogether;
wenzelm
parents:
56208
diff
changeset
|
353 |
} |
55500 | 354 |
else { print; } |
71368 | 355 |
}' "$TARGET_DIR/modes/catalog" |
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
356 |
|
71368 | 357 |
( |
358 |
cd "$TARGET_DIR" |
|
359 |
isabelle_jdk jar -x -f jedit.jar |
|
360 |
cp "$ISABELLE_HOME/lib/logo/isabelle_transparent-32.gif" \ |
|
361 |
"org/gjt/sp/jedit/icons/themes/classic/32x32/apps/isabelle.gif" || failed |
|
362 |
cp "$ISABELLE_HOME/lib/logo/isabelle_transparent-32.gif" \ |
|
363 |
"org/gjt/sp/jedit/icons/themes/tango/32x32/apps/isabelle.gif" || failed |
|
364 |
isabelle_jdk jar -c -f jedit.jar -e org.gjt.sp.jedit.jEdit org || failed |
|
365 |
rm -rf META-INF org |
|
366 |
) |
|
54660 | 367 |
|
66457
9098c36abd1a
separate base plugin for important services that should be always available, despite startup errors of the main plugin;
wenzelm
parents:
66120
diff
changeset
|
368 |
compile_sources "${SOURCES[@]}" |
71368 | 369 |
make_jar "$TARGET_JAR" |
56422 | 370 |
|
71368 | 371 |
target_shasum > "$TARGET_SHASUM" |
372 |
||
72247 | 373 |
cp "$ISABELLE_JEDIT_BUILD_HOME/doc/jedit5.6.0manual-a4.pdf" "$TARGET_DIR/doc/jedit-manual.pdf" |
71368 | 374 |
cp "$TARGET_DIR/doc/CHANGES.txt" "$TARGET_DIR/doc/jedit-changes" |
375 |
cat > "$TARGET_DIR/doc/Contents" <<EOF |
|
57338 | 376 |
Original jEdit Documentation |
71932
65fd0f032a75
updated to jedit-5.6pre1 (repository version 25349);
wenzelm
parents:
71548
diff
changeset
|
377 |
jedit-manual jEdit 5.6 User's Guide |
65fd0f032a75
updated to jedit-5.6pre1 (repository version 25349);
wenzelm
parents:
71548
diff
changeset
|
378 |
jedit-changes jEdit 5.6 Version History |
56422 | 379 |
|
380 |
EOF |
|
381 |
||
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
382 |
fi |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
383 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
384 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
385 |
## main |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
386 |
|
71368 | 387 |
popd >/dev/null |
388 |
||
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
|
389 |
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
|
390 |
then |
73161
31fbde3baa97
more systematic java-gui-setup, also for "isabelle jedit" command-line tool;
wenzelm
parents:
72248
diff
changeset
|
391 |
"$ISABELLE_HOME/lib/scripts/java-gui-setup" |
31fbde3baa97
more systematic java-gui-setup, also for "isabelle jedit" command-line tool;
wenzelm
parents:
72248
diff
changeset
|
392 |
|
68370 | 393 |
export JEDIT_SESSION_DIRS JEDIT_LOGIC JEDIT_LOGIC_ANCESTOR JEDIT_LOGIC_REQUIREMENTS \ |
70683
8c7706b053c7
find theory files via session structure: much faster Prover IDE startup;
wenzelm
parents:
70382
diff
changeset
|
394 |
JEDIT_INCLUDE_SESSIONS JEDIT_PRINT_MODE JEDIT_NO_BUILD JEDIT_BUILD_MODE |
63986
c7a4b03727ae
options for process policy, notably for multiprocessor machines;
wenzelm
parents:
63734
diff
changeset
|
395 |
export JEDIT_ML_PROCESS_POLICY="$ML_PROCESS_POLICY" |
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
|
396 |
classpath "$JEDIT_HOME/dist/jedit.jar" |
70220
089753519be0
more uniform Isabelle splash screen -- avoid problems with jEdit splash and Java 11 on some Linux window managers;
wenzelm
parents:
69854
diff
changeset
|
397 |
exec isabelle java -splash:"$(platform_path "$ISABELLE_HOME/lib/logo/isabelle.gif")" \ |
089753519be0
more uniform Isabelle splash screen -- avoid problems with jEdit splash and Java 11 on some Linux window managers;
wenzelm
parents:
69854
diff
changeset
|
398 |
"${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
|
399 |
fi |