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