author | wenzelm |
Mon, 10 May 2021 12:23:30 +0200 | |
changeset 73653 | d9823224fcfe |
parent 73523 | 2cd23d587db9 |
child 73691 | 2f9877db82a1 |
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=( |
|
72748
04d5f6d769a7
more flexible syntax for theory load commands via Isabelle/Scala;
wenzelm
parents:
72662
diff
changeset
|
12 |
src/HOL/SPARK/Tools/spark.scala |
73418
7d7d959547a1
support for SystemOnTPTP in Isabelle/ML and Isabelle/Scala (without perl);
wenzelm
parents:
73399
diff
changeset
|
13 |
src/HOL/Tools/ATP/system_on_tptp.scala |
72176 | 14 |
src/HOL/Tools/Nitpick/kodkod.scala |
71367 | 15 |
src/Pure/Admin/afp.scala |
72414
af24c0dd6975
build Isabelle CSDP component from official downloads;
wenzelm
parents:
72411
diff
changeset
|
16 |
src/Pure/Admin/build_csdp.scala |
71367 | 17 |
src/Pure/Admin/build_cygwin.scala |
18 |
src/Pure/Admin/build_doc.scala |
|
72363
fc5f10691147
build Isabelle E prover component from official downloads;
wenzelm
parents:
72346
diff
changeset
|
19 |
src/Pure/Admin/build_e.scala |
71367 | 20 |
src/Pure/Admin/build_fonts.scala |
21 |
src/Pure/Admin/build_history.scala |
|
73476
6b480efe1bc3
support for Java Chromium Embedded Framework (JCEF): still somewhat fragile;
wenzelm
parents:
73418
diff
changeset
|
22 |
src/Pure/Admin/build_jcef.scala |
71367 | 23 |
src/Pure/Admin/build_jdk.scala |
73653
d9823224fcfe
build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
73523
diff
changeset
|
24 |
src/Pure/Admin/build_jedit.scala |
71367 | 25 |
src/Pure/Admin/build_log.scala |
26 |
src/Pure/Admin/build_polyml.scala |
|
27 |
src/Pure/Admin/build_release.scala |
|
72411
b8cc129ece05
build Isabelle SPASS component from unofficial download;
wenzelm
parents:
72363
diff
changeset
|
28 |
src/Pure/Admin/build_spass.scala |
72346
93e533198bf6
build Isabelle sqlite-jdbc component from official download;
wenzelm
parents:
72338
diff
changeset
|
29 |
src/Pure/Admin/build_sqlite.scala |
71367 | 30 |
src/Pure/Admin/build_status.scala |
72886
ac64b753a65f
build Isabelle Vampire component from repository;
wenzelm
parents:
72767
diff
changeset
|
31 |
src/Pure/Admin/build_vampire.scala |
72439
7f6800b2e8c2
build Isabelle veriT component from official download;
wenzelm
parents:
72421
diff
changeset
|
32 |
src/Pure/Admin/build_verit.scala |
72466
04403e1ef176
build Isabelle Zipperposition component from OPAM repository;
wenzelm
parents:
72448
diff
changeset
|
33 |
src/Pure/Admin/build_zipperposition.scala |
71367 | 34 |
src/Pure/Admin/check_sources.scala |
35 |
src/Pure/Admin/ci_profile.scala |
|
36 |
src/Pure/Admin/components.scala |
|
37 |
src/Pure/Admin/isabelle_cronjob.scala |
|
38 |
src/Pure/Admin/isabelle_devel.scala |
|
39 |
src/Pure/Admin/jenkins.scala |
|
40 |
src/Pure/Admin/other_isabelle.scala |
|
41 |
src/Pure/Concurrent/consumer_thread.scala |
|
42 |
src/Pure/Concurrent/counter.scala |
|
71704 | 43 |
src/Pure/Concurrent/delay.scala |
71367 | 44 |
src/Pure/Concurrent/event_timer.scala |
45 |
src/Pure/Concurrent/future.scala |
|
71692 | 46 |
src/Pure/Concurrent/isabelle_thread.scala |
71367 | 47 |
src/Pure/Concurrent/mailbox.scala |
48 |
src/Pure/Concurrent/par_list.scala |
|
49 |
src/Pure/Concurrent/synchronized.scala |
|
50 |
src/Pure/GUI/color_value.scala |
|
72981 | 51 |
src/Pure/GUI/desktop_app.scala |
71367 | 52 |
src/Pure/GUI/gui.scala |
53 |
src/Pure/GUI/gui_thread.scala |
|
54 |
src/Pure/GUI/popup.scala |
|
55 |
src/Pure/GUI/wrap_panel.scala |
|
56 |
src/Pure/General/antiquote.scala |
|
57 |
src/Pure/General/bytes.scala |
|
58 |
src/Pure/General/cache.scala |
|
59 |
src/Pure/General/codepoint.scala |
|
60 |
src/Pure/General/comment.scala |
|
61 |
src/Pure/General/completion.scala |
|
62 |
src/Pure/General/csv.scala |
|
63 |
src/Pure/General/date.scala |
|
64 |
src/Pure/General/exn.scala |
|
65 |
src/Pure/General/file.scala |
|
66 |
src/Pure/General/file_watcher.scala |
|
67 |
src/Pure/General/graph.scala |
|
68 |
src/Pure/General/graph_display.scala |
|
69 |
src/Pure/General/graphics_file.scala |
|
70 |
src/Pure/General/http.scala |
|
71 |
src/Pure/General/json.scala |
|
72 |
src/Pure/General/linear_set.scala |
|
73 |
src/Pure/General/logger.scala |
|
74 |
src/Pure/General/long_name.scala |
|
72558 | 75 |
src/Pure/General/mailman.scala |
71367 | 76 |
src/Pure/General/mercurial.scala |
77 |
src/Pure/General/multi_map.scala |
|
78 |
src/Pure/General/output.scala |
|
79 |
src/Pure/General/path.scala |
|
80 |
src/Pure/General/position.scala |
|
81 |
src/Pure/General/pretty.scala |
|
82 |
src/Pure/General/properties.scala |
|
83 |
src/Pure/General/rdf.scala |
|
84 |
src/Pure/General/scan.scala |
|
85 |
src/Pure/General/sha1.scala |
|
86 |
src/Pure/General/sql.scala |
|
87 |
src/Pure/General/ssh.scala |
|
88 |
src/Pure/General/symbol.scala |
|
89 |
src/Pure/General/time.scala |
|
90 |
src/Pure/General/timing.scala |
|
91 |
src/Pure/General/untyped.scala |
|
92 |
src/Pure/General/url.scala |
|
93 |
src/Pure/General/utf8.scala |
|
94 |
src/Pure/General/uuid.scala |
|
95 |
src/Pure/General/value.scala |
|
96 |
src/Pure/General/word.scala |
|
97 |
src/Pure/General/xz.scala |
|
98 |
src/Pure/Isar/document_structure.scala |
|
99 |
src/Pure/Isar/keyword.scala |
|
100 |
src/Pure/Isar/line_structure.scala |
|
101 |
src/Pure/Isar/outer_syntax.scala |
|
102 |
src/Pure/Isar/parse.scala |
|
103 |
src/Pure/Isar/token.scala |
|
104 |
src/Pure/ML/ml_console.scala |
|
105 |
src/Pure/ML/ml_lex.scala |
|
106 |
src/Pure/ML/ml_process.scala |
|
107 |
src/Pure/ML/ml_statistics.scala |
|
108 |
src/Pure/ML/ml_syntax.scala |
|
109 |
src/Pure/PIDE/byte_message.scala |
|
110 |
src/Pure/PIDE/command.scala |
|
111 |
src/Pure/PIDE/command_span.scala |
|
112 |
src/Pure/PIDE/document.scala |
|
113 |
src/Pure/PIDE/document_id.scala |
|
114 |
src/Pure/PIDE/document_status.scala |
|
115 |
src/Pure/PIDE/editor.scala |
|
116 |
src/Pure/PIDE/headless.scala |
|
117 |
src/Pure/PIDE/line.scala |
|
118 |
src/Pure/PIDE/markup.scala |
|
119 |
src/Pure/PIDE/markup_tree.scala |
|
120 |
src/Pure/PIDE/protocol.scala |
|
121 |
src/Pure/PIDE/protocol_handlers.scala |
|
122 |
src/Pure/PIDE/protocol_message.scala |
|
123 |
src/Pure/PIDE/prover.scala |
|
124 |
src/Pure/PIDE/query_operation.scala |
|
125 |
src/Pure/PIDE/rendering.scala |
|
126 |
src/Pure/PIDE/resources.scala |
|
127 |
src/Pure/PIDE/session.scala |
|
128 |
src/Pure/PIDE/text.scala |
|
129 |
src/Pure/PIDE/xml.scala |
|
130 |
src/Pure/PIDE/yxml.scala |
|
131 |
src/Pure/ROOT.scala |
|
132 |
src/Pure/System/bash.scala |
|
133 |
src/Pure/System/command_line.scala |
|
134 |
src/Pure/System/cygwin.scala |
|
72448 | 135 |
src/Pure/System/executable.scala |
71367 | 136 |
src/Pure/System/getopts.scala |
137 |
src/Pure/System/isabelle_charset.scala |
|
138 |
src/Pure/System/isabelle_fonts.scala |
|
72338 | 139 |
src/Pure/System/isabelle_platform.scala |
71367 | 140 |
src/Pure/System/isabelle_process.scala |
141 |
src/Pure/System/isabelle_system.scala |
|
142 |
src/Pure/System/isabelle_tool.scala |
|
72250 | 143 |
src/Pure/System/java_statistics.scala |
71367 | 144 |
src/Pure/System/linux.scala |
72421 | 145 |
src/Pure/System/mingw.scala |
71367 | 146 |
src/Pure/System/numa.scala |
147 |
src/Pure/System/options.scala |
|
148 |
src/Pure/System/platform.scala |
|
149 |
src/Pure/System/posix_interrupt.scala |
|
150 |
src/Pure/System/process_result.scala |
|
151 |
src/Pure/System/progress.scala |
|
71849 | 152 |
src/Pure/System/scala.scala |
71367 | 153 |
src/Pure/System/system_channel.scala |
154 |
src/Pure/System/tty_loop.scala |
|
155 |
src/Pure/Thy/bibtex.scala |
|
156 |
src/Pure/Thy/export.scala |
|
157 |
src/Pure/Thy/export_theory.scala |
|
158 |
src/Pure/Thy/file_format.scala |
|
159 |
src/Pure/Thy/html.scala |
|
160 |
src/Pure/Thy/latex.scala |
|
72652 | 161 |
src/Pure/Thy/presentation.scala |
71367 | 162 |
src/Pure/Thy/sessions.scala |
163 |
src/Pure/Thy/thy_element.scala |
|
164 |
src/Pure/Thy/thy_header.scala |
|
165 |
src/Pure/Thy/thy_syntax.scala |
|
166 |
src/Pure/Tools/build.scala |
|
167 |
src/Pure/Tools/build_docker.scala |
|
72662 | 168 |
src/Pure/Tools/build_job.scala |
71367 | 169 |
src/Pure/Tools/check_keywords.scala |
170 |
src/Pure/Tools/debugger.scala |
|
171 |
src/Pure/Tools/doc.scala |
|
172 |
src/Pure/Tools/dump.scala |
|
173 |
src/Pure/Tools/fontforge.scala |
|
72976
51442c6dc296
more robust Java monitor: avoid odd warning about insecure connection;
wenzelm
parents:
72886
diff
changeset
|
174 |
src/Pure/Tools/java_monitor.scala |
73399 | 175 |
src/Pure/Tools/logo.scala |
71367 | 176 |
src/Pure/Tools/main.scala |
177 |
src/Pure/Tools/mkroot.scala |
|
178 |
src/Pure/Tools/phabricator.scala |
|
179 |
src/Pure/Tools/print_operation.scala |
|
180 |
src/Pure/Tools/profiling_report.scala |
|
71378
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
71375
diff
changeset
|
181 |
src/Pure/Tools/scala_project.scala |
71367 | 182 |
src/Pure/Tools/server.scala |
183 |
src/Pure/Tools/server_commands.scala |
|
184 |
src/Pure/Tools/simplifier_trace.scala |
|
185 |
src/Pure/Tools/spell_checker.scala |
|
186 |
src/Pure/Tools/task_statistics.scala |
|
187 |
src/Pure/Tools/update.scala |
|
188 |
src/Pure/Tools/update_cartouches.scala |
|
189 |
src/Pure/Tools/update_comments.scala |
|
190 |
src/Pure/Tools/update_header.scala |
|
191 |
src/Pure/Tools/update_then.scala |
|
192 |
src/Pure/Tools/update_theorems.scala |
|
193 |
src/Pure/library.scala |
|
194 |
src/Pure/pure_thy.scala |
|
195 |
src/Pure/term.scala |
|
196 |
src/Pure/term_xml.scala |
|
197 |
src/Pure/thm_name.scala |
|
198 |
src/Tools/Graphview/graph_file.scala |
|
199 |
src/Tools/Graphview/graph_panel.scala |
|
200 |
src/Tools/Graphview/graphview.scala |
|
201 |
src/Tools/Graphview/layout.scala |
|
202 |
src/Tools/Graphview/main_panel.scala |
|
203 |
src/Tools/Graphview/metrics.scala |
|
204 |
src/Tools/Graphview/model.scala |
|
205 |
src/Tools/Graphview/mutator.scala |
|
206 |
src/Tools/Graphview/mutator_dialog.scala |
|
207 |
src/Tools/Graphview/mutator_event.scala |
|
208 |
src/Tools/Graphview/popups.scala |
|
209 |
src/Tools/Graphview/shapes.scala |
|
210 |
src/Tools/Graphview/tree_panel.scala |
|
211 |
src/Tools/VSCode/src/build_vscode.scala |
|
212 |
src/Tools/VSCode/src/channel.scala |
|
213 |
src/Tools/VSCode/src/dynamic_output.scala |
|
72761 | 214 |
src/Tools/VSCode/src/language_server.scala |
215 |
src/Tools/VSCode/src/lsp.scala |
|
71367 | 216 |
src/Tools/VSCode/src/preview_panel.scala |
217 |
src/Tools/VSCode/src/state_panel.scala |
|
72767 | 218 |
src/Tools/VSCode/src/textmate_grammar.scala |
72761 | 219 |
src/Tools/VSCode/src/vscode_model.scala |
71367 | 220 |
src/Tools/VSCode/src/vscode_rendering.scala |
221 |
src/Tools/VSCode/src/vscode_resources.scala |
|
222 |
src/Tools/VSCode/src/vscode_spell_checker.scala |
|
43320 | 223 |
) |
224 |
||
34282
549969a7f582
simplified build/bootstrap of Isabelle/Scala components -- avoid make;
wenzelm
parents:
diff
changeset
|
225 |
|
549969a7f582
simplified build/bootstrap of Isabelle/Scala components -- avoid make;
wenzelm
parents:
diff
changeset
|
226 |
## diagnostics |
549969a7f582
simplified build/bootstrap of Isabelle/Scala components -- avoid make;
wenzelm
parents:
diff
changeset
|
227 |
|
43280 | 228 |
PRG="$(basename "$0")" |
229 |
||
230 |
function usage() |
|
231 |
{ |
|
232 |
echo |
|
233 |
echo "Usage: isabelle $PRG [OPTIONS]" |
|
234 |
echo |
|
235 |
echo " Options are:" |
|
236 |
echo " -f fresh build" |
|
237 |
echo |
|
238 |
exit 1 |
|
239 |
} |
|
240 |
||
34282
549969a7f582
simplified build/bootstrap of Isabelle/Scala components -- avoid make;
wenzelm
parents:
diff
changeset
|
241 |
function fail() |
549969a7f582
simplified build/bootstrap of Isabelle/Scala components -- avoid make;
wenzelm
parents:
diff
changeset
|
242 |
{ |
549969a7f582
simplified build/bootstrap of Isabelle/Scala components -- avoid make;
wenzelm
parents:
diff
changeset
|
243 |
echo "$1" >&2 |
549969a7f582
simplified build/bootstrap of Isabelle/Scala components -- avoid make;
wenzelm
parents:
diff
changeset
|
244 |
exit 2 |
549969a7f582
simplified build/bootstrap of Isabelle/Scala components -- avoid make;
wenzelm
parents:
diff
changeset
|
245 |
} |
549969a7f582
simplified build/bootstrap of Isabelle/Scala components -- avoid make;
wenzelm
parents:
diff
changeset
|
246 |
|
42899 | 247 |
[ -z "$ISABELLE_HOME" ] && fail "Missing Isabelle settings environment" |
34282
549969a7f582
simplified build/bootstrap of Isabelle/Scala components -- avoid make;
wenzelm
parents:
diff
changeset
|
248 |
|
549969a7f582
simplified build/bootstrap of Isabelle/Scala components -- avoid make;
wenzelm
parents:
diff
changeset
|
249 |
|
43280 | 250 |
## process command line |
251 |
||
252 |
# options |
|
253 |
||
254 |
FRESH="" |
|
255 |
||
64370
865b39487b5d
discontinued unused / untested distinction of separate PIDE modules;
wenzelm
parents:
64369
diff
changeset
|
256 |
while getopts "f" OPT |
43280 | 257 |
do |
258 |
case "$OPT" in |
|
259 |
f) |
|
260 |
FRESH=true |
|
261 |
;; |
|
262 |
\?) |
|
263 |
usage |
|
264 |
;; |
|
265 |
esac |
|
266 |
done |
|
267 |
||
268 |
shift $(($OPTIND - 1)) |
|
269 |
||
270 |
||
271 |
# args |
|
272 |
||
273 |
[ "$#" -ne 0 ] && usage |
|
274 |
||
275 |
||
71367 | 276 |
## target |
277 |
||
278 |
TARGET_DIR="lib/classes" |
|
279 |
TARGET_JAR="$TARGET_DIR/Pure.jar" |
|
280 |
TARGET_SHASUM="$TARGET_DIR/Pure.shasum" |
|
281 |
||
71374 | 282 |
function target_shasum() |
283 |
{ |
|
284 |
shasum -a1 -b "$TARGET_JAR" "${SOURCES[@]}" 2>/dev/null |
|
285 |
} |
|
286 |
||
71367 | 287 |
function target_clean() |
288 |
{ |
|
289 |
rm -rf "$TARGET_DIR" |
|
290 |
} |
|
291 |
||
292 |
[ -n "$FRESH" ] && target_clean |
|
293 |
||
294 |
||
49558 | 295 |
## build |
34282
549969a7f582
simplified build/bootstrap of Isabelle/Scala components -- avoid make;
wenzelm
parents:
diff
changeset
|
296 |
|
71375 | 297 |
target_shasum | cmp "$TARGET_SHASUM" >/dev/null 2>/dev/null |
71367 | 298 |
if [ "$?" -ne 0 ]; then |
49173
fa01a202399c
eliminated potentially confusing terminology of Scala "layer";
wenzelm
parents:
49068
diff
changeset
|
299 |
echo "### Building Isabelle/Scala ..." |
34282
549969a7f582
simplified build/bootstrap of Isabelle/Scala components -- avoid make;
wenzelm
parents:
diff
changeset
|
300 |
|
71367 | 301 |
target_clean |
43405 | 302 |
|
71367 | 303 |
BUILD_DIR="$TARGET_DIR/build" |
304 |
mkdir -p "$BUILD_DIR" |
|
45673
cd41e3903fbf
separate compilation of PIDE vs. Pure sources, which enables independent Scala library;
wenzelm
parents:
45672
diff
changeset
|
305 |
|
50689 | 306 |
( |
61294 | 307 |
export CLASSPATH="$(platform_path "$ISABELLE_CLASSPATH")" |
71367 | 308 |
isabelle_scala scalac $ISABELLE_SCALAC_OPTIONS \ |
309 |
-d "$BUILD_DIR" "${SOURCES[@]}" |
|
310 |
) || fail "Failed to compile sources" |
|
43280 | 311 |
|
43517 | 312 |
CHARSET_SERVICE="META-INF/services/java.nio.charset.spi.CharsetProvider" |
71367 | 313 |
mkdir -p "$BUILD_DIR/$(dirname "$CHARSET_SERVICE")" |
314 |
echo isabelle.Isabelle_Charset_Provider > "$BUILD_DIR/$CHARSET_SERVICE" |
|
43517 | 315 |
|
71367 | 316 |
cp "$ISABELLE_HOME/lib/logo/isabelle_transparent-32.gif" "$BUILD_DIR/isabelle/." |
317 |
cp "$ISABELLE_HOME/lib/logo/isabelle_transparent.gif" "$BUILD_DIR/isabelle/." |
|
53452
8181bc357dc4
more portable access to icon -- avoid Isabelle_System which is not yet initialized in bootstrap;
wenzelm
parents:
53279
diff
changeset
|
318 |
|
71367 | 319 |
isabelle_jdk jar -c -f "$(platform_path "$TARGET_JAR")" -e isabelle.Main \ |
320 |
-C "$BUILD_DIR" META-INF \ |
|
321 |
-C "$BUILD_DIR" isabelle || fail "Failed to produce $TARGET_JAR" |
|
34282
549969a7f582
simplified build/bootstrap of Isabelle/Scala components -- avoid make;
wenzelm
parents:
diff
changeset
|
322 |
|
71367 | 323 |
rm -rf "$BUILD_DIR" |
43280 | 324 |
|
71367 | 325 |
target_shasum > "$TARGET_SHASUM" |
34282
549969a7f582
simplified build/bootstrap of Isabelle/Scala components -- avoid make;
wenzelm
parents:
diff
changeset
|
326 |
fi |