author | wenzelm |
Mon, 12 Aug 2013 11:39:29 +0200 | |
changeset 52971 | 31926d2c04ee |
parent 52934 | bfb6873df88e |
child 52980 | 28f59ca8ce78 |
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" |
43285 | 12 |
"src/dockable.scala" |
13 |
"src/document_model.scala" |
|
14 |
"src/document_view.scala" |
|
52445 | 15 |
"src/documentation_dockable.scala" |
52846 | 16 |
"src/find_dockable.scala" |
50542
58bd88159f8f
fold handling within Pretty_Text_Area, based on formal document content, which is static here;
wenzelm
parents:
50450
diff
changeset
|
17 |
"src/fold_handling.scala" |
49570 | 18 |
"src/graphview_dockable.scala" |
43285 | 19 |
"src/html_panel.scala" |
48921
5d8d409b897e
support for direct hyperlinks, without the Hyperlinks plugin;
wenzelm
parents:
48791
diff
changeset
|
20 |
"src/hyperlink.scala" |
49726 | 21 |
"src/info_dockable.scala" |
50208 | 22 |
"src/isabelle.scala" |
43285 | 23 |
"src/isabelle_encoding.scala" |
49246 | 24 |
"src/isabelle_logic.scala" |
43285 | 25 |
"src/isabelle_options.scala" |
26 |
"src/isabelle_sidekick.scala" |
|
52971
31926d2c04ee
tuned signature -- more abstract PIDE editor operations;
wenzelm
parents:
52934
diff
changeset
|
27 |
"src/jedit_editor.scala" |
49406 | 28 |
"src/jedit_lib.scala" |
49600 | 29 |
"src/jedit_main.scala" |
50202 | 30 |
"src/jedit_options.scala" |
44577
96b6388d06c4
separate module for jEdit primitives for loading theory files;
wenzelm
parents:
44565
diff
changeset
|
31 |
"src/jedit_thy_load.scala" |
50433
9131dadb2bf7
basic monitor panel, using the powerful jfreechart library;
wenzelm
parents:
50416
diff
changeset
|
32 |
"src/monitor_dockable.scala" |
51071
b7e7557e80b5
some native Mac OS X support, notably quit_handler (important for dialog on unsaved changes);
wenzelm
parents:
50795
diff
changeset
|
33 |
"src/osx_adapter.scala" |
43285 | 34 |
"src/output_dockable.scala" |
35 |
"src/plugin.scala" |
|
49398
0fa4389c04f9
alternative output panel, based on Pretty_Text_Area, based on JEditEmbeddedTextArea;
wenzelm
parents:
49246
diff
changeset
|
36 |
"src/pretty_text_area.scala" |
49702 | 37 |
"src/pretty_tooltip.scala" |
52934
bfb6873df88e
separate Process_Indicator -- simplified/clarified version of org.gjt.sp.jedit.gui.AnimatedIcon;
wenzelm
parents:
52908
diff
changeset
|
38 |
"src/process_indicator.scala" |
43285 | 39 |
"src/protocol_dockable.scala" |
52865
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
52846
diff
changeset
|
40 |
"src/query_operation.scala" |
43285 | 41 |
"src/raw_output_dockable.scala" |
48014
63021e59cbf0
separate README dockable, which allows to make it more prominent first and remove it later;
wenzelm
parents:
47995
diff
changeset
|
42 |
"src/readme_dockable.scala" |
50202 | 43 |
"src/rendering.scala" |
49411 | 44 |
"src/rich_text_area.scala" |
43285 | 45 |
"src/scala_console.scala" |
52908
3461985dcbc3
dockable window for Sledgehammer, based on asynchronous/parallel query operation;
wenzelm
parents:
52865
diff
changeset
|
46 |
"src/sledgehammer_dockable.scala" |
50143
4ff5d795ed08
dockable with buttons for symbols, grouped and sorted in tabs according to ~~/etc/symbols;
immler
parents:
50120
diff
changeset
|
47 |
"src/symbols_dockable.scala" |
48021
d899be1cfe6d
separate syslog dockable -- discontinued tendency of sub-window management via tabs;
wenzelm
parents:
48014
diff
changeset
|
48 |
"src/syslog_dockable.scala" |
46572 | 49 |
"src/text_overview.scala" |
50299 | 50 |
"src/theories_dockable.scala" |
51533 | 51 |
"src/timing_dockable.scala" |
43414 | 52 |
"src/token_markup.scala" |
43285 | 53 |
) |
54 |
||
43320 | 55 |
declare -a RESOURCES=( |
43286 | 56 |
"src/actions.xml" |
57 |
"src/dockables.xml" |
|
58 |
"src/Isabelle.props" |
|
50306 | 59 |
"src/jEdit.props" |
43286 | 60 |
"src/services.xml" |
52540 | 61 |
"src/modes/isabelle-news.xml" |
62 |
"src/modes/isabelle-options.xml" |
|
63 |
"src/modes/isabelle-root.xml" |
|
64 |
"src/modes/isabelle.xml" |
|
43285 | 65 |
) |
66 |
||
67 |
||
34333 | 68 |
## diagnostics |
69 |
||
34664 | 70 |
PRG="$(basename "$0")" |
71 |
||
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
72 |
function usage() |
34333 | 73 |
{ |
74 |
echo |
|
34664 | 75 |
echo "Usage: isabelle $PRG [OPTIONS] [FILES ...]" |
34333 | 76 |
echo |
77 |
echo " Options are:" |
|
78 |
echo " -J OPTION add JVM runtime option" |
|
34409 | 79 |
echo " (default JEDIT_JAVA_OPTIONS=$JEDIT_JAVA_OPTIONS)" |
43285 | 80 |
echo " -b build only" |
48791 | 81 |
echo " -d DIR include session directory" |
43285 | 82 |
echo " -f fresh build" |
34333 | 83 |
echo " -j OPTION add jEdit runtime option" |
84 |
echo " (default JEDIT_OPTIONS=$JEDIT_OPTIONS)" |
|
50403
87868964733c
more uniform default logic, using settings, options, args etc.;
wenzelm
parents:
50373
diff
changeset
|
85 |
echo " -l NAME logic session name" |
34333 | 86 |
echo " -m MODE add print mode for output" |
50405
366c4a602500
clarified build_dialog: regular up-to-date check (extra cost of approx. 5s startup for HOL);
wenzelm
parents:
50403
diff
changeset
|
87 |
echo " -n no build dialog for session image on startup" |
50373 | 88 |
echo " -s system build mode for session image" |
34333 | 89 |
echo |
50550 | 90 |
echo "Start jEdit with Isabelle plugin setup and open theory FILES" |
50114 | 91 |
echo "(default \"$USER_HOME/Scratch.thy\")." |
34333 | 92 |
echo |
93 |
exit 1 |
|
94 |
} |
|
95 |
||
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
96 |
function fail() |
34333 | 97 |
{ |
98 |
echo "$1" >&2 |
|
99 |
exit 2 |
|
100 |
} |
|
101 |
||
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
102 |
function failed() |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
103 |
{ |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
104 |
fail "Failed!" |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
105 |
} |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
106 |
|
34333 | 107 |
|
108 |
## process command line |
|
109 |
||
110 |
# options |
|
111 |
||
50546 | 112 |
declare -a BUILD_DIALOG_OPTIONS=(-L jedit_logic) |
50373 | 113 |
|
43285 | 114 |
BUILD_ONLY=false |
115 |
BUILD_JARS="jars" |
|
48791 | 116 |
JEDIT_SESSION_DIRS="" |
50403
87868964733c
more uniform default logic, using settings, options, args etc.;
wenzelm
parents:
50373
diff
changeset
|
117 |
JEDIT_LOGIC="" |
34333 | 118 |
JEDIT_PRINT_MODE="" |
50405
366c4a602500
clarified build_dialog: regular up-to-date check (extra cost of approx. 5s startup for HOL);
wenzelm
parents:
50403
diff
changeset
|
119 |
NO_BUILD="false" |
34333 | 120 |
|
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
121 |
function getoptions() |
34780 | 122 |
{ |
123 |
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
|
124 |
while getopts "J:bd:fj:l:m:ns" OPT |
34780 | 125 |
do |
126 |
case "$OPT" in |
|
127 |
J) |
|
128 |
JAVA_ARGS["${#JAVA_ARGS[@]}"]="$OPTARG" |
|
129 |
;; |
|
43285 | 130 |
b) |
131 |
BUILD_ONLY=true |
|
132 |
;; |
|
48791 | 133 |
d) |
134 |
if [ -z "$JEDIT_SESSION_DIRS" ]; then |
|
135 |
JEDIT_SESSION_DIRS="$OPTARG" |
|
136 |
else |
|
137 |
JEDIT_SESSION_DIRS="$JEDIT_SESSION_DIRS:$OPTARG" |
|
138 |
fi |
|
50373 | 139 |
BUILD_DIALOG_OPTIONS["${#BUILD_DIALOG_OPTIONS[@]}"]="-d" |
140 |
BUILD_DIALOG_OPTIONS["${#BUILD_DIALOG_OPTIONS[@]}"]="$OPTARG" |
|
48791 | 141 |
;; |
43285 | 142 |
f) |
143 |
BUILD_JARS="jars_fresh" |
|
144 |
;; |
|
34780 | 145 |
j) |
146 |
ARGS["${#ARGS[@]}"]="$OPTARG" |
|
147 |
;; |
|
148 |
l) |
|
50546 | 149 |
BUILD_DIALOG_OPTIONS["${#BUILD_DIALOG_OPTIONS[@]}"]="-l" |
150 |
BUILD_DIALOG_OPTIONS["${#BUILD_DIALOG_OPTIONS[@]}"]="$OPTARG" |
|
34780 | 151 |
JEDIT_LOGIC="$OPTARG" |
152 |
;; |
|
153 |
m) |
|
154 |
if [ -z "$JEDIT_PRINT_MODE" ]; then |
|
155 |
JEDIT_PRINT_MODE="$OPTARG" |
|
156 |
else |
|
157 |
JEDIT_PRINT_MODE="$JEDIT_PRINT_MODE,$OPTARG" |
|
158 |
fi |
|
159 |
;; |
|
50405
366c4a602500
clarified build_dialog: regular up-to-date check (extra cost of approx. 5s startup for HOL);
wenzelm
parents:
50403
diff
changeset
|
160 |
n) |
366c4a602500
clarified build_dialog: regular up-to-date check (extra cost of approx. 5s startup for HOL);
wenzelm
parents:
50403
diff
changeset
|
161 |
NO_BUILD="true" |
366c4a602500
clarified build_dialog: regular up-to-date check (extra cost of approx. 5s startup for HOL);
wenzelm
parents:
50403
diff
changeset
|
162 |
;; |
50373 | 163 |
s) |
164 |
BUILD_DIALOG_OPTIONS["${#BUILD_DIALOG_OPTIONS[@]}"]="-s" |
|
165 |
;; |
|
34780 | 166 |
\?) |
167 |
usage |
|
168 |
;; |
|
169 |
esac |
|
170 |
done |
|
171 |
} |
|
34581
abab3a577e10
slightly more robust treatment of options via arrays;
wenzelm
parents:
34412
diff
changeset
|
172 |
|
38257
f0fd14a9c11f
clarified JEDIT_JAVA_OPTIONS vs. JEDIT_SYSTEM_OPTIONS -- discontinued JEDIT_APPLE_PROPERTIES;
wenzelm
parents:
34881
diff
changeset
|
173 |
declare -a JAVA_ARGS; eval "JAVA_ARGS=($JEDIT_JAVA_OPTIONS $JEDIT_SYSTEM_OPTIONS)" |
34843
eb8806a2e348
define scala.home, for more robust startup of Scala tools, notably the compiler;
wenzelm
parents:
34790
diff
changeset
|
174 |
[ -n "$SCALA_HOME" ] && JAVA_ARGS["${#JAVA_ARGS[@]}"]="-Dscala.home=$SCALA_HOME" |
eb8806a2e348
define scala.home, for more robust startup of Scala tools, notably the compiler;
wenzelm
parents:
34790
diff
changeset
|
175 |
|
34780 | 176 |
declare -a ARGS; eval "ARGS=($JEDIT_OPTIONS)" |
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 $? |
49953 | 201 |
if [ "$BUILD_JARS" = jars_fresh ]; then |
202 |
"$ISABELLE_TOOL" graphview -b -f || exit $? |
|
203 |
else |
|
49566
66cbf8bb4693
basic integration of graphview into document model;
wenzelm
parents:
49494
diff
changeset
|
204 |
"$ISABELLE_HOME/Admin/build" "$BUILD_JARS" || exit $? |
49953 | 205 |
"$ISABELLE_TOOL" graphview -b || exit $? |
206 |
fi |
|
207 |
fi |
|
43413 | 208 |
|
43523 | 209 |
PURE_JAR="$ISABELLE_HOME/lib/classes/ext/Pure.jar" |
49566
66cbf8bb4693
basic integration of graphview into document model;
wenzelm
parents:
49494
diff
changeset
|
210 |
GRAPHVIEW_JAR="$ISABELLE_HOME/lib/classes/ext/Graphview.jar" |
43413 | 211 |
|
43285 | 212 |
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
|
213 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
214 |
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
|
215 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
216 |
JEDIT_JARS=( |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
217 |
"$ISABELLE_JEDIT_BUILD_HOME/contrib/Console.jar" |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
218 |
"$ISABELLE_JEDIT_BUILD_HOME/contrib/ErrorList.jar" |
50729 | 219 |
"$ISABELLE_JEDIT_BUILD_HOME/contrib/Highlight.jar" |
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
220 |
"$ISABELLE_JEDIT_BUILD_HOME/contrib/SideKick.jar" |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
221 |
"$ISABELLE_JEDIT_BUILD_HOME/contrib/cobra.jar" |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
222 |
"$ISABELLE_JEDIT_BUILD_HOME/contrib/js.jar" |
52471
ff0e0bb81597
support for idea-icons (using ideaIC-129.354/platform/icons/src from IntelliJ IDEA Community Edition 12.1.2);
wenzelm
parents:
52445
diff
changeset
|
223 |
"$ISABELLE_JEDIT_BUILD_HOME/contrib/idea-icons.jar" |
43284
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 |
|
50433
9131dadb2bf7
basic monitor panel, using the powerful jfreechart library;
wenzelm
parents:
50416
diff
changeset
|
226 |
declare -a JFREECHART_JARS=() |
9131dadb2bf7
basic monitor panel, using the powerful jfreechart library;
wenzelm
parents:
50416
diff
changeset
|
227 |
for NAME in $JFREECHART_JAR_NAMES |
9131dadb2bf7
basic monitor panel, using the powerful jfreechart library;
wenzelm
parents:
50416
diff
changeset
|
228 |
do |
9131dadb2bf7
basic monitor panel, using the powerful jfreechart library;
wenzelm
parents:
50416
diff
changeset
|
229 |
JFREECHART_JARS["${#JFREECHART_JARS[@]}"]="$JFREECHART_HOME/lib/$NAME" |
9131dadb2bf7
basic monitor panel, using the powerful jfreechart library;
wenzelm
parents:
50416
diff
changeset
|
230 |
done |
9131dadb2bf7
basic monitor panel, using the powerful jfreechart library;
wenzelm
parents:
50416
diff
changeset
|
231 |
|
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 |
# target |
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="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
|
236 |
|
43384 | 237 |
declare -a UPDATED=() |
238 |
||
43285 | 239 |
if [ "$BUILD_JARS" = jars_fresh ]; then |
240 |
OUTDATED=true |
|
241 |
else |
|
242 |
OUTDATED=false |
|
43368
0dc67b3cf8a5
check source dependencies only if jedit_build component is available;
wenzelm
parents:
43320
diff
changeset
|
243 |
if [ ! -e "$TARGET" ]; then |
0dc67b3cf8a5
check source dependencies only if jedit_build component is available;
wenzelm
parents:
43320
diff
changeset
|
244 |
OUTDATED=true |
43384 | 245 |
else |
246 |
if [ -n "$ISABELLE_JEDIT_BUILD_HOME" ]; then |
|
49566
66cbf8bb4693
basic integration of graphview into document model;
wenzelm
parents:
49494
diff
changeset
|
247 |
declare -a DEPS=( |
51504 | 248 |
"$JEDIT_JAR" "${JEDIT_JARS[@]}" "${JFREECHART_JARS[@]}" "$XZ_JAVA_HOME/lib/xz.jar" |
49566
66cbf8bb4693
basic integration of graphview into document model;
wenzelm
parents:
49494
diff
changeset
|
249 |
"$PURE_JAR" "$GRAPHVIEW_JAR" "${SOURCES[@]}" "${RESOURCES[@]}" |
66cbf8bb4693
basic integration of graphview into document model;
wenzelm
parents:
49494
diff
changeset
|
250 |
) |
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
|
251 |
elif [ -e "$ISABELLE_HOME/Admin/build" ]; then |
49566
66cbf8bb4693
basic integration of graphview into document model;
wenzelm
parents:
49494
diff
changeset
|
252 |
declare -a DEPS=("$PURE_JAR" "$GRAPHVIEW_JAR" "${SOURCES[@]}" "${RESOURCES[@]}") |
43384 | 253 |
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
|
254 |
declare -a DEPS=() |
43384 | 255 |
fi |
256 |
for DEP in "${DEPS[@]}" |
|
43368
0dc67b3cf8a5
check source dependencies only if jedit_build component is available;
wenzelm
parents:
43320
diff
changeset
|
257 |
do |
43384 | 258 |
[ ! -e "$DEP" ] && fail "Missing file: $DEP" |
259 |
[ "$DEP" -nt "$TARGET" ] && { |
|
260 |
OUTDATED=true |
|
261 |
UPDATED["${#UPDATED[@]}"]="$DEP" |
|
262 |
} |
|
43368
0dc67b3cf8a5
check source dependencies only if jedit_build component is available;
wenzelm
parents:
43320
diff
changeset
|
263 |
done |
0dc67b3cf8a5
check source dependencies only if jedit_build component is available;
wenzelm
parents:
43320
diff
changeset
|
264 |
fi |
43285 | 265 |
fi |
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
266 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
267 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
268 |
# build |
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 |
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
|
271 |
then |
43405 | 272 |
echo "### Building Isabelle/jEdit ..." |
273 |
||
43384 | 274 |
[ "${#UPDATED[@]}" -gt 0 ] && { |
43405 | 275 |
echo "Changed files:" |
43384 | 276 |
for FILE in "${UPDATED[@]}" |
277 |
do |
|
278 |
echo " $FILE" |
|
279 |
done |
|
280 |
} |
|
281 |
||
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
282 |
[ -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
|
283 |
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
|
284 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
285 |
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
|
286 |
mkdir -p dist dist/classes || failed |
43287 | 287 |
|
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
|
288 |
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
|
289 |
cp -p -R -f "${RESOURCES[@]}" dist/classes/. |
43287 | 290 |
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
|
291 |
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
|
292 |
|
43391 | 293 |
perl -i -e 'while (<>) { |
294 |
if (m/NAME="javacc"/) { |
|
295 |
print qq,<MODE NAME="isabelle" FILE="isabelle.xml" FILE_NAME_GLOB="*.thy"/>\n\n,; |
|
52539 | 296 |
print qq,<MODE NAME="isabelle-news" FILE="isabelle-news.xml"/>\n\n,; |
48366 | 297 |
print qq,<MODE NAME="isabelle-options" FILE="isabelle-options.xml"/>\n\n,; |
48575 | 298 |
print qq,<MODE NAME="isabelle-root" FILE="isabelle-root.xml" FILE_NAME_GLOB="ROOT"/>\n\n,; } |
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
299 |
print; }' dist/modes/catalog |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
300 |
|
47995
72f52cd7c633
include scala-compiler.jar in basic Isabelle/Scala environment, to make Isabelle/jEdit console work with scala-2.10.0-M3;
wenzelm
parents:
47849
diff
changeset
|
301 |
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
|
302 |
( |
51504 | 303 |
for JAR in "$JEDIT_JAR" "${JEDIT_JARS[@]}" "${JFREECHART_JARS[@]}" "$XZ_JAVA_HOME/lib/xz.jar" \ |
304 |
"$PURE_JAR" "$GRAPHVIEW_JAR" "$SCALA_HOME/lib/scala-compiler.jar" |
|
43284
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
305 |
do |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
306 |
CLASSPATH="$CLASSPATH:$JAR" |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
307 |
done |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
308 |
CLASSPATH="$(jvmpath "$CLASSPATH")" |
47009 | 309 |
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
|
310 |
) || 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
|
311 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
312 |
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
|
313 |
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
|
314 |
cd ../.. |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
315 |
rm -rf dist/classes |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
316 |
fi |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
317 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
318 |
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
|
319 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
320 |
|
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
321 |
## main |
04d473e883df
build jedit as part of regular startup script (in that case depending on jedit_build component);
wenzelm
parents:
41380
diff
changeset
|
322 |
|
50795
69810ebe120f
refrain from writing to JEDIT_SETTINGS in BUILD_ONLY mode -- relevant for makedist;
wenzelm
parents:
50782
diff
changeset
|
323 |
if [ "$BUILD_ONLY" = false ]; then |
69810ebe120f
refrain from writing to JEDIT_SETTINGS in BUILD_ONLY mode -- relevant for makedist;
wenzelm
parents:
50782
diff
changeset
|
324 |
mkdir -p "$JEDIT_SETTINGS/DockableWindowManager" |
34880 | 325 |
|
50795
69810ebe120f
refrain from writing to JEDIT_SETTINGS in BUILD_ONLY mode -- relevant for makedist;
wenzelm
parents:
50782
diff
changeset
|
326 |
if [ ! -e "$JEDIT_SETTINGS/perspective.xml" ]; then |
69810ebe120f
refrain from writing to JEDIT_SETTINGS in BUILD_ONLY mode -- relevant for makedist;
wenzelm
parents:
50782
diff
changeset
|
327 |
cat > "$JEDIT_SETTINGS/DockableWindowManager/perspective-view0.xml" <<EOF |
48014
63021e59cbf0
separate README dockable, which allows to make it more prominent first and remove it later;
wenzelm
parents:
47995
diff
changeset
|
328 |
<DOCKING LEFT="" TOP="" RIGHT="" BOTTOM="isabelle-readme" LEFT_POS="0" TOP_POS="0" RIGHT_POS="250" BOTTOM_POS="250" /> |
34880 | 329 |
EOF |
330 |
cat > "$JEDIT_SETTINGS/perspective.xml" <<EOF |
|
331 |
<?xml version="1.0" encoding="UTF-8" ?> |
|
332 |
<!DOCTYPE PERSPECTIVE SYSTEM "perspective.dtd"> |
|
333 |
<PERSPECTIVE> |
|
334 |
<VIEW PLAIN="FALSE"> |
|
335 |
<GEOMETRY X="0" Y="35" WIDTH="1072" HEIGHT="787" EXT_STATE="0" /> |
|
336 |
</VIEW> |
|
337 |
</PERSPECTIVE> |
|
338 |
EOF |
|
50795
69810ebe120f
refrain from writing to JEDIT_SETTINGS in BUILD_ONLY mode -- relevant for makedist;
wenzelm
parents:
50782
diff
changeset
|
339 |
fi |
34880 | 340 |
|
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
|
341 |
if [ "$NO_BUILD" = false ]; then |
50546 | 342 |
"$ISABELLE_TOOL" build_dialog "${BUILD_DIALOG_OPTIONS[@]}" |
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
|
343 |
RC="$?" |
2e1b47e22fc6
more rigorous "build only" mode: avoid build dialog of logic image and its potential need for GUI display;
wenzelm
parents:
50405
diff
changeset
|
344 |
[ "$RC" = 0 ] || exit "$RC" |
2e1b47e22fc6
more rigorous "build only" mode: avoid build dialog of logic image and its potential need for GUI display;
wenzelm
parents:
50405
diff
changeset
|
345 |
fi |
2e1b47e22fc6
more rigorous "build only" mode: avoid build dialog of logic image and its potential need for GUI display;
wenzelm
parents:
50405
diff
changeset
|
346 |
|
48791 | 347 |
export JEDIT_SESSION_DIRS JEDIT_LOGIC JEDIT_PRINT_MODE |
34333 | 348 |
|
43285 | 349 |
exec "$ISABELLE_TOOL" java "${JAVA_ARGS[@]}" \ |
350 |
-jar "$(jvmpath "$JEDIT_HOME/dist/jedit.jar")" \ |
|
351 |
"-settings=$(jvmpath "$JEDIT_SETTINGS")" "${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
|
352 |
fi |