author | wenzelm |
Tue, 24 Jul 2012 11:04:49 +0200 | |
changeset 48464 | a7bf1587eba0 |
parent 48463 | 07f752935ece |
child 48465 | a25daffda966 |
permissions | -rw-r--r-- |
48418 | 1 |
(* Title: Pure/System/build.ML |
2 |
Author: Makarius |
|
3 |
||
4 |
Build Isabelle sessions. |
|
5 |
*) |
|
6 |
||
7 |
signature BUILD = |
|
8 |
sig |
|
9 |
val build: string -> unit |
|
10 |
end; |
|
11 |
||
12 |
structure Build: BUILD = |
|
13 |
struct |
|
14 |
||
48459
375e45df6fdf
timing is command line options, not system option;
wenzelm
parents:
48458
diff
changeset
|
15 |
fun use_theories options = |
48457 | 16 |
Thy_Info.use_thys |
17 |
|> Unsynchronized.setmp Proofterm.proofs (Options.int options "proofs") |
|
18 |
|> Unsynchronized.setmp print_mode |
|
19 |
(space_explode "," (Options.string options "print_mode") @ print_mode_value ()) |
|
20 |
|> Unsynchronized.setmp Goal.parallel_proofs (Options.int options "parallel_proofs") |
|
21 |
|> Unsynchronized.setmp Goal.parallel_proofs_threshold |
|
22 |
(Options.int options "parallel_proofs_threshold") |
|
23 |
|> Unsynchronized.setmp Multithreading.trace (Options.int options "threads_trace") |
|
48460 | 24 |
|> Unsynchronized.setmp Multithreading.max_threads (Options.int options "threads") |
48464 | 25 |
|> Options.bool options "no_document" ? Present.no_document |
26 |
|> Unsynchronized.setmp quick_and_dirty (Options.bool options "quick_and_dirty"); |
|
48457 | 27 |
|
48418 | 28 |
fun build args_file = |
29 |
let |
|
48459
375e45df6fdf
timing is command line options, not system option;
wenzelm
parents:
48458
diff
changeset
|
30 |
val (save, (options, (timing, (verbose, (browser_info, (parent, |
375e45df6fdf
timing is command line options, not system option;
wenzelm
parents:
48458
diff
changeset
|
31 |
(name, (base_name, theories)))))))) = |
48418 | 32 |
File.read (Path.explode args_file) |> YXML.parse_body |> |
48457 | 33 |
let open XML.Decode in |
48459
375e45df6fdf
timing is command line options, not system option;
wenzelm
parents:
48458
diff
changeset
|
34 |
pair bool (pair Options.decode (pair bool (pair bool (pair string (pair string |
375e45df6fdf
timing is command line options, not system option;
wenzelm
parents:
48458
diff
changeset
|
35 |
(pair string (pair string ((list (pair Options.decode (list string))))))))))) |
48457 | 36 |
end; |
48418 | 37 |
|
48457 | 38 |
val _ = |
48462
424fd5364f15
clarified "this_name" vs. former "reset" feature -- imitate the latter by loading other session sources directly;
wenzelm
parents:
48461
diff
changeset
|
39 |
Session.init save false |
48457 | 40 |
(Options.bool options "browser_info") browser_info |
48458 | 41 |
(Options.string options "document") |
48457 | 42 |
(Options.bool options "document_graph") |
43 |
(space_explode "," (Options.string options "document_variants")) |
|
48462
424fd5364f15
clarified "this_name" vs. former "reset" feature -- imitate the latter by loading other session sources directly;
wenzelm
parents:
48461
diff
changeset
|
44 |
parent base_name |
48457 | 45 |
(true (* FIXME copy document/ files on Scala side!? *), |
46 |
Options.string options "document_dump") |
|
48463 | 47 |
(Options.string options "browser_info_remote") |
48457 | 48 |
verbose; |
49 |
||
48461 | 50 |
val _ = Session.with_timing name timing (List.app (uncurry use_theories)) theories; |
48418 | 51 |
val _ = Session.finish (); |
52 |
||
48419 | 53 |
val _ = if save then () else quit (); |
48418 | 54 |
in () end |
55 |
handle exn => (Output.error_msg (ML_Compiler.exn_message exn); exit 1); |
|
56 |
||
57 |
end; |