author | wenzelm |
Tue, 08 Mar 2016 18:15:16 +0100 | |
changeset 62559 | 83e815849a91 |
parent 62544 | efa178abe023 |
child 62584 | 6cd36a0d2a28 |
permissions | -rwxr-xr-x |
34282
549969a7f582
simplified build/bootstrap of Isabelle/Scala components -- avoid make;
wenzelm
parents:
diff
changeset
|
1 |
#!/usr/bin/env bash |
549969a7f582
simplified build/bootstrap of Isabelle/Scala components -- avoid make;
wenzelm
parents:
diff
changeset
|
2 |
# |
549969a7f582
simplified build/bootstrap of Isabelle/Scala components -- avoid make;
wenzelm
parents:
diff
changeset
|
3 |
# Author: Makarius |
549969a7f582
simplified build/bootstrap of Isabelle/Scala components -- avoid make;
wenzelm
parents:
diff
changeset
|
4 |
# |
42899 | 5 |
# build-jars - build Isabelle/Scala |
34282
549969a7f582
simplified build/bootstrap of Isabelle/Scala components -- avoid make;
wenzelm
parents:
diff
changeset
|
6 |
# |
549969a7f582
simplified build/bootstrap of Isabelle/Scala components -- avoid make;
wenzelm
parents:
diff
changeset
|
7 |
# Requires proper Isabelle settings environment. |
549969a7f582
simplified build/bootstrap of Isabelle/Scala components -- avoid make;
wenzelm
parents:
diff
changeset
|
8 |
|
43320 | 9 |
## sources |
10 |
||
11 |
declare -a SOURCES=( |
|
60991 | 12 |
Concurrent/bash.scala |
56695
963732291084
consumer thread with unbounded queueing of requests (similar to Message_Channel in ML);
wenzelm
parents:
56693
diff
changeset
|
13 |
Concurrent/consumer_thread.scala |
43660 | 14 |
Concurrent/counter.scala |
56768 | 15 |
Concurrent/event_timer.scala |
43320 | 16 |
Concurrent/future.scala |
56693 | 17 |
Concurrent/mailbox.scala |
59136
c2b23cb8a677
added Par_List in Scala, in accordance to ML version;
wenzelm
parents:
58928
diff
changeset
|
18 |
Concurrent/par_list.scala |
61556 | 19 |
Concurrent/standard_thread.scala |
56685 | 20 |
Concurrent/synchronized.scala |
57647 | 21 |
GUI/color_value.scala |
22 |
GUI/gui.scala |
|
23 |
GUI/gui_thread.scala |
|
24 |
GUI/html5_panel.scala |
|
57908
1937603dbdf2
separate Java FX modules -- no need to include jfxrt.jar by default;
wenzelm
parents:
57905
diff
changeset
|
25 |
GUI/jfx_gui.scala |
57647 | 26 |
GUI/popup.scala |
27 |
GUI/wrap_panel.scala |
|
55511
984e210d412e
antiquotations within plain text: Scala version in accordance to ML;
wenzelm
parents:
55497
diff
changeset
|
28 |
General/antiquote.scala |
54439 | 29 |
General/bytes.scala |
55673
0286219c1261
clarified module location (again, see 763d35697338);
wenzelm
parents:
55511
diff
changeset
|
30 |
General/completion.scala |
62508
d0b68218ea55
discontinued RAW session: bootstrap directly from isabelle_process RAW_ML_SYSTEM;
wenzelm
parents:
62452
diff
changeset
|
31 |
General/exn.scala |
48411
5b3440850d36
more abstract file system operations in Scala, corresponding to ML version;
wenzelm
parents:
48410
diff
changeset
|
32 |
General/file.scala |
46611 | 33 |
General/graph.scala |
59244
19b5fc4b2b38
more uniform support for graph display in ML/Scala;
wenzelm
parents:
59232
diff
changeset
|
34 |
General/graph_display.scala |
51098 | 35 |
General/graphics_file.scala |
43320 | 36 |
General/linear_set.scala |
56800 | 37 |
General/long_name.scala |
52975 | 38 |
General/multi_map.scala |
56782
433cf57550fa
more systematic Isabelle output, like in classic Isabelle/ML (without markup);
wenzelm
parents:
56768
diff
changeset
|
39 |
General/output.scala |
43600
4ac04bf9ff89
abstract algebra of file paths in Scala (cf. path.ML);
wenzelm
parents:
43523
diff
changeset
|
40 |
General/path.scala |
43320 | 41 |
General/position.scala |
42 |
General/pretty.scala |
|
43780 | 43 |
General/properties.scala |
43320 | 44 |
General/scan.scala |
45 |
General/sha1.scala |
|
46 |
General/symbol.scala |
|
45674 | 47 |
General/time.scala |
45666 | 48 |
General/timing.scala |
57647 | 49 |
General/untyped.scala |
56501
5fda9e5c5874
basic URL operations (with Isabelle/Scala error handling);
wenzelm
parents:
56429
diff
changeset
|
50 |
General/url.scala |
56599 | 51 |
General/word.scala |
52671
9a360530eac8
separate module XZ_File to avoid initial dependency on org.tukaani.xz;
wenzelm
parents:
52667
diff
changeset
|
52 |
General/xz_file.scala |
43320 | 53 |
Isar/keyword.scala |
54 |
Isar/outer_syntax.scala |
|
55 |
Isar/parse.scala |
|
56 |
Isar/token.scala |
|
55497 | 57 |
ML/ml_lex.scala |
62528 | 58 |
ML/ml_syntax.scala |
59362 | 59 |
PIDE/batch_session.scala |
43320 | 60 |
PIDE/command.scala |
57905
c0c5652e796e
separate module Command_Span: mostly syntactic representation;
wenzelm
parents:
57900
diff
changeset
|
61 |
PIDE/command_span.scala |
43320 | 62 |
PIDE/document.scala |
52530
99dd8b4ef3fe
explicit module Document_ID as source of globally unique identifiers across ML/Scala;
wenzelm
parents:
52444
diff
changeset
|
63 |
PIDE/document_id.scala |
52971
31926d2c04ee
tuned signature -- more abstract PIDE editor operations;
wenzelm
parents:
52671
diff
changeset
|
64 |
PIDE/editor.scala |
45670 | 65 |
PIDE/markup.scala |
43320 | 66 |
PIDE/markup_tree.scala |
45709
87017fcbad83
clarified modules (again) -- NB: both Document and Protocol are specific to this particular prover;
wenzelm
parents:
45674
diff
changeset
|
67 |
PIDE/protocol.scala |
59713 | 68 |
PIDE/protocol_message.scala |
56385 | 69 |
PIDE/prover.scala |
52981 | 70 |
PIDE/query_operation.scala |
56208 | 71 |
PIDE/resources.scala |
56210 | 72 |
PIDE/session.scala |
43320 | 73 |
PIDE/text.scala |
44698 | 74 |
PIDE/xml.scala |
75 |
PIDE/yxml.scala |
|
57647 | 76 |
ROOT.scala |
61925 | 77 |
System/command_line.scala |
61282 | 78 |
System/cygwin.scala |
62431 | 79 |
System/getopts.scala |
43744
2c7e1565b4a3
some support to invoke Scala methods under program control;
wenzelm
parents:
43730
diff
changeset
|
80 |
System/invoke_scala.scala |
43517 | 81 |
System/isabelle_charset.scala |
43320 | 82 |
System/isabelle_process.scala |
83 |
System/isabelle_system.scala |
|
62544 | 84 |
System/ml_process.scala |
48365
d88aefda01c4
basic support for stand-alone options with external string representation;
wenzelm
parents:
48346
diff
changeset
|
85 |
System/options.scala |
43320 | 86 |
System/platform.scala |
56860 | 87 |
System/posix_interrupt.scala |
62400 | 88 |
System/process_result.scala |
61276 | 89 |
System/progress.scala |
45027
f459e93a038e
more abstract wrapping of fifos as System_Channel;
wenzelm
parents:
44698
diff
changeset
|
90 |
System/system_channel.scala |
50203 | 91 |
System/utf8.scala |
43320 | 92 |
Thy/html.scala |
50707
5b2bf7611662
maintain session index on Scala side, for more determistic results;
wenzelm
parents:
50689
diff
changeset
|
93 |
Thy/present.scala |
43320 | 94 |
Thy/thy_header.scala |
43651
511df47bcadc
some support for theory files within Isabelle/Scala session;
wenzelm
parents:
43600
diff
changeset
|
95 |
Thy/thy_info.scala |
43320 | 96 |
Thy/thy_syntax.scala |
58523 | 97 |
Tools/bibtex.scala |
57647 | 98 |
Tools/build.scala |
99 |
Tools/build_doc.scala |
|
59891
9ce697050455
added isabelle build option -k, for fast off-line checking of theory sources;
wenzelm
parents:
59713
diff
changeset
|
100 |
Tools/check_keywords.scala |
62452 | 101 |
Tools/check_sources.scala |
60749 | 102 |
Tools/debugger.scala |
52444
2cfe6656d6d6
slightly improved "isabelle doc" based on Isabelle/Scala;
wenzelm
parents:
52439
diff
changeset
|
103 |
Tools/doc.scala |
50687 | 104 |
Tools/main.scala |
62559 | 105 |
Tools/ml_console.scala |
50981 | 106 |
Tools/ml_statistics.scala |
62114
a7cf464933f7
generate HTML version of NEWS, with proper symbol rendering;
wenzelm
parents:
61925
diff
changeset
|
107 |
Tools/news.scala |
56864 | 108 |
Tools/print_operation.scala |
54730 | 109 |
Tools/simplifier_trace.scala |
50980 | 110 |
Tools/task_statistics.scala |
58610 | 111 |
Tools/update_cartouches.scala |
58872 | 112 |
Tools/update_header.scala |
61216 | 113 |
Tools/update_then.scala |
61337 | 114 |
Tools/update_theorems.scala |
43320 | 115 |
library.scala |
43730
a0ed7bc688b5
lambda terms with XML data representation in Scala;
wenzelm
parents:
43715
diff
changeset
|
116 |
term.scala |
43779 | 117 |
term_xml.scala |
59441 | 118 |
"../Tools/Graphview/graph_file.scala" |
59202 | 119 |
"../Tools/Graphview/graph_panel.scala" |
59459 | 120 |
"../Tools/Graphview/graphview.scala" |
59232 | 121 |
"../Tools/Graphview/layout.scala" |
59202 | 122 |
"../Tools/Graphview/main_panel.scala" |
59290 | 123 |
"../Tools/Graphview/metrics.scala" |
59202 | 124 |
"../Tools/Graphview/model.scala" |
59392 | 125 |
"../Tools/Graphview/mutator.scala" |
59202 | 126 |
"../Tools/Graphview/mutator_dialog.scala" |
127 |
"../Tools/Graphview/mutator_event.scala" |
|
128 |
"../Tools/Graphview/popups.scala" |
|
129 |
"../Tools/Graphview/shapes.scala" |
|
59392 | 130 |
"../Tools/Graphview/tree_panel.scala" |
43320 | 131 |
) |
132 |
||
34282
549969a7f582
simplified build/bootstrap of Isabelle/Scala components -- avoid make;
wenzelm
parents:
diff
changeset
|
133 |
|
549969a7f582
simplified build/bootstrap of Isabelle/Scala components -- avoid make;
wenzelm
parents:
diff
changeset
|
134 |
## diagnostics |
549969a7f582
simplified build/bootstrap of Isabelle/Scala components -- avoid make;
wenzelm
parents:
diff
changeset
|
135 |
|
43280 | 136 |
PRG="$(basename "$0")" |
137 |
||
138 |
function usage() |
|
139 |
{ |
|
140 |
echo |
|
141 |
echo "Usage: isabelle $PRG [OPTIONS]" |
|
142 |
echo |
|
143 |
echo " Options are:" |
|
144 |
echo " -f fresh build" |
|
47408
63c05991882e
slightly faster default compilation of Isabelle/Scala;
wenzelm
parents:
47115
diff
changeset
|
145 |
echo " -t test separate compilation of PIDE" |
43280 | 146 |
echo |
147 |
exit 1 |
|
148 |
} |
|
149 |
||
34282
549969a7f582
simplified build/bootstrap of Isabelle/Scala components -- avoid make;
wenzelm
parents:
diff
changeset
|
150 |
function fail() |
549969a7f582
simplified build/bootstrap of Isabelle/Scala components -- avoid make;
wenzelm
parents:
diff
changeset
|
151 |
{ |
549969a7f582
simplified build/bootstrap of Isabelle/Scala components -- avoid make;
wenzelm
parents:
diff
changeset
|
152 |
echo "$1" >&2 |
549969a7f582
simplified build/bootstrap of Isabelle/Scala components -- avoid make;
wenzelm
parents:
diff
changeset
|
153 |
exit 2 |
549969a7f582
simplified build/bootstrap of Isabelle/Scala components -- avoid make;
wenzelm
parents:
diff
changeset
|
154 |
} |
549969a7f582
simplified build/bootstrap of Isabelle/Scala components -- avoid make;
wenzelm
parents:
diff
changeset
|
155 |
|
42899 | 156 |
[ -z "$ISABELLE_HOME" ] && fail "Missing Isabelle settings environment" |
34282
549969a7f582
simplified build/bootstrap of Isabelle/Scala components -- avoid make;
wenzelm
parents:
diff
changeset
|
157 |
|
549969a7f582
simplified build/bootstrap of Isabelle/Scala components -- avoid make;
wenzelm
parents:
diff
changeset
|
158 |
|
43280 | 159 |
## process command line |
160 |
||
161 |
# options |
|
162 |
||
163 |
FRESH="" |
|
47408
63c05991882e
slightly faster default compilation of Isabelle/Scala;
wenzelm
parents:
47115
diff
changeset
|
164 |
TEST_PIDE="" |
43280 | 165 |
|
47408
63c05991882e
slightly faster default compilation of Isabelle/Scala;
wenzelm
parents:
47115
diff
changeset
|
166 |
while getopts "ft" OPT |
43280 | 167 |
do |
168 |
case "$OPT" in |
|
169 |
f) |
|
170 |
FRESH=true |
|
171 |
;; |
|
47408
63c05991882e
slightly faster default compilation of Isabelle/Scala;
wenzelm
parents:
47115
diff
changeset
|
172 |
t) |
63c05991882e
slightly faster default compilation of Isabelle/Scala;
wenzelm
parents:
47115
diff
changeset
|
173 |
TEST_PIDE=true |
63c05991882e
slightly faster default compilation of Isabelle/Scala;
wenzelm
parents:
47115
diff
changeset
|
174 |
;; |
43280 | 175 |
\?) |
176 |
usage |
|
177 |
;; |
|
178 |
esac |
|
179 |
done |
|
180 |
||
181 |
shift $(($OPTIND - 1)) |
|
182 |
||
183 |
||
184 |
# args |
|
185 |
||
186 |
[ "$#" -ne 0 ] && usage |
|
187 |
||
188 |
||
49558 | 189 |
## build |
34282
549969a7f582
simplified build/bootstrap of Isabelle/Scala components -- avoid make;
wenzelm
parents:
diff
changeset
|
190 |
|
34284 | 191 |
TARGET_DIR="$ISABELLE_HOME/lib/classes" |
53577 | 192 |
TARGET="$TARGET_DIR/Pure.jar" |
34282
549969a7f582
simplified build/bootstrap of Isabelle/Scala components -- avoid make;
wenzelm
parents:
diff
changeset
|
193 |
|
45673
cd41e3903fbf
separate compilation of PIDE vs. Pure sources, which enables independent Scala library;
wenzelm
parents:
45672
diff
changeset
|
194 |
declare -a PIDE_SOURCES=() |
cd41e3903fbf
separate compilation of PIDE vs. Pure sources, which enables independent Scala library;
wenzelm
parents:
45672
diff
changeset
|
195 |
declare -a PURE_SOURCES=() |
cd41e3903fbf
separate compilation of PIDE vs. Pure sources, which enables independent Scala library;
wenzelm
parents:
45672
diff
changeset
|
196 |
|
cd41e3903fbf
separate compilation of PIDE vs. Pure sources, which enables independent Scala library;
wenzelm
parents:
45672
diff
changeset
|
197 |
for DEP in "${SOURCES[@]}" |
cd41e3903fbf
separate compilation of PIDE vs. Pure sources, which enables independent Scala library;
wenzelm
parents:
45672
diff
changeset
|
198 |
do |
cd41e3903fbf
separate compilation of PIDE vs. Pure sources, which enables independent Scala library;
wenzelm
parents:
45672
diff
changeset
|
199 |
if grep "Module:.*PIDE" "$DEP" >/dev/null |
cd41e3903fbf
separate compilation of PIDE vs. Pure sources, which enables independent Scala library;
wenzelm
parents:
45672
diff
changeset
|
200 |
then |
cd41e3903fbf
separate compilation of PIDE vs. Pure sources, which enables independent Scala library;
wenzelm
parents:
45672
diff
changeset
|
201 |
PIDE_SOURCES["${#PIDE_SOURCES[@]}"]="$DEP" |
cd41e3903fbf
separate compilation of PIDE vs. Pure sources, which enables independent Scala library;
wenzelm
parents:
45672
diff
changeset
|
202 |
else |
cd41e3903fbf
separate compilation of PIDE vs. Pure sources, which enables independent Scala library;
wenzelm
parents:
45672
diff
changeset
|
203 |
PURE_SOURCES["${#PURE_SOURCES[@]}"]="$DEP" |
cd41e3903fbf
separate compilation of PIDE vs. Pure sources, which enables independent Scala library;
wenzelm
parents:
45672
diff
changeset
|
204 |
fi |
cd41e3903fbf
separate compilation of PIDE vs. Pure sources, which enables independent Scala library;
wenzelm
parents:
45672
diff
changeset
|
205 |
done |
cd41e3903fbf
separate compilation of PIDE vs. Pure sources, which enables independent Scala library;
wenzelm
parents:
45672
diff
changeset
|
206 |
|
43405 | 207 |
declare -a UPDATED=() |
208 |
||
43280 | 209 |
if [ -n "$FRESH" ]; then |
210 |
OUTDATED=true |
|
211 |
else |
|
212 |
OUTDATED=false |
|
43523 | 213 |
if [ ! -e "$TARGET" ]; then |
214 |
OUTDATED=true |
|
215 |
else |
|
43405 | 216 |
for DEP in "${SOURCES[@]}" |
43280 | 217 |
do |
43405 | 218 |
[ ! -e "$DEP" ] && fail "Missing file: $DEP" |
43523 | 219 |
[ "$DEP" -nt "$TARGET" ] && { |
220 |
OUTDATED=true |
|
221 |
UPDATED["${#UPDATED[@]}"]="$DEP" |
|
222 |
} |
|
43280 | 223 |
done |
43405 | 224 |
fi |
43280 | 225 |
fi |
34282
549969a7f582
simplified build/bootstrap of Isabelle/Scala components -- avoid make;
wenzelm
parents:
diff
changeset
|
226 |
|
34284 | 227 |
if [ "$OUTDATED" = true ] |
228 |
then |
|
49173
fa01a202399c
eliminated potentially confusing terminology of Scala "layer";
wenzelm
parents:
49068
diff
changeset
|
229 |
echo "### Building Isabelle/Scala ..." |
34282
549969a7f582
simplified build/bootstrap of Isabelle/Scala components -- avoid make;
wenzelm
parents:
diff
changeset
|
230 |
|
43405 | 231 |
[ "${#UPDATED[@]}" -gt 0 ] && { |
232 |
echo "Changed files:" |
|
233 |
for FILE in "${UPDATED[@]}" |
|
234 |
do |
|
235 |
echo " $FILE" |
|
236 |
done |
|
237 |
} |
|
238 |
||
34282
549969a7f582
simplified build/bootstrap of Isabelle/Scala components -- avoid make;
wenzelm
parents:
diff
changeset
|
239 |
rm -rf classes && mkdir classes |
45673
cd41e3903fbf
separate compilation of PIDE vs. Pure sources, which enables independent Scala library;
wenzelm
parents:
45672
diff
changeset
|
240 |
|
47009 | 241 |
SCALAC_OPTIONS="$ISABELLE_SCALA_BUILD_OPTIONS -d classes" |
45673
cd41e3903fbf
separate compilation of PIDE vs. Pure sources, which enables independent Scala library;
wenzelm
parents:
45672
diff
changeset
|
242 |
|
50689 | 243 |
( |
58791 | 244 |
classpath "$JAVA_HOME/lib/jfxrt.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:
53519
diff
changeset
|
245 |
classpath classes |
61294 | 246 |
export CLASSPATH="$(platform_path "$ISABELLE_CLASSPATH")" |
50689 | 247 |
|
248 |
if [ "$TEST_PIDE" = true ]; then |
|
249 |
isabelle_scala scalac $SCALAC_OPTIONS "${PIDE_SOURCES[@]}" || \ |
|
250 |
fail "Failed to compile PIDE sources" |
|
251 |
isabelle_scala scalac $SCALAC_OPTIONS "${PURE_SOURCES[@]}" || \ |
|
252 |
fail "Failed to compile Pure sources" |
|
253 |
else |
|
254 |
isabelle_scala scalac $SCALAC_OPTIONS "${PIDE_SOURCES[@]}" "${PURE_SOURCES[@]}" || \ |
|
255 |
fail "Failed to compile sources" |
|
256 |
fi |
|
51508 | 257 |
) || exit "$?" |
45673
cd41e3903fbf
separate compilation of PIDE vs. Pure sources, which enables independent Scala library;
wenzelm
parents:
45672
diff
changeset
|
258 |
|
53577 | 259 |
mkdir -p "$TARGET_DIR" || fail "Failed to create directory $TARGET_DIR" |
43280 | 260 |
|
43285 | 261 |
pushd classes >/dev/null |
43280 | 262 |
|
43517 | 263 |
CHARSET_SERVICE="META-INF/services/java.nio.charset.spi.CharsetProvider" |
264 |
mkdir -p "$(dirname "$CHARSET_SERVICE")" |
|
265 |
echo isabelle.Isabelle_Charset_Provider > "$CHARSET_SERVICE" |
|
266 |
||
54676
6b2ca4850b71
uniform use of transparent icons, as for main "apps";
wenzelm
parents:
54671
diff
changeset
|
267 |
cp "$ISABELLE_HOME/lib/logo/isabelle_transparent-32.gif" isabelle/. |
54709 | 268 |
cp "$ISABELLE_HOME/lib/logo/isabelle_transparent.gif" isabelle/. |
53452
8181bc357dc4
more portable access to icon -- avoid Isabelle_System which is not yet initialized in bootstrap;
wenzelm
parents:
53279
diff
changeset
|
269 |
|
61294 | 270 |
isabelle_jdk jar cfe "$(platform_path "$TARGET")" isabelle.Main META-INF isabelle || \ |
43523 | 271 |
fail "Failed to produce $TARGET" |
34282
549969a7f582
simplified build/bootstrap of Isabelle/Scala components -- avoid make;
wenzelm
parents:
diff
changeset
|
272 |
|
43280 | 273 |
popd >/dev/null |
274 |
||
34282
549969a7f582
simplified build/bootstrap of Isabelle/Scala components -- avoid make;
wenzelm
parents:
diff
changeset
|
275 |
rm -rf classes |
549969a7f582
simplified build/bootstrap of Isabelle/Scala components -- avoid make;
wenzelm
parents:
diff
changeset
|
276 |
fi |