author | wenzelm |
Tue, 24 Jul 2012 11:39:22 +0200 | |
changeset 48466 | 3b2fb20df17d |
parent 48465 | a25daffda966 |
child 48468 | 7f2998b95249 |
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 |
||
48465 | 15 |
local |
16 |
||
17 |
fun use_thys options = |
|
48457 | 18 |
Thy_Info.use_thys |
19 |
|> Unsynchronized.setmp Proofterm.proofs (Options.int options "proofs") |
|
20 |
|> Unsynchronized.setmp print_mode |
|
21 |
(space_explode "," (Options.string options "print_mode") @ print_mode_value ()) |
|
22 |
|> Unsynchronized.setmp Goal.parallel_proofs (Options.int options "parallel_proofs") |
|
23 |
|> Unsynchronized.setmp Goal.parallel_proofs_threshold |
|
24 |
(Options.int options "parallel_proofs_threshold") |
|
25 |
|> Unsynchronized.setmp Multithreading.trace (Options.int options "threads_trace") |
|
48460 | 26 |
|> Unsynchronized.setmp Multithreading.max_threads (Options.int options "threads") |
48464 | 27 |
|> Options.bool options "no_document" ? Present.no_document |
28 |
|> Unsynchronized.setmp quick_and_dirty (Options.bool options "quick_and_dirty"); |
|
48457 | 29 |
|
48465 | 30 |
fun use_theories (options, thys) = |
31 |
let val condition = space_explode "," (Options.string options "condition") in |
|
32 |
(case filter_out (can getenv_strict) condition of |
|
33 |
[] => use_thys options thys |
|
34 |
| conds => |
|
35 |
Output.physical_stderr ("Ignoring theories " ^ commas_quote thys ^ |
|
36 |
" (missing " ^ commas conds ^ ")\n")) |
|
37 |
end; |
|
38 |
||
39 |
in |
|
40 |
||
48418 | 41 |
fun build args_file = |
42 |
let |
|
48459
375e45df6fdf
timing is command line options, not system option;
wenzelm
parents:
48458
diff
changeset
|
43 |
val (save, (options, (timing, (verbose, (browser_info, (parent, |
375e45df6fdf
timing is command line options, not system option;
wenzelm
parents:
48458
diff
changeset
|
44 |
(name, (base_name, theories)))))))) = |
48418 | 45 |
File.read (Path.explode args_file) |> YXML.parse_body |> |
48457 | 46 |
let open XML.Decode in |
48459
375e45df6fdf
timing is command line options, not system option;
wenzelm
parents:
48458
diff
changeset
|
47 |
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
|
48 |
(pair string (pair string ((list (pair Options.decode (list string))))))))))) |
48457 | 49 |
end; |
48418 | 50 |
|
48457 | 51 |
val _ = |
48462
424fd5364f15
clarified "this_name" vs. former "reset" feature -- imitate the latter by loading other session sources directly;
wenzelm
parents:
48461
diff
changeset
|
52 |
Session.init save false |
48457 | 53 |
(Options.bool options "browser_info") browser_info |
48458 | 54 |
(Options.string options "document") |
48457 | 55 |
(Options.bool options "document_graph") |
48466
3b2fb20df17d
further imitation of ISABELLE_USEDIR_OPTIONS via options;
wenzelm
parents:
48465
diff
changeset
|
56 |
(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
|
57 |
parent base_name |
48457 | 58 |
(true (* FIXME copy document/ files on Scala side!? *), |
59 |
Options.string options "document_dump") |
|
48463 | 60 |
(Options.string options "browser_info_remote") |
48457 | 61 |
verbose; |
62 |
||
48465 | 63 |
val _ = Session.with_timing name timing (List.app use_theories) theories; |
48418 | 64 |
val _ = Session.finish (); |
65 |
||
48419 | 66 |
val _ = if save then () else quit (); |
48418 | 67 |
in () end |
68 |
handle exn => (Output.error_msg (ML_Compiler.exn_message exn); exit 1); |
|
69 |
||
70 |
end; |
|
48465 | 71 |
|
72 |
end; |