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