author | wenzelm |
Mon, 19 Jun 2017 21:15:06 +0200 | |
changeset 66120 | e03ff7e831cc |
parent 65572 | 6acb28e5ba41 |
child 66457 | 9098c36abd1a |
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 |
|
61133
c6d62d092246
clarified JEDIT_JAVA_OPTIONS: separate defaults for 32 vs. 64 bit;
wenzelm
parents:
61132
diff
changeset
|
8 |
## settings |
c6d62d092246
clarified JEDIT_JAVA_OPTIONS: separate defaults for 32 vs. 64 bit;
wenzelm
parents:
61132
diff
changeset
|
9 |
|
c6d62d092246
clarified JEDIT_JAVA_OPTIONS: separate defaults for 32 vs. 64 bit;
wenzelm
parents:
61132
diff
changeset
|
10 |
case "$ISABELLE_JAVA_PLATFORM" in |
c6d62d092246
clarified JEDIT_JAVA_OPTIONS: separate defaults for 32 vs. 64 bit;
wenzelm
parents:
61132
diff
changeset
|
11 |
x86_64-*) |
c6d62d092246
clarified JEDIT_JAVA_OPTIONS: separate defaults for 32 vs. 64 bit;
wenzelm
parents:
61132
diff
changeset
|
12 |
JEDIT_JAVA_OPTIONS="$JEDIT_JAVA_OPTIONS64" |
c6d62d092246
clarified JEDIT_JAVA_OPTIONS: separate defaults for 32 vs. 64 bit;
wenzelm
parents:
61132
diff
changeset
|
13 |
;; |
c6d62d092246
clarified JEDIT_JAVA_OPTIONS: separate defaults for 32 vs. 64 bit;
wenzelm
parents:
61132
diff
changeset
|
14 |
*) |
c6d62d092246
clarified JEDIT_JAVA_OPTIONS: separate defaults for 32 vs. 64 bit;
wenzelm
parents:
61132
diff
changeset
|
15 |
JEDIT_JAVA_OPTIONS="$JEDIT_JAVA_OPTIONS32" |
c6d62d092246
clarified JEDIT_JAVA_OPTIONS: separate defaults for 32 vs. 64 bit;
wenzelm
parents:
61132
diff
changeset
|
16 |
;; |
c6d62d092246
clarified JEDIT_JAVA_OPTIONS: separate defaults for 32 vs. 64 bit;
wenzelm
parents:
61132
diff
changeset
|
17 |
esac |
c6d62d092246
clarified JEDIT_JAVA_OPTIONS: separate defaults for 32 vs. 64 bit;
wenzelm
parents:
61132
diff
changeset
|
18 |
|
c6d62d092246
clarified JEDIT_JAVA_OPTIONS: separate defaults for 32 vs. 64 bit;
wenzelm
parents:
61132
diff
changeset
|
19 |
|
43285 | 20 |
## sources |
21 |
||
43320 | 22 |
declare -a SOURCES=( |
50450
358b6020f8b6
generalized notion of active area, where sendback is just one application;
wenzelm
parents:
50433
diff
changeset
|
23 |
"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
|
24 |
"src/completion_popup.scala" |
56585 | 25 |
"src/context_menu.scala" |
60749 | 26 |
"src/debugger_dockable.scala" |
43285 | 27 |
"src/dockable.scala" |
28 |
"src/document_model.scala" |
|
29 |
"src/document_view.scala" |
|
52445 | 30 |
"src/documentation_dockable.scala" |
50542
58bd88159f8f
fold handling within Pretty_Text_Area, based on formal document content, which is static here;
wenzelm
parents:
50450
diff
changeset
|
31 |
"src/fold_handling.scala" |
55825 | 32 |
"src/font_info.scala" |
49570 | 33 |
"src/graphview_dockable.scala" |
49726 | 34 |
"src/info_dockable.scala" |
50208 | 35 |
"src/isabelle.scala" |
43285 | 36 |
"src/isabelle_encoding.scala" |
37 |
"src/isabelle_options.scala" |
|
38 |
"src/isabelle_sidekick.scala" |
|
66120 | 39 |
"src/jedit_bibtex.scala" |
52971
31926d2c04ee
tuned signature -- more abstract PIDE editor operations;
wenzelm
parents:
52934
diff
changeset
|
40 |
"src/jedit_editor.scala" |
49406 | 41 |
"src/jedit_lib.scala" |
50202 | 42 |
"src/jedit_options.scala" |
64621 | 43 |
"src/jedit_rendering.scala" |
56208 | 44 |
"src/jedit_resources.scala" |
62973 | 45 |
"src/jedit_sessions.scala" |
65139 | 46 |
"src/jedit_spell_checker.scala" |
63734
133e3e84e6fb
some support for merge of Isabelle/jEdit shortcuts wrt. jEdit keymap;
wenzelm
parents:
63422
diff
changeset
|
47 |
"src/keymap_merge.scala" |
50433
9131dadb2bf7
basic monitor panel, using the powerful jfreechart library;
wenzelm
parents:
50416
diff
changeset
|
48 |
"src/monitor_dockable.scala" |
43285 | 49 |
"src/output_dockable.scala" |
56906
408b526911f7
some odd tricks to provide "Detach" menu item, via "PIDE" docking framework;
wenzelm
parents:
56879
diff
changeset
|
50 |
"src/pide_docking_framework.scala" |
43285 | 51 |
"src/plugin.scala" |
49398
0fa4389c04f9
alternative output panel, based on Pretty_Text_Area, based on JEditEmbeddedTextArea;
wenzelm
parents:
49246
diff
changeset
|
52 |
"src/pretty_text_area.scala" |
49702 | 53 |
"src/pretty_tooltip.scala" |
52934
bfb6873df88e
separate Process_Indicator -- simplified/clarified version of org.gjt.sp.jedit.gui.AnimatedIcon;
wenzelm
parents:
52908
diff
changeset
|
54 |
"src/process_indicator.scala" |
43285 | 55 |
"src/protocol_dockable.scala" |
56879
ee2b61f37ad9
renamed "Find" to "Query", with more general operations;
wenzelm
parents:
56764
diff
changeset
|
56 |
"src/query_dockable.scala" |
43285 | 57 |
"src/raw_output_dockable.scala" |
49411 | 58 |
"src/rich_text_area.scala" |
43285 | 59 |
"src/scala_console.scala" |
61288 | 60 |
"src/session_build.scala" |
55316
885500f4aa6a
interactive simplifier trace: new panel in Isabelle/jEdit to inspect and modify simplification state
Lars Hupel <lars.hupel@mytum.de>
parents:
54682
diff
changeset
|
61 |
"src/simplifier_trace_dockable.scala" |
885500f4aa6a
interactive simplifier trace: new panel in Isabelle/jEdit to inspect and modify simplification state
Lars Hupel <lars.hupel@mytum.de>
parents:
54682
diff
changeset
|
62 |
"src/simplifier_trace_window.scala" |
58529 | 63 |
"src/sledgehammer_dockable.scala" |
61208 | 64 |
"src/state_dockable.scala" |
50143
4ff5d795ed08
dockable with buttons for symbols, grouped and sorted in tabs according to ~~/etc/symbols;
immler
parents:
50120
diff
changeset
|
65 |
"src/symbols_dockable.scala" |
65258 | 66 |
"src/syntax_style.scala" |
48021
d899be1cfe6d
separate syslog dockable -- discontinued tendency of sub-window management via tabs;
wenzelm
parents:
48014
diff
changeset
|
67 |
"src/syslog_dockable.scala" |
46572 | 68 |
"src/text_overview.scala" |
63422 | 69 |
"src/text_structure.scala" |
50299 | 70 |
"src/theories_dockable.scala" |
51533 | 71 |
"src/timing_dockable.scala" |
43414 | 72 |
"src/token_markup.scala" |
43285 | 73 |
) |
74 |
||
43320 | 75 |
declare -a RESOURCES=( |
43286 | 76 |
"src/actions.xml" |
77 |
"src/dockables.xml" |
|
78 |
"src/Isabelle.props" |
|
50306 | 79 |
"src/jEdit.props" |
43286 | 80 |
"src/services.xml" |
55500 | 81 |
"src/modes/isabelle-ml.xml" |
52540 | 82 |
"src/modes/isabelle-news.xml" |
83 |
"src/modes/isabelle-options.xml" |
|
84 |
"src/modes/isabelle-root.xml" |
|
85 |
"src/modes/isabelle.xml" |
|
56277
c4f75e733812
separate "sml" mode, suppress old "ml" mode altogether;
wenzelm
parents:
56208
diff
changeset
|
86 |
"src/modes/sml.xml" |
43285 | 87 |
) |
88 |
||
89 |
||
34333 | 90 |
## diagnostics |
91 |
||
34664 | 92 |
PRG="$(basename "$0")" |
93 |
||
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
94 |
function usage() |
34333 | 95 |
{ |
96 |
echo |
|
34664 | 97 |
echo "Usage: isabelle $PRG [OPTIONS] [FILES ...]" |
34333 | 98 |
echo |
99 |
echo " Options are:" |
|
62039 | 100 |
echo " -D NAME=X set JVM system property" |
61133
c6d62d092246
clarified JEDIT_JAVA_OPTIONS: separate defaults for 32 vs. 64 bit;
wenzelm
parents:
61132
diff
changeset
|
101 |
echo " -J OPTION add JVM runtime option (default $JEDIT_JAVA_SYSTEM_OPTIONS $JEDIT_JAVA_OPTIONS)" |
65572
6acb28e5ba41
clarified meaning of "isabelle jedit -R": avoid potential problems with all_known = true;
wenzelm
parents:
65541
diff
changeset
|
102 |
echo " -R restrict to parent of logic session and open its ROOT" |
43285 | 103 |
echo " -b build only" |
48791 | 104 |
echo " -d DIR include session directory" |
43285 | 105 |
echo " -f fresh build" |
34333 | 106 |
echo " -j OPTION add jEdit runtime option" |
107 |
echo " (default JEDIT_OPTIONS=$JEDIT_OPTIONS)" |
|
50403
87868964733c
more uniform default logic, using settings, options, args etc.;
wenzelm
parents:
50373
diff
changeset
|
108 |
echo " -l NAME logic session name" |
34333 | 109 |
echo " -m MODE add print mode for output" |
57086 | 110 |
echo " -n no build of session image on startup" |
63986
c7a4b03727ae
options for process policy, notably for multiprocessor machines;
wenzelm
parents:
63734
diff
changeset
|
111 |
echo " -p CMD ML process command prefix (process policy)" |
50373 | 112 |
echo " -s system build mode for session image" |
34333 | 113 |
echo |
61171 | 114 |
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
|
115 |
echo " (default \"$USER_HOME/Scratch.thy\" or \":\" for empty buffer)." |
34333 | 116 |
echo |
117 |
exit 1 |
|
118 |
} |
|
119 |
||
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
120 |
function fail() |
34333 | 121 |
{ |
122 |
echo "$1" >&2 |
|
123 |
exit 2 |
|
124 |
} |
|
125 |
||
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
126 |
function failed() |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
127 |
{ |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
128 |
fail "Failed!" |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
129 |
} |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
130 |
|
34333 | 131 |
|
132 |
## process command line |
|
133 |
||
134 |
# options |
|
135 |
||
43285 | 136 |
BUILD_ONLY=false |
137 |
BUILD_JARS="jars" |
|
63986
c7a4b03727ae
options for process policy, notably for multiprocessor machines;
wenzelm
parents:
63734
diff
changeset
|
138 |
ML_PROCESS_POLICY="" |
48791 | 139 |
JEDIT_SESSION_DIRS="" |
65572
6acb28e5ba41
clarified meaning of "isabelle jedit -R": avoid potential problems with all_known = true;
wenzelm
parents:
65541
diff
changeset
|
140 |
JEDIT_LOGIC_RESTRICT="" |
50403
87868964733c
more uniform default logic, using settings, options, args etc.;
wenzelm
parents:
50373
diff
changeset
|
141 |
JEDIT_LOGIC="" |
34333 | 142 |
JEDIT_PRINT_MODE="" |
53449 | 143 |
JEDIT_BUILD_MODE="normal" |
34333 | 144 |
|
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
145 |
function getoptions() |
34780 | 146 |
{ |
147 |
OPTIND=1 |
|
65541
ae09b9f5980b
afford unconditional all_known = true (reverting ea42dfd95ec8), for practical usability of qualified imports from arbitrary sessions;
wenzelm
parents:
65531
diff
changeset
|
148 |
while getopts "D:J:Rbd:fj:l:m:np:s" OPT |
34780 | 149 |
do |
150 |
case "$OPT" in |
|
62039 | 151 |
D) |
152 |
JAVA_ARGS["${#JAVA_ARGS[@]}"]="-D$OPTARG" |
|
153 |
;; |
|
34780 | 154 |
J) |
155 |
JAVA_ARGS["${#JAVA_ARGS[@]}"]="$OPTARG" |
|
156 |
;; |
|
64602 | 157 |
R) |
65572
6acb28e5ba41
clarified meaning of "isabelle jedit -R": avoid potential problems with all_known = true;
wenzelm
parents:
65541
diff
changeset
|
158 |
JEDIT_LOGIC_RESTRICT="true" |
64602 | 159 |
;; |
43285 | 160 |
b) |
161 |
BUILD_ONLY=true |
|
162 |
;; |
|
48791 | 163 |
d) |
164 |
if [ -z "$JEDIT_SESSION_DIRS" ]; then |
|
165 |
JEDIT_SESSION_DIRS="$OPTARG" |
|
166 |
else |
|
167 |
JEDIT_SESSION_DIRS="$JEDIT_SESSION_DIRS:$OPTARG" |
|
168 |
fi |
|
169 |
;; |
|
43285 | 170 |
f) |
171 |
BUILD_JARS="jars_fresh" |
|
172 |
;; |
|
34780 | 173 |
j) |
174 |
ARGS["${#ARGS[@]}"]="$OPTARG" |
|
175 |
;; |
|
176 |
l) |
|
177 |
JEDIT_LOGIC="$OPTARG" |
|
178 |
;; |
|
179 |
m) |
|
180 |
if [ -z "$JEDIT_PRINT_MODE" ]; then |
|
181 |
JEDIT_PRINT_MODE="$OPTARG" |
|
182 |
else |
|
183 |
JEDIT_PRINT_MODE="$JEDIT_PRINT_MODE,$OPTARG" |
|
184 |
fi |
|
185 |
;; |
|
50405
366c4a602500
clarified build_dialog: regular up-to-date check (extra cost of approx. 5s startup for HOL);
wenzelm
parents:
50403
diff
changeset
|
186 |
n) |
53449 | 187 |
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
|
188 |
;; |
63986
c7a4b03727ae
options for process policy, notably for multiprocessor machines;
wenzelm
parents:
63734
diff
changeset
|
189 |
p) |
c7a4b03727ae
options for process policy, notably for multiprocessor machines;
wenzelm
parents:
63734
diff
changeset
|
190 |
ML_PROCESS_POLICY="$OPTARG" |
c7a4b03727ae
options for process policy, notably for multiprocessor machines;
wenzelm
parents:
63734
diff
changeset
|
191 |
;; |
50373 | 192 |
s) |
53449 | 193 |
JEDIT_BUILD_MODE="system" |
50373 | 194 |
;; |
34780 | 195 |
\?) |
196 |
usage |
|
197 |
;; |
|
198 |
esac |
|
199 |
done |
|
200 |
} |
|
34581
abab3a577e10
slightly more robust treatment of options via arrays;
wenzelm
parents:
34412
diff
changeset
|
201 |
|
61132 | 202 |
declare -a JAVA_ARGS; eval "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
|
203 |
|
53446
4adb2cce5fc6
use JEDIT_OPTIONS only once (in isabelle.Main.start_jedit);
wenzelm
parents:
53445
diff
changeset
|
204 |
declare -a ARGS=() |
34333 | 205 |
|
34780 | 206 |
declare -a OPTIONS; eval "OPTIONS=($ISABELLE_JEDIT_OPTIONS)" |
207 |
getoptions "${OPTIONS[@]}" |
|
208 |
||
209 |
getoptions "$@" |
|
34333 | 210 |
shift $(($OPTIND - 1)) |
211 |
||
212 |
||
213 |
# args |
|
214 |
||
61512
933463440449
more uniform command-line for "isabelle jedit" and the isabelle.Main app wrapper;
wenzelm
parents:
61511
diff
changeset
|
215 |
while [ "$#" -gt 0 ]; do |
933463440449
more uniform command-line for "isabelle jedit" and the isabelle.Main app wrapper;
wenzelm
parents:
61511
diff
changeset
|
216 |
ARGS["${#ARGS[@]}"]="$(platform_path "$1")" |
933463440449
more uniform command-line for "isabelle jedit" and the isabelle.Main app wrapper;
wenzelm
parents:
61511
diff
changeset
|
217 |
shift |
933463440449
more uniform command-line for "isabelle jedit" and the isabelle.Main app wrapper;
wenzelm
parents:
61511
diff
changeset
|
218 |
done |
34333 | 219 |
|
220 |
||
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
221 |
## dependencies |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
222 |
|
49953 | 223 |
if [ -e "$ISABELLE_HOME/Admin/build" ]; then |
62589
b5783412bfed
prefer plain "isabelle" from PATH within Isabelle settings environment;
wenzelm
parents:
62039
diff
changeset
|
224 |
isabelle browser -b || exit $? |
57032
cf570f3ecdc1
incorporate isabelle.graphview into Pure.jar, which saves 20..30s build time;
wenzelm
parents:
56906
diff
changeset
|
225 |
"$ISABELLE_HOME/Admin/build" "$BUILD_JARS" || exit $? |
49953 | 226 |
fi |
43413 | 227 |
|
53577 | 228 |
PURE_JAR="$ISABELLE_HOME/lib/classes/Pure.jar" |
43413 | 229 |
|
43285 | 230 |
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
|
231 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
232 |
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
|
233 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
234 |
JEDIT_JARS=( |
56421
1ffd7eaa778b
updated to jedit_build-20140405: Code2HTML.jar, CommonControls.jar, Console.jar, kappalayout.jar, Navigator.jar, SideKick.jar, doc with jEdit manuals (ant dist-manuals);
wenzelm
parents:
56277
diff
changeset
|
235 |
"$ISABELLE_JEDIT_BUILD_HOME/contrib/Code2HTML.jar" |
1ffd7eaa778b
updated to jedit_build-20140405: Code2HTML.jar, CommonControls.jar, Console.jar, kappalayout.jar, Navigator.jar, SideKick.jar, doc with jEdit manuals (ant dist-manuals);
wenzelm
parents:
56277
diff
changeset
|
236 |
"$ISABELLE_JEDIT_BUILD_HOME/contrib/CommonControls.jar" |
53445
811db2b751ed
warm start of Isabelle/jEdit from Isabelle/Scala;
wenzelm
parents:
53441
diff
changeset
|
237 |
"$ISABELLE_JEDIT_BUILD_HOME/contrib/Console.jar" |
811db2b751ed
warm start of Isabelle/jEdit from Isabelle/Scala;
wenzelm
parents:
53441
diff
changeset
|
238 |
"$ISABELLE_JEDIT_BUILD_HOME/contrib/ErrorList.jar" |
811db2b751ed
warm start of Isabelle/jEdit from Isabelle/Scala;
wenzelm
parents:
53441
diff
changeset
|
239 |
"$ISABELLE_JEDIT_BUILD_HOME/contrib/Highlight.jar" |
56421
1ffd7eaa778b
updated to jedit_build-20140405: Code2HTML.jar, CommonControls.jar, Console.jar, kappalayout.jar, Navigator.jar, SideKick.jar, doc with jEdit manuals (ant dist-manuals);
wenzelm
parents:
56277
diff
changeset
|
240 |
"$ISABELLE_JEDIT_BUILD_HOME/contrib/kappalayout.jar" |
53883
f1c5f857df3d
include MacOSX plugin by default -- disabled by default to avoid multiplatform confusion;
wenzelm
parents:
53882
diff
changeset
|
241 |
"$ISABELLE_JEDIT_BUILD_HOME/contrib/MacOSX.jar" |
56421
1ffd7eaa778b
updated to jedit_build-20140405: Code2HTML.jar, CommonControls.jar, Console.jar, kappalayout.jar, Navigator.jar, SideKick.jar, doc with jEdit manuals (ant dist-manuals);
wenzelm
parents:
56277
diff
changeset
|
242 |
"$ISABELLE_JEDIT_BUILD_HOME/contrib/Navigator.jar" |
53445
811db2b751ed
warm start of Isabelle/jEdit from Isabelle/Scala;
wenzelm
parents:
53441
diff
changeset
|
243 |
"$ISABELLE_JEDIT_BUILD_HOME/contrib/SideKick.jar" |
811db2b751ed
warm start of Isabelle/jEdit from Isabelle/Scala;
wenzelm
parents:
53441
diff
changeset
|
244 |
"$ISABELLE_JEDIT_BUILD_HOME/contrib/idea-icons.jar" |
811db2b751ed
warm start of Isabelle/jEdit from Isabelle/Scala;
wenzelm
parents:
53441
diff
changeset
|
245 |
"$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
|
246 |
) |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
247 |
|
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 |
# target |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
250 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
251 |
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
|
252 |
|
43384 | 253 |
declare -a UPDATED=() |
254 |
||
43285 | 255 |
if [ "$BUILD_JARS" = jars_fresh ]; then |
256 |
OUTDATED=true |
|
257 |
else |
|
258 |
OUTDATED=false |
|
43368
0dc67b3cf8a5
check source dependencies only if jedit_build component is available;
wenzelm
parents:
43320
diff
changeset
|
259 |
if [ ! -e "$TARGET" ]; then |
0dc67b3cf8a5
check source dependencies only if jedit_build component is available;
wenzelm
parents:
43320
diff
changeset
|
260 |
OUTDATED=true |
43384 | 261 |
else |
262 |
if [ -n "$ISABELLE_JEDIT_BUILD_HOME" ]; then |
|
49566
66cbf8bb4693
basic integration of graphview into document model;
wenzelm
parents:
49494
diff
changeset
|
263 |
declare -a DEPS=( |
57032
cf570f3ecdc1
incorporate isabelle.graphview into Pure.jar, which saves 20..30s build time;
wenzelm
parents:
56906
diff
changeset
|
264 |
"$JEDIT_JAR" "${JEDIT_JARS[@]}" "$PURE_JAR" |
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
|
265 |
"${SOURCES[@]}" "${RESOURCES[@]}" |
49566
66cbf8bb4693
basic integration of graphview into document model;
wenzelm
parents:
49494
diff
changeset
|
266 |
) |
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
|
267 |
elif [ -e "$ISABELLE_HOME/Admin/build" ]; then |
57032
cf570f3ecdc1
incorporate isabelle.graphview into Pure.jar, which saves 20..30s build time;
wenzelm
parents:
56906
diff
changeset
|
268 |
declare -a DEPS=("$PURE_JAR" "${SOURCES[@]}" "${RESOURCES[@]}") |
43384 | 269 |
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
|
270 |
declare -a DEPS=() |
43384 | 271 |
fi |
272 |
for DEP in "${DEPS[@]}" |
|
43368
0dc67b3cf8a5
check source dependencies only if jedit_build component is available;
wenzelm
parents:
43320
diff
changeset
|
273 |
do |
43384 | 274 |
[ ! -e "$DEP" ] && fail "Missing file: $DEP" |
275 |
[ "$DEP" -nt "$TARGET" ] && { |
|
276 |
OUTDATED=true |
|
277 |
UPDATED["${#UPDATED[@]}"]="$DEP" |
|
278 |
} |
|
43368
0dc67b3cf8a5
check source dependencies only if jedit_build component is available;
wenzelm
parents:
43320
diff
changeset
|
279 |
done |
0dc67b3cf8a5
check source dependencies only if jedit_build component is available;
wenzelm
parents:
43320
diff
changeset
|
280 |
fi |
43285 | 281 |
fi |
43284
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 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
284 |
# build |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
285 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
286 |
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
|
287 |
then |
43405 | 288 |
echo "### Building Isabelle/jEdit ..." |
289 |
||
43384 | 290 |
[ "${#UPDATED[@]}" -gt 0 ] && { |
43405 | 291 |
echo "Changed files:" |
43384 | 292 |
for FILE in "${UPDATED[@]}" |
293 |
do |
|
294 |
echo " $FILE" |
|
295 |
done |
|
296 |
} |
|
297 |
||
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
298 |
[ -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
|
299 |
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
|
300 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
301 |
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
|
302 |
mkdir -p dist dist/classes || failed |
43287 | 303 |
|
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
|
304 |
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
|
305 |
cp -p -R -f "${RESOURCES[@]}" dist/classes/. |
43287 | 306 |
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
|
307 |
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
|
308 |
|
43391 | 309 |
perl -i -e 'while (<>) { |
61305
12378df46752
less ambitious regex -- avoid unclarities of escaping;
wenzelm
parents:
61294
diff
changeset
|
310 |
if (m/FILE="ml.xml"/ or m/FILE_NAME_GLOB="...sml,ml."/) { } |
55500 | 311 |
elsif (m/NAME="javacc"/) { |
62932
db12de2367ca
support ROOT0.ML as well -- independently of ROOT.ML;
wenzelm
parents:
62917
diff
changeset
|
312 |
print qq!<MODE NAME="isabelle" FILE="isabelle.xml" FILE_NAME_GLOB="{*.thy,ROOT0.ML,ROOT.ML}"/>\n\n!; |
62908 | 313 |
print qq!<MODE NAME="isabelle-ml" FILE="isabelle-ml.xml" FILE_NAME_GLOB="*.ML"/>\n\n!; |
314 |
print qq!<MODE NAME="isabelle-news" FILE="isabelle-news.xml"/>\n\n!; |
|
315 |
print qq!<MODE NAME="isabelle-options" FILE="isabelle-options.xml"/>\n\n!; |
|
316 |
print qq!<MODE NAME="isabelle-root" FILE="isabelle-root.xml" FILE_NAME_GLOB="ROOT"/>\n\n!; |
|
55500 | 317 |
print; |
318 |
} |
|
56277
c4f75e733812
separate "sml" mode, suppress old "ml" mode altogether;
wenzelm
parents:
56208
diff
changeset
|
319 |
elsif (m/NAME="sqr"/) { |
c4f75e733812
separate "sml" mode, suppress old "ml" mode altogether;
wenzelm
parents:
56208
diff
changeset
|
320 |
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
|
321 |
print; |
c4f75e733812
separate "sml" mode, suppress old "ml" mode altogether;
wenzelm
parents:
56208
diff
changeset
|
322 |
} |
55500 | 323 |
else { print; } |
324 |
}' dist/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
|
325 |
|
54660 | 326 |
cd dist |
327 |
isabelle_jdk jar xf jedit.jar |
|
54676
6b2ca4850b71
uniform use of transparent icons, as for main "apps";
wenzelm
parents:
54667
diff
changeset
|
328 |
cp "$ISABELLE_HOME/lib/logo/isabelle_transparent-32.gif" \ |
54660 | 329 |
"org/gjt/sp/jedit/icons/themes/classic/32x32/apps/isabelle.gif" || failed |
54676
6b2ca4850b71
uniform use of transparent icons, as for main "apps";
wenzelm
parents:
54667
diff
changeset
|
330 |
cp "$ISABELLE_HOME/lib/logo/isabelle_transparent-32.gif" \ |
54660 | 331 |
"org/gjt/sp/jedit/icons/themes/tango/32x32/apps/isabelle.gif" || failed |
54666
391ba1e12360
recover main entry point from d9c88171b393 -- occasionally useful with plain "java -jar jedit.jar";
wenzelm
parents:
54660
diff
changeset
|
332 |
isabelle_jdk jar cfe jedit.jar org.gjt.sp.jedit.jEdit org || failed |
54667 | 333 |
rm -rf META-INF org |
54660 | 334 |
cd .. |
335 |
||
53445
811db2b751ed
warm start of Isabelle/jEdit from Isabelle/Scala;
wenzelm
parents:
53441
diff
changeset
|
336 |
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
|
337 |
( |
57618 | 338 |
#FIXME workarounds for scalac 2.11.0 |
339 |
export CYGWIN="nodosfilewarning" |
|
53451 | 340 |
function stty() { :; } |
341 |
export -f stty |
|
342 |
||
57032
cf570f3ecdc1
incorporate isabelle.graphview into Pure.jar, which saves 20..30s build time;
wenzelm
parents:
56906
diff
changeset
|
343 |
for JAR in "$JEDIT_JAR" "${JEDIT_JARS[@]}" "$PURE_JAR" |
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
344 |
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
|
345 |
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
|
346 |
done |
61294 | 347 |
export CLASSPATH="$(platform_path "$ISABELLE_CLASSPATH")" |
65531 | 348 |
isabelle_scala scalac $ISABELLE_SCALAC_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
|
349 |
) || 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
|
350 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
351 |
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
|
352 |
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
|
353 |
cd ../.. |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
354 |
rm -rf dist/classes |
56422 | 355 |
|
65329 | 356 |
cp "$ISABELLE_JEDIT_BUILD_HOME/doc/jedit5.4.0manual-a4.pdf" dist/doc/jedit-manual.pdf |
56422 | 357 |
cp dist/doc/CHANGES.txt dist/doc/jedit-changes |
358 |
cat > dist/doc/Contents <<EOF |
|
57338 | 359 |
Original jEdit Documentation |
65329 | 360 |
jedit-manual jEdit 5.4 User's Guide |
361 |
jedit-changes jEdit 5.4 Version History |
|
56422 | 362 |
|
363 |
EOF |
|
364 |
||
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
365 |
fi |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
366 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
367 |
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
|
368 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
369 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
370 |
## main |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
371 |
|
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
|
372 |
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
|
373 |
then |
65572
6acb28e5ba41
clarified meaning of "isabelle jedit -R": avoid potential problems with all_known = true;
wenzelm
parents:
65541
diff
changeset
|
374 |
export JEDIT_SESSION_DIRS JEDIT_LOGIC JEDIT_LOGIC_RESTRICT JEDIT_PRINT_MODE JEDIT_BUILD_MODE |
63986
c7a4b03727ae
options for process policy, notably for multiprocessor machines;
wenzelm
parents:
63734
diff
changeset
|
375 |
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
|
376 |
classpath "$JEDIT_HOME/dist/jedit.jar" |
63987
ac96fe9224f6
just one option is enough -- "isabelle jedit" java process may be prefixed directly in the shell;
wenzelm
parents:
63986
diff
changeset
|
377 |
exec isabelle 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
|
378 |
fi |