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