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