author | wenzelm |
Fri, 08 Apr 2016 22:48:25 +0200 | |
changeset 62917 | eed66ba99bd9 |
parent 62914 | 930a30c1a9af |
child 62932 | db12de2367ca |
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" |
58545
30b75b7958d6
citation tooltip/hyperlink based on open buffers with .bib files;
wenzelm
parents:
58529
diff
changeset
|
24 |
"src/bibtex_jedit.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
|
25 |
"src/completion_popup.scala" |
56585 | 26 |
"src/context_menu.scala" |
60749 | 27 |
"src/debugger_dockable.scala" |
43285 | 28 |
"src/dockable.scala" |
29 |
"src/document_model.scala" |
|
30 |
"src/document_view.scala" |
|
52445 | 31 |
"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
|
32 |
"src/fold_handling.scala" |
55825 | 33 |
"src/font_info.scala" |
49570 | 34 |
"src/graphview_dockable.scala" |
49726 | 35 |
"src/info_dockable.scala" |
50208 | 36 |
"src/isabelle.scala" |
43285 | 37 |
"src/isabelle_encoding.scala" |
49246 | 38 |
"src/isabelle_logic.scala" |
43285 | 39 |
"src/isabelle_options.scala" |
40 |
"src/isabelle_sidekick.scala" |
|
52971
31926d2c04ee
tuned signature -- more abstract PIDE editor operations;
wenzelm
parents:
52934
diff
changeset
|
41 |
"src/jedit_editor.scala" |
49406 | 42 |
"src/jedit_lib.scala" |
50202 | 43 |
"src/jedit_options.scala" |
56208 | 44 |
"src/jedit_resources.scala" |
50433
9131dadb2bf7
basic monitor panel, using the powerful jfreechart library;
wenzelm
parents:
50416
diff
changeset
|
45 |
"src/monitor_dockable.scala" |
43285 | 46 |
"src/output_dockable.scala" |
56906
408b526911f7
some odd tricks to provide "Detach" menu item, via "PIDE" docking framework;
wenzelm
parents:
56879
diff
changeset
|
47 |
"src/pide_docking_framework.scala" |
43285 | 48 |
"src/plugin.scala" |
49398
0fa4389c04f9
alternative output panel, based on Pretty_Text_Area, based on JEditEmbeddedTextArea;
wenzelm
parents:
49246
diff
changeset
|
49 |
"src/pretty_text_area.scala" |
49702 | 50 |
"src/pretty_tooltip.scala" |
52934
bfb6873df88e
separate Process_Indicator -- simplified/clarified version of org.gjt.sp.jedit.gui.AnimatedIcon;
wenzelm
parents:
52908
diff
changeset
|
51 |
"src/process_indicator.scala" |
43285 | 52 |
"src/protocol_dockable.scala" |
56879
ee2b61f37ad9
renamed "Find" to "Query", with more general operations;
wenzelm
parents:
56764
diff
changeset
|
53 |
"src/query_dockable.scala" |
43285 | 54 |
"src/raw_output_dockable.scala" |
50202 | 55 |
"src/rendering.scala" |
49411 | 56 |
"src/rich_text_area.scala" |
43285 | 57 |
"src/scala_console.scala" |
61288 | 58 |
"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
|
59 |
"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
|
60 |
"src/simplifier_trace_window.scala" |
58529 | 61 |
"src/sledgehammer_dockable.scala" |
56547 | 62 |
"src/spell_checker.scala" |
61208 | 63 |
"src/state_dockable.scala" |
58748 | 64 |
"src/structure_matching.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" |
48021
d899be1cfe6d
separate syslog dockable -- discontinued tendency of sub-window management via tabs;
wenzelm
parents:
48014
diff
changeset
|
66 |
"src/syslog_dockable.scala" |
46572 | 67 |
"src/text_overview.scala" |
50299 | 68 |
"src/theories_dockable.scala" |
51533 | 69 |
"src/timing_dockable.scala" |
43414 | 70 |
"src/token_markup.scala" |
43285 | 71 |
) |
72 |
||
43320 | 73 |
declare -a RESOURCES=( |
43286 | 74 |
"src/actions.xml" |
75 |
"src/dockables.xml" |
|
76 |
"src/Isabelle.props" |
|
50306 | 77 |
"src/jEdit.props" |
43286 | 78 |
"src/services.xml" |
55500 | 79 |
"src/modes/isabelle-ml.xml" |
52540 | 80 |
"src/modes/isabelle-news.xml" |
81 |
"src/modes/isabelle-options.xml" |
|
82 |
"src/modes/isabelle-root.xml" |
|
83 |
"src/modes/isabelle.xml" |
|
56277
c4f75e733812
separate "sml" mode, suppress old "ml" mode altogether;
wenzelm
parents:
56208
diff
changeset
|
84 |
"src/modes/sml.xml" |
43285 | 85 |
) |
86 |
||
87 |
||
34333 | 88 |
## diagnostics |
89 |
||
34664 | 90 |
PRG="$(basename "$0")" |
91 |
||
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
92 |
function usage() |
34333 | 93 |
{ |
94 |
echo |
|
34664 | 95 |
echo "Usage: isabelle $PRG [OPTIONS] [FILES ...]" |
34333 | 96 |
echo |
97 |
echo " Options are:" |
|
62039 | 98 |
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
|
99 |
echo " -J OPTION add JVM runtime option (default $JEDIT_JAVA_SYSTEM_OPTIONS $JEDIT_JAVA_OPTIONS)" |
43285 | 100 |
echo " -b build only" |
48791 | 101 |
echo " -d DIR include session directory" |
43285 | 102 |
echo " -f fresh build" |
34333 | 103 |
echo " -j OPTION add jEdit runtime option" |
104 |
echo " (default JEDIT_OPTIONS=$JEDIT_OPTIONS)" |
|
50403
87868964733c
more uniform default logic, using settings, options, args etc.;
wenzelm
parents:
50373
diff
changeset
|
105 |
echo " -l NAME logic session name" |
34333 | 106 |
echo " -m MODE add print mode for output" |
57086 | 107 |
echo " -n no build of session image on startup" |
50373 | 108 |
echo " -s system build mode for session image" |
34333 | 109 |
echo |
61171 | 110 |
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
|
111 |
echo " (default \"$USER_HOME/Scratch.thy\" or \":\" for empty buffer)." |
34333 | 112 |
echo |
113 |
exit 1 |
|
114 |
} |
|
115 |
||
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
116 |
function fail() |
34333 | 117 |
{ |
118 |
echo "$1" >&2 |
|
119 |
exit 2 |
|
120 |
} |
|
121 |
||
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
122 |
function failed() |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
123 |
{ |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
124 |
fail "Failed!" |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
125 |
} |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
126 |
|
34333 | 127 |
|
128 |
## process command line |
|
129 |
||
130 |
# options |
|
131 |
||
43285 | 132 |
BUILD_ONLY=false |
133 |
BUILD_JARS="jars" |
|
48791 | 134 |
JEDIT_SESSION_DIRS="" |
50403
87868964733c
more uniform default logic, using settings, options, args etc.;
wenzelm
parents:
50373
diff
changeset
|
135 |
JEDIT_LOGIC="" |
34333 | 136 |
JEDIT_PRINT_MODE="" |
53449 | 137 |
JEDIT_BUILD_MODE="normal" |
34333 | 138 |
|
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
139 |
function getoptions() |
34780 | 140 |
{ |
141 |
OPTIND=1 |
|
62917
eed66ba99bd9
backout 930a30c1a9af: leads to odd effect of command-line options becoming persistent preferences;
wenzelm
parents:
62914
diff
changeset
|
142 |
while getopts "D:J:bd:fj:l:m:ns" OPT |
34780 | 143 |
do |
144 |
case "$OPT" in |
|
62039 | 145 |
D) |
146 |
JAVA_ARGS["${#JAVA_ARGS[@]}"]="-D$OPTARG" |
|
147 |
;; |
|
34780 | 148 |
J) |
149 |
JAVA_ARGS["${#JAVA_ARGS[@]}"]="$OPTARG" |
|
150 |
;; |
|
43285 | 151 |
b) |
152 |
BUILD_ONLY=true |
|
153 |
;; |
|
48791 | 154 |
d) |
155 |
if [ -z "$JEDIT_SESSION_DIRS" ]; then |
|
156 |
JEDIT_SESSION_DIRS="$OPTARG" |
|
157 |
else |
|
158 |
JEDIT_SESSION_DIRS="$JEDIT_SESSION_DIRS:$OPTARG" |
|
159 |
fi |
|
160 |
;; |
|
43285 | 161 |
f) |
162 |
BUILD_JARS="jars_fresh" |
|
163 |
;; |
|
34780 | 164 |
j) |
165 |
ARGS["${#ARGS[@]}"]="$OPTARG" |
|
166 |
;; |
|
167 |
l) |
|
168 |
JEDIT_LOGIC="$OPTARG" |
|
169 |
;; |
|
170 |
m) |
|
171 |
if [ -z "$JEDIT_PRINT_MODE" ]; then |
|
172 |
JEDIT_PRINT_MODE="$OPTARG" |
|
173 |
else |
|
174 |
JEDIT_PRINT_MODE="$JEDIT_PRINT_MODE,$OPTARG" |
|
175 |
fi |
|
176 |
;; |
|
50405
366c4a602500
clarified build_dialog: regular up-to-date check (extra cost of approx. 5s startup for HOL);
wenzelm
parents:
50403
diff
changeset
|
177 |
n) |
53449 | 178 |
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
|
179 |
;; |
50373 | 180 |
s) |
53449 | 181 |
JEDIT_BUILD_MODE="system" |
50373 | 182 |
;; |
34780 | 183 |
\?) |
184 |
usage |
|
185 |
;; |
|
186 |
esac |
|
187 |
done |
|
188 |
} |
|
34581
abab3a577e10
slightly more robust treatment of options via arrays;
wenzelm
parents:
34412
diff
changeset
|
189 |
|
61132 | 190 |
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
|
191 |
|
53446
4adb2cce5fc6
use JEDIT_OPTIONS only once (in isabelle.Main.start_jedit);
wenzelm
parents:
53445
diff
changeset
|
192 |
declare -a ARGS=() |
34333 | 193 |
|
34780 | 194 |
declare -a OPTIONS; eval "OPTIONS=($ISABELLE_JEDIT_OPTIONS)" |
195 |
getoptions "${OPTIONS[@]}" |
|
196 |
||
197 |
getoptions "$@" |
|
34333 | 198 |
shift $(($OPTIND - 1)) |
199 |
||
200 |
||
201 |
# args |
|
202 |
||
61512
933463440449
more uniform command-line for "isabelle jedit" and the isabelle.Main app wrapper;
wenzelm
parents:
61511
diff
changeset
|
203 |
while [ "$#" -gt 0 ]; do |
933463440449
more uniform command-line for "isabelle jedit" and the isabelle.Main app wrapper;
wenzelm
parents:
61511
diff
changeset
|
204 |
ARGS["${#ARGS[@]}"]="$(platform_path "$1")" |
933463440449
more uniform command-line for "isabelle jedit" and the isabelle.Main app wrapper;
wenzelm
parents:
61511
diff
changeset
|
205 |
shift |
933463440449
more uniform command-line for "isabelle jedit" and the isabelle.Main app wrapper;
wenzelm
parents:
61511
diff
changeset
|
206 |
done |
34333 | 207 |
|
208 |
||
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
209 |
## dependencies |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
210 |
|
49953 | 211 |
if [ -e "$ISABELLE_HOME/Admin/build" ]; then |
62589
b5783412bfed
prefer plain "isabelle" from PATH within Isabelle settings environment;
wenzelm
parents:
62039
diff
changeset
|
212 |
isabelle browser -b || exit $? |
57032
cf570f3ecdc1
incorporate isabelle.graphview into Pure.jar, which saves 20..30s build time;
wenzelm
parents:
56906
diff
changeset
|
213 |
"$ISABELLE_HOME/Admin/build" "$BUILD_JARS" || exit $? |
49953 | 214 |
fi |
43413 | 215 |
|
53577 | 216 |
PURE_JAR="$ISABELLE_HOME/lib/classes/Pure.jar" |
43413 | 217 |
|
43285 | 218 |
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
|
219 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
220 |
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
|
221 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
222 |
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
|
223 |
"$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
|
224 |
"$ISABELLE_JEDIT_BUILD_HOME/contrib/CommonControls.jar" |
53445
811db2b751ed
warm start of Isabelle/jEdit from Isabelle/Scala;
wenzelm
parents:
53441
diff
changeset
|
225 |
"$ISABELLE_JEDIT_BUILD_HOME/contrib/Console.jar" |
811db2b751ed
warm start of Isabelle/jEdit from Isabelle/Scala;
wenzelm
parents:
53441
diff
changeset
|
226 |
"$ISABELLE_JEDIT_BUILD_HOME/contrib/ErrorList.jar" |
811db2b751ed
warm start of Isabelle/jEdit from Isabelle/Scala;
wenzelm
parents:
53441
diff
changeset
|
227 |
"$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
|
228 |
"$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
|
229 |
"$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
|
230 |
"$ISABELLE_JEDIT_BUILD_HOME/contrib/Navigator.jar" |
53445
811db2b751ed
warm start of Isabelle/jEdit from Isabelle/Scala;
wenzelm
parents:
53441
diff
changeset
|
231 |
"$ISABELLE_JEDIT_BUILD_HOME/contrib/SideKick.jar" |
811db2b751ed
warm start of Isabelle/jEdit from Isabelle/Scala;
wenzelm
parents:
53441
diff
changeset
|
232 |
"$ISABELLE_JEDIT_BUILD_HOME/contrib/idea-icons.jar" |
811db2b751ed
warm start of Isabelle/jEdit from Isabelle/Scala;
wenzelm
parents:
53441
diff
changeset
|
233 |
"$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
|
234 |
) |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
235 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
236 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
237 |
# target |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
238 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
239 |
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
|
240 |
|
43384 | 241 |
declare -a UPDATED=() |
242 |
||
43285 | 243 |
if [ "$BUILD_JARS" = jars_fresh ]; then |
244 |
OUTDATED=true |
|
245 |
else |
|
246 |
OUTDATED=false |
|
43368
0dc67b3cf8a5
check source dependencies only if jedit_build component is available;
wenzelm
parents:
43320
diff
changeset
|
247 |
if [ ! -e "$TARGET" ]; then |
0dc67b3cf8a5
check source dependencies only if jedit_build component is available;
wenzelm
parents:
43320
diff
changeset
|
248 |
OUTDATED=true |
43384 | 249 |
else |
250 |
if [ -n "$ISABELLE_JEDIT_BUILD_HOME" ]; then |
|
49566
66cbf8bb4693
basic integration of graphview into document model;
wenzelm
parents:
49494
diff
changeset
|
251 |
declare -a DEPS=( |
57032
cf570f3ecdc1
incorporate isabelle.graphview into Pure.jar, which saves 20..30s build time;
wenzelm
parents:
56906
diff
changeset
|
252 |
"$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
|
253 |
"${SOURCES[@]}" "${RESOURCES[@]}" |
49566
66cbf8bb4693
basic integration of graphview into document model;
wenzelm
parents:
49494
diff
changeset
|
254 |
) |
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
|
255 |
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
|
256 |
declare -a DEPS=("$PURE_JAR" "${SOURCES[@]}" "${RESOURCES[@]}") |
43384 | 257 |
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
|
258 |
declare -a DEPS=() |
43384 | 259 |
fi |
260 |
for DEP in "${DEPS[@]}" |
|
43368
0dc67b3cf8a5
check source dependencies only if jedit_build component is available;
wenzelm
parents:
43320
diff
changeset
|
261 |
do |
43384 | 262 |
[ ! -e "$DEP" ] && fail "Missing file: $DEP" |
263 |
[ "$DEP" -nt "$TARGET" ] && { |
|
264 |
OUTDATED=true |
|
265 |
UPDATED["${#UPDATED[@]}"]="$DEP" |
|
266 |
} |
|
43368
0dc67b3cf8a5
check source dependencies only if jedit_build component is available;
wenzelm
parents:
43320
diff
changeset
|
267 |
done |
0dc67b3cf8a5
check source dependencies only if jedit_build component is available;
wenzelm
parents:
43320
diff
changeset
|
268 |
fi |
43285 | 269 |
fi |
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
270 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
271 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
272 |
# build |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
273 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
274 |
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
|
275 |
then |
43405 | 276 |
echo "### Building Isabelle/jEdit ..." |
277 |
||
43384 | 278 |
[ "${#UPDATED[@]}" -gt 0 ] && { |
43405 | 279 |
echo "Changed files:" |
43384 | 280 |
for FILE in "${UPDATED[@]}" |
281 |
do |
|
282 |
echo " $FILE" |
|
283 |
done |
|
284 |
} |
|
285 |
||
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
286 |
[ -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
|
287 |
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
|
288 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
289 |
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
|
290 |
mkdir -p dist dist/classes || failed |
43287 | 291 |
|
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
|
292 |
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
|
293 |
cp -p -R -f "${RESOURCES[@]}" dist/classes/. |
43287 | 294 |
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
|
295 |
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
|
296 |
|
43391 | 297 |
perl -i -e 'while (<>) { |
61305
12378df46752
less ambitious regex -- avoid unclarities of escaping;
wenzelm
parents:
61294
diff
changeset
|
298 |
if (m/FILE="ml.xml"/ or m/FILE_NAME_GLOB="...sml,ml."/) { } |
55500 | 299 |
elsif (m/NAME="javacc"/) { |
62908 | 300 |
print qq!<MODE NAME="isabelle" FILE="isabelle.xml" FILE_NAME_GLOB="{*.thy,ROOT.ML}"/>\n\n!; |
301 |
print qq!<MODE NAME="isabelle-ml" FILE="isabelle-ml.xml" FILE_NAME_GLOB="*.ML"/>\n\n!; |
|
302 |
print qq!<MODE NAME="isabelle-news" FILE="isabelle-news.xml"/>\n\n!; |
|
303 |
print qq!<MODE NAME="isabelle-options" FILE="isabelle-options.xml"/>\n\n!; |
|
304 |
print qq!<MODE NAME="isabelle-root" FILE="isabelle-root.xml" FILE_NAME_GLOB="ROOT"/>\n\n!; |
|
55500 | 305 |
print; |
306 |
} |
|
56277
c4f75e733812
separate "sml" mode, suppress old "ml" mode altogether;
wenzelm
parents:
56208
diff
changeset
|
307 |
elsif (m/NAME="sqr"/) { |
c4f75e733812
separate "sml" mode, suppress old "ml" mode altogether;
wenzelm
parents:
56208
diff
changeset
|
308 |
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
|
309 |
print; |
c4f75e733812
separate "sml" mode, suppress old "ml" mode altogether;
wenzelm
parents:
56208
diff
changeset
|
310 |
} |
55500 | 311 |
else { print; } |
312 |
}' 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
|
313 |
|
54660 | 314 |
cd dist |
315 |
isabelle_jdk jar xf jedit.jar |
|
54676
6b2ca4850b71
uniform use of transparent icons, as for main "apps";
wenzelm
parents:
54667
diff
changeset
|
316 |
cp "$ISABELLE_HOME/lib/logo/isabelle_transparent-32.gif" \ |
54660 | 317 |
"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
|
318 |
cp "$ISABELLE_HOME/lib/logo/isabelle_transparent-32.gif" \ |
54660 | 319 |
"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
|
320 |
isabelle_jdk jar cfe jedit.jar org.gjt.sp.jedit.jEdit org || failed |
54667 | 321 |
rm -rf META-INF org |
54660 | 322 |
cd .. |
323 |
||
53445
811db2b751ed
warm start of Isabelle/jEdit from Isabelle/Scala;
wenzelm
parents:
53441
diff
changeset
|
324 |
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
|
325 |
( |
57618 | 326 |
#FIXME workarounds for scalac 2.11.0 |
327 |
export CYGWIN="nodosfilewarning" |
|
53451 | 328 |
function stty() { :; } |
329 |
export -f stty |
|
330 |
||
57032
cf570f3ecdc1
incorporate isabelle.graphview into Pure.jar, which saves 20..30s build time;
wenzelm
parents:
56906
diff
changeset
|
331 |
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
|
332 |
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
|
333 |
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
|
334 |
done |
61294 | 335 |
export CLASSPATH="$(platform_path "$ISABELLE_CLASSPATH")" |
47009 | 336 |
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
|
337 |
) || 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
|
338 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
339 |
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
|
340 |
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
|
341 |
cd ../.. |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
342 |
rm -rf dist/classes |
56422 | 343 |
|
61511 | 344 |
cp "$ISABELLE_JEDIT_BUILD_HOME/doc/jedit5.3.0manual-a4.pdf" dist/doc/jedit-manual.pdf |
56422 | 345 |
cp dist/doc/CHANGES.txt dist/doc/jedit-changes |
346 |
cat > dist/doc/Contents <<EOF |
|
57338 | 347 |
Original jEdit Documentation |
61511 | 348 |
jedit-manual jEdit 5.3 User's Guide |
349 |
jedit-changes jEdit 5.3 Version History |
|
56422 | 350 |
|
351 |
EOF |
|
352 |
||
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
353 |
fi |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
354 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
355 |
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
|
356 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
357 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
358 |
## main |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
359 |
|
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
|
360 |
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
|
361 |
then |
62917
eed66ba99bd9
backout 930a30c1a9af: leads to odd effect of command-line options becoming persistent preferences;
wenzelm
parents:
62914
diff
changeset
|
362 |
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
|
363 |
classpath "$JEDIT_HOME/dist/jedit.jar" |
62589
b5783412bfed
prefer plain "isabelle" from PATH within Isabelle settings environment;
wenzelm
parents:
62039
diff
changeset
|
364 |
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
|
365 |
fi |