author | wenzelm |
Tue, 08 Sep 2015 13:52:13 +0200 | |
changeset 61133 | c6d62d092246 |
parent 61132 | 70029aae9a9f |
child 61171 | 2a56a53d78f9 |
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" |
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
|
58 |
"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
|
59 |
"src/simplifier_trace_window.scala" |
58529 | 60 |
"src/sledgehammer_dockable.scala" |
56547 | 61 |
"src/spell_checker.scala" |
58748 | 62 |
"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
|
63 |
"src/symbols_dockable.scala" |
48021
d899be1cfe6d
separate syslog dockable -- discontinued tendency of sub-window management via tabs;
wenzelm
parents:
48014
diff
changeset
|
64 |
"src/syslog_dockable.scala" |
46572 | 65 |
"src/text_overview.scala" |
50299 | 66 |
"src/theories_dockable.scala" |
51533 | 67 |
"src/timing_dockable.scala" |
43414 | 68 |
"src/token_markup.scala" |
43285 | 69 |
) |
70 |
||
43320 | 71 |
declare -a RESOURCES=( |
43286 | 72 |
"src/actions.xml" |
73 |
"src/dockables.xml" |
|
74 |
"src/Isabelle.props" |
|
50306 | 75 |
"src/jEdit.props" |
43286 | 76 |
"src/services.xml" |
55500 | 77 |
"src/modes/isabelle-ml.xml" |
52540 | 78 |
"src/modes/isabelle-news.xml" |
79 |
"src/modes/isabelle-options.xml" |
|
80 |
"src/modes/isabelle-root.xml" |
|
81 |
"src/modes/isabelle.xml" |
|
56277
c4f75e733812
separate "sml" mode, suppress old "ml" mode altogether;
wenzelm
parents:
56208
diff
changeset
|
82 |
"src/modes/sml.xml" |
43285 | 83 |
) |
84 |
||
85 |
||
34333 | 86 |
## diagnostics |
87 |
||
34664 | 88 |
PRG="$(basename "$0")" |
89 |
||
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
90 |
function usage() |
34333 | 91 |
{ |
92 |
echo |
|
34664 | 93 |
echo "Usage: isabelle $PRG [OPTIONS] [FILES ...]" |
34333 | 94 |
echo |
95 |
echo " Options are:" |
|
61133
c6d62d092246
clarified JEDIT_JAVA_OPTIONS: separate defaults for 32 vs. 64 bit;
wenzelm
parents:
61132
diff
changeset
|
96 |
echo " -J OPTION add JVM runtime option (default $JEDIT_JAVA_SYSTEM_OPTIONS $JEDIT_JAVA_OPTIONS)" |
43285 | 97 |
echo " -b build only" |
48791 | 98 |
echo " -d DIR include session directory" |
43285 | 99 |
echo " -f fresh build" |
34333 | 100 |
echo " -j OPTION add jEdit runtime option" |
101 |
echo " (default JEDIT_OPTIONS=$JEDIT_OPTIONS)" |
|
50403
87868964733c
more uniform default logic, using settings, options, args etc.;
wenzelm
parents:
50373
diff
changeset
|
102 |
echo " -l NAME logic session name" |
34333 | 103 |
echo " -m MODE add print mode for output" |
57086 | 104 |
echo " -n no build of session image on startup" |
50373 | 105 |
echo " -s system build mode for session image" |
34333 | 106 |
echo |
54682 | 107 |
echo " Start jEdit with Isabelle plugin setup and open theory FILES" |
108 |
echo " (default \"$USER_HOME/Scratch.thy\")." |
|
34333 | 109 |
echo |
110 |
exit 1 |
|
111 |
} |
|
112 |
||
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
113 |
function fail() |
34333 | 114 |
{ |
115 |
echo "$1" >&2 |
|
116 |
exit 2 |
|
117 |
} |
|
118 |
||
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
119 |
function failed() |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
120 |
{ |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
121 |
fail "Failed!" |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
122 |
} |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
123 |
|
34333 | 124 |
|
125 |
## process command line |
|
126 |
||
127 |
# options |
|
128 |
||
43285 | 129 |
BUILD_ONLY=false |
130 |
BUILD_JARS="jars" |
|
48791 | 131 |
JEDIT_SESSION_DIRS="" |
50403
87868964733c
more uniform default logic, using settings, options, args etc.;
wenzelm
parents:
50373
diff
changeset
|
132 |
JEDIT_LOGIC="" |
34333 | 133 |
JEDIT_PRINT_MODE="" |
53449 | 134 |
JEDIT_BUILD_MODE="normal" |
34333 | 135 |
|
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
136 |
function getoptions() |
34780 | 137 |
{ |
138 |
OPTIND=1 |
|
50405
366c4a602500
clarified build_dialog: regular up-to-date check (extra cost of approx. 5s startup for HOL);
wenzelm
parents:
50403
diff
changeset
|
139 |
while getopts "J:bd:fj:l:m:ns" OPT |
34780 | 140 |
do |
141 |
case "$OPT" in |
|
142 |
J) |
|
143 |
JAVA_ARGS["${#JAVA_ARGS[@]}"]="$OPTARG" |
|
144 |
;; |
|
43285 | 145 |
b) |
146 |
BUILD_ONLY=true |
|
147 |
;; |
|
48791 | 148 |
d) |
149 |
if [ -z "$JEDIT_SESSION_DIRS" ]; then |
|
150 |
JEDIT_SESSION_DIRS="$OPTARG" |
|
151 |
else |
|
152 |
JEDIT_SESSION_DIRS="$JEDIT_SESSION_DIRS:$OPTARG" |
|
153 |
fi |
|
154 |
;; |
|
43285 | 155 |
f) |
156 |
BUILD_JARS="jars_fresh" |
|
157 |
;; |
|
34780 | 158 |
j) |
159 |
ARGS["${#ARGS[@]}"]="$OPTARG" |
|
160 |
;; |
|
161 |
l) |
|
162 |
JEDIT_LOGIC="$OPTARG" |
|
163 |
;; |
|
164 |
m) |
|
165 |
if [ -z "$JEDIT_PRINT_MODE" ]; then |
|
166 |
JEDIT_PRINT_MODE="$OPTARG" |
|
167 |
else |
|
168 |
JEDIT_PRINT_MODE="$JEDIT_PRINT_MODE,$OPTARG" |
|
169 |
fi |
|
170 |
;; |
|
50405
366c4a602500
clarified build_dialog: regular up-to-date check (extra cost of approx. 5s startup for HOL);
wenzelm
parents:
50403
diff
changeset
|
171 |
n) |
53449 | 172 |
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
|
173 |
;; |
50373 | 174 |
s) |
53449 | 175 |
JEDIT_BUILD_MODE="system" |
50373 | 176 |
;; |
34780 | 177 |
\?) |
178 |
usage |
|
179 |
;; |
|
180 |
esac |
|
181 |
done |
|
182 |
} |
|
34581
abab3a577e10
slightly more robust treatment of options via arrays;
wenzelm
parents:
34412
diff
changeset
|
183 |
|
61132 | 184 |
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
|
185 |
|
53446
4adb2cce5fc6
use JEDIT_OPTIONS only once (in isabelle.Main.start_jedit);
wenzelm
parents:
53445
diff
changeset
|
186 |
declare -a ARGS=() |
34333 | 187 |
|
34780 | 188 |
declare -a OPTIONS; eval "OPTIONS=($ISABELLE_JEDIT_OPTIONS)" |
189 |
getoptions "${OPTIONS[@]}" |
|
190 |
||
191 |
getoptions "$@" |
|
34333 | 192 |
shift $(($OPTIND - 1)) |
193 |
||
194 |
||
195 |
# args |
|
196 |
||
44485
2f0a34fc4d2d
back to tradition Scratch.thy default -- execution wrt. perspective overcomes the main problems of 226563829580;
wenzelm
parents:
43695
diff
changeset
|
197 |
if [ "$#" -eq 0 ]; then |
50120 | 198 |
ARGS["${#ARGS[@]}"]="$(jvmpath "$USER_HOME/Scratch.thy")" |
44485
2f0a34fc4d2d
back to tradition Scratch.thy default -- execution wrt. perspective overcomes the main problems of 226563829580;
wenzelm
parents:
43695
diff
changeset
|
199 |
else |
2f0a34fc4d2d
back to tradition Scratch.thy default -- execution wrt. perspective overcomes the main problems of 226563829580;
wenzelm
parents:
43695
diff
changeset
|
200 |
while [ "$#" -gt 0 ]; do |
2f0a34fc4d2d
back to tradition Scratch.thy default -- execution wrt. perspective overcomes the main problems of 226563829580;
wenzelm
parents:
43695
diff
changeset
|
201 |
ARGS["${#ARGS[@]}"]="$(jvmpath "$1")" |
2f0a34fc4d2d
back to tradition Scratch.thy default -- execution wrt. perspective overcomes the main problems of 226563829580;
wenzelm
parents:
43695
diff
changeset
|
202 |
shift |
2f0a34fc4d2d
back to tradition Scratch.thy default -- execution wrt. perspective overcomes the main problems of 226563829580;
wenzelm
parents:
43695
diff
changeset
|
203 |
done |
2f0a34fc4d2d
back to tradition Scratch.thy default -- execution wrt. perspective overcomes the main problems of 226563829580;
wenzelm
parents:
43695
diff
changeset
|
204 |
fi |
34333 | 205 |
|
206 |
||
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
207 |
## dependencies |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
208 |
|
49953 | 209 |
if [ -e "$ISABELLE_HOME/Admin/build" ]; then |
50782 | 210 |
"$ISABELLE_TOOL" browser -b || exit $? |
57032
cf570f3ecdc1
incorporate isabelle.graphview into Pure.jar, which saves 20..30s build time;
wenzelm
parents:
56906
diff
changeset
|
211 |
"$ISABELLE_HOME/Admin/build" "$BUILD_JARS" || exit $? |
49953 | 212 |
fi |
43413 | 213 |
|
53577 | 214 |
PURE_JAR="$ISABELLE_HOME/lib/classes/Pure.jar" |
43413 | 215 |
|
43285 | 216 |
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
|
217 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
218 |
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
|
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_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
|
221 |
"$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
|
222 |
"$ISABELLE_JEDIT_BUILD_HOME/contrib/CommonControls.jar" |
53445
811db2b751ed
warm start of Isabelle/jEdit from Isabelle/Scala;
wenzelm
parents:
53441
diff
changeset
|
223 |
"$ISABELLE_JEDIT_BUILD_HOME/contrib/Console.jar" |
811db2b751ed
warm start of Isabelle/jEdit from Isabelle/Scala;
wenzelm
parents:
53441
diff
changeset
|
224 |
"$ISABELLE_JEDIT_BUILD_HOME/contrib/ErrorList.jar" |
811db2b751ed
warm start of Isabelle/jEdit from Isabelle/Scala;
wenzelm
parents:
53441
diff
changeset
|
225 |
"$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
|
226 |
"$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
|
227 |
"$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
|
228 |
"$ISABELLE_JEDIT_BUILD_HOME/contrib/Navigator.jar" |
53445
811db2b751ed
warm start of Isabelle/jEdit from Isabelle/Scala;
wenzelm
parents:
53441
diff
changeset
|
229 |
"$ISABELLE_JEDIT_BUILD_HOME/contrib/SideKick.jar" |
811db2b751ed
warm start of Isabelle/jEdit from Isabelle/Scala;
wenzelm
parents:
53441
diff
changeset
|
230 |
"$ISABELLE_JEDIT_BUILD_HOME/contrib/idea-icons.jar" |
811db2b751ed
warm start of Isabelle/jEdit from Isabelle/Scala;
wenzelm
parents:
53441
diff
changeset
|
231 |
"$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
|
232 |
) |
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 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
235 |
# target |
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="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
|
238 |
|
43384 | 239 |
declare -a UPDATED=() |
240 |
||
43285 | 241 |
if [ "$BUILD_JARS" = jars_fresh ]; then |
242 |
OUTDATED=true |
|
243 |
else |
|
244 |
OUTDATED=false |
|
43368
0dc67b3cf8a5
check source dependencies only if jedit_build component is available;
wenzelm
parents:
43320
diff
changeset
|
245 |
if [ ! -e "$TARGET" ]; then |
0dc67b3cf8a5
check source dependencies only if jedit_build component is available;
wenzelm
parents:
43320
diff
changeset
|
246 |
OUTDATED=true |
43384 | 247 |
else |
248 |
if [ -n "$ISABELLE_JEDIT_BUILD_HOME" ]; then |
|
49566
66cbf8bb4693
basic integration of graphview into document model;
wenzelm
parents:
49494
diff
changeset
|
249 |
declare -a DEPS=( |
57032
cf570f3ecdc1
incorporate isabelle.graphview into Pure.jar, which saves 20..30s build time;
wenzelm
parents:
56906
diff
changeset
|
250 |
"$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
|
251 |
"${SOURCES[@]}" "${RESOURCES[@]}" |
49566
66cbf8bb4693
basic integration of graphview into document model;
wenzelm
parents:
49494
diff
changeset
|
252 |
) |
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
|
253 |
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
|
254 |
declare -a DEPS=("$PURE_JAR" "${SOURCES[@]}" "${RESOURCES[@]}") |
43384 | 255 |
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
|
256 |
declare -a DEPS=() |
43384 | 257 |
fi |
258 |
for DEP in "${DEPS[@]}" |
|
43368
0dc67b3cf8a5
check source dependencies only if jedit_build component is available;
wenzelm
parents:
43320
diff
changeset
|
259 |
do |
43384 | 260 |
[ ! -e "$DEP" ] && fail "Missing file: $DEP" |
261 |
[ "$DEP" -nt "$TARGET" ] && { |
|
262 |
OUTDATED=true |
|
263 |
UPDATED["${#UPDATED[@]}"]="$DEP" |
|
264 |
} |
|
43368
0dc67b3cf8a5
check source dependencies only if jedit_build component is available;
wenzelm
parents:
43320
diff
changeset
|
265 |
done |
0dc67b3cf8a5
check source dependencies only if jedit_build component is available;
wenzelm
parents:
43320
diff
changeset
|
266 |
fi |
43285 | 267 |
fi |
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
268 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
269 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
270 |
# build |
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 |
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
|
273 |
then |
43405 | 274 |
echo "### Building Isabelle/jEdit ..." |
275 |
||
43384 | 276 |
[ "${#UPDATED[@]}" -gt 0 ] && { |
43405 | 277 |
echo "Changed files:" |
43384 | 278 |
for FILE in "${UPDATED[@]}" |
279 |
do |
|
280 |
echo " $FILE" |
|
281 |
done |
|
282 |
} |
|
283 |
||
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
284 |
[ -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
|
285 |
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
|
286 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
287 |
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
|
288 |
mkdir -p dist dist/classes || failed |
43287 | 289 |
|
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
|
290 |
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
|
291 |
cp -p -R -f "${RESOURCES[@]}" dist/classes/. |
43287 | 292 |
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
|
293 |
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
|
294 |
|
43391 | 295 |
perl -i -e 'while (<>) { |
56277
c4f75e733812
separate "sml" mode, suppress old "ml" mode altogether;
wenzelm
parents:
56208
diff
changeset
|
296 |
if (m/FILE="ml.xml"/ or m/FILE_NAME_GLOB="\*\.{sml,ml}"/) { } |
55500 | 297 |
elsif (m/NAME="javacc"/) { |
43391 | 298 |
print qq,<MODE NAME="isabelle" FILE="isabelle.xml" FILE_NAME_GLOB="*.thy"/>\n\n,; |
55500 | 299 |
print qq,<MODE NAME="isabelle-ml" FILE="isabelle-ml.xml" FILE_NAME_GLOB="*.ML"/>\n\n,; |
52539 | 300 |
print qq,<MODE NAME="isabelle-news" FILE="isabelle-news.xml"/>\n\n,; |
48366 | 301 |
print qq,<MODE NAME="isabelle-options" FILE="isabelle-options.xml"/>\n\n,; |
55500 | 302 |
print qq,<MODE NAME="isabelle-root" FILE="isabelle-root.xml" FILE_NAME_GLOB="ROOT"/>\n\n,; |
303 |
print; |
|
304 |
} |
|
56277
c4f75e733812
separate "sml" mode, suppress old "ml" mode altogether;
wenzelm
parents:
56208
diff
changeset
|
305 |
elsif (m/NAME="sqr"/) { |
c4f75e733812
separate "sml" mode, suppress old "ml" mode altogether;
wenzelm
parents:
56208
diff
changeset
|
306 |
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
|
307 |
print; |
c4f75e733812
separate "sml" mode, suppress old "ml" mode altogether;
wenzelm
parents:
56208
diff
changeset
|
308 |
} |
55500 | 309 |
else { print; } |
310 |
}' 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
|
311 |
|
54660 | 312 |
cd dist |
313 |
isabelle_jdk jar xf jedit.jar |
|
54676
6b2ca4850b71
uniform use of transparent icons, as for main "apps";
wenzelm
parents:
54667
diff
changeset
|
314 |
cp "$ISABELLE_HOME/lib/logo/isabelle_transparent-32.gif" \ |
54660 | 315 |
"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
|
316 |
cp "$ISABELLE_HOME/lib/logo/isabelle_transparent-32.gif" \ |
54660 | 317 |
"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
|
318 |
isabelle_jdk jar cfe jedit.jar org.gjt.sp.jedit.jEdit org || failed |
54667 | 319 |
rm -rf META-INF org |
54660 | 320 |
cd .. |
321 |
||
53445
811db2b751ed
warm start of Isabelle/jEdit from Isabelle/Scala;
wenzelm
parents:
53441
diff
changeset
|
322 |
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
|
323 |
( |
57618 | 324 |
#FIXME workarounds for scalac 2.11.0 |
325 |
export CYGWIN="nodosfilewarning" |
|
53451 | 326 |
function stty() { :; } |
327 |
export -f stty |
|
328 |
||
57032
cf570f3ecdc1
incorporate isabelle.graphview into Pure.jar, which saves 20..30s build time;
wenzelm
parents:
56906
diff
changeset
|
329 |
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
|
330 |
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
|
331 |
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
|
332 |
done |
53576
793a429c63e7
maintain classpath in more elementary manner: turn ISABELLE_CLASSPATH into -classpath option, so that all jars are covered by sun.misc.Launcher.AppClassLoader (e.g. relevant for loading add-on resources);
wenzelm
parents:
53451
diff
changeset
|
333 |
export CLASSPATH="$(jvmpath "$ISABELLE_CLASSPATH")" |
47009 | 334 |
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
|
335 |
) || 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
|
336 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
337 |
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
|
338 |
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
|
339 |
cd ../.. |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
340 |
rm -rf dist/classes |
56422 | 341 |
|
59571 | 342 |
cp "$ISABELLE_JEDIT_BUILD_HOME/doc/jedit5.2.0manual-a4.pdf" dist/doc/jedit-manual.pdf |
56422 | 343 |
cp dist/doc/CHANGES.txt dist/doc/jedit-changes |
344 |
cat > dist/doc/Contents <<EOF |
|
57338 | 345 |
Original jEdit Documentation |
59571 | 346 |
jedit-manual jEdit 5.2 User's Guide |
347 |
jedit-changes jEdit 5.2 Version History |
|
56422 | 348 |
|
349 |
EOF |
|
350 |
||
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
351 |
fi |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
352 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
353 |
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
|
354 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
355 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
356 |
## main |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
357 |
|
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
|
358 |
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
|
359 |
then |
53449 | 360 |
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
|
361 |
classpath "$JEDIT_HOME/dist/jedit.jar" |
793a429c63e7
maintain classpath in more elementary manner: turn ISABELLE_CLASSPATH into -classpath option, so that all jars are covered by sun.misc.Launcher.AppClassLoader (e.g. relevant for loading add-on resources);
wenzelm
parents:
53451
diff
changeset
|
362 |
exec "$ISABELLE_TOOL" java "${JAVA_ARGS[@]}" isabelle.Main "${ARGS[@]}" |
50416
2e1b47e22fc6
more rigorous "build only" mode: avoid build dialog of logic image and its potential need for GUI display;
wenzelm
parents:
50405
diff
changeset
|
363 |
fi |