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