src/Pure/Tools/build.ML
changeset 67297 86a099f896fc
parent 67219 81e9804b2014
child 67471 bddfa23a4ea9
equal deleted inserted replaced
67296:888aa91f0556 67297:86a099f896fc
   101   | [] => raise Output.Protocol_Message props);
   101   | [] => raise Output.Protocol_Message props);
   102 
   102 
   103 
   103 
   104 (* build theories *)
   104 (* build theories *)
   105 
   105 
   106 fun build_theories symbols last_timing qualifier master_dir (options, thys) =
   106 fun build_theories symbols bibtex_entries last_timing qualifier master_dir (options, thys) =
   107   let
   107   let
   108     val condition = space_explode "," (Options.string options "condition");
   108     val condition = space_explode "," (Options.string options "condition");
   109     val conds = filter_out (can getenv_strict) condition;
   109     val conds = filter_out (can getenv_strict) condition;
   110   in
   110   in
   111     if null conds then
   111     if null conds then
   114         Isabelle_Process.init_options ();
   114         Isabelle_Process.init_options ();
   115         Future.fork I;
   115         Future.fork I;
   116         (Thy_Info.use_theories {
   116         (Thy_Info.use_theories {
   117           document = Present.document_enabled (Options.string options "document"),
   117           document = Present.document_enabled (Options.string options "document"),
   118           symbols = symbols,
   118           symbols = symbols,
       
   119           bibtex_entries = bibtex_entries,
   119           last_timing = last_timing,
   120           last_timing = last_timing,
   120           qualifier = qualifier,
   121           qualifier = qualifier,
   121           master_dir = master_dir}
   122           master_dir = master_dir}
   122         |>
   123         |>
   123           (case Options.string options "profiling" of
   124           (case Options.string options "profiling" of
   149   master_dir: Path.T,
   150   master_dir: Path.T,
   150   theories: (Options.T * (string * Position.T) list) list,
   151   theories: (Options.T * (string * Position.T) list) list,
   151   sessions: string list,
   152   sessions: string list,
   152   global_theories: (string * string) list,
   153   global_theories: (string * string) list,
   153   loaded_theories: string list,
   154   loaded_theories: string list,
   154   known_theories: (string * string) list};
   155   known_theories: (string * string) list,
       
   156   bibtex_entries: string list};
   155 
   157 
   156 fun decode_args yxml =
   158 fun decode_args yxml =
   157   let
   159   let
   158     open XML.Decode;
   160     open XML.Decode;
   159     val position = Position.of_properties o properties;
   161     val position = Position.of_properties o properties;
   160     val (symbol_codes, (command_timings, (do_output, (verbose, (browser_info,
   162     val (symbol_codes, (command_timings, (do_output, (verbose, (browser_info,
   161       (document_files, (graph_file, (parent_name, (chapter, (name, (master_dir,
   163       (document_files, (graph_file, (parent_name, (chapter, (name, (master_dir,
   162       (theories, (sessions, (global_theories, (loaded_theories, known_theories))))))))))))))) =
   164       (theories, (sessions, (global_theories, (loaded_theories,
       
   165       (known_theories, bibtex_entries)))))))))))))))) =
   163       pair (list (pair string int)) (pair (list properties) (pair bool (pair bool (pair string
   166       pair (list (pair string int)) (pair (list properties) (pair bool (pair bool (pair string
   164         (pair (list (pair string string)) (pair string (pair string (pair string (pair string
   167         (pair (list (pair string string)) (pair string (pair string (pair string (pair string
   165           (pair string
   168           (pair string
   166             (pair (((list (pair Options.decode (list (pair string position))))))
   169             (pair (((list (pair Options.decode (list (pair string position))))))
   167               (pair (list string) (pair (list (pair string string))
   170               (pair (list string) (pair (list (pair string string)) (pair (list string)
   168                 (pair (list string) (list (pair string string))))))))))))))))
   171                 (pair (list (pair string string)) (list string))))))))))))))))
   169       (YXML.parse_body yxml);
   172       (YXML.parse_body yxml);
   170   in
   173   in
   171     Args {symbol_codes = symbol_codes, command_timings = command_timings, do_output = do_output,
   174     Args {symbol_codes = symbol_codes, command_timings = command_timings, do_output = do_output,
   172       verbose = verbose, browser_info = Path.explode browser_info,
   175       verbose = verbose, browser_info = Path.explode browser_info,
   173       document_files = map (apply2 Path.explode) document_files,
   176       document_files = map (apply2 Path.explode) document_files,
   174       graph_file = Path.explode graph_file, parent_name = parent_name, chapter = chapter,
   177       graph_file = Path.explode graph_file, parent_name = parent_name, chapter = chapter,
   175       name = name, master_dir = Path.explode master_dir, theories = theories, sessions = sessions,
   178       name = name, master_dir = Path.explode master_dir, theories = theories, sessions = sessions,
   176       global_theories = global_theories, loaded_theories = loaded_theories,
   179       global_theories = global_theories, loaded_theories = loaded_theories,
   177       known_theories = known_theories}
   180       known_theories = known_theories, bibtex_entries = bibtex_entries}
   178   end;
   181   end;
   179 
   182 
   180 fun build_session (Args {symbol_codes, command_timings, do_output, verbose, browser_info,
   183 fun build_session (Args {symbol_codes, command_timings, do_output, verbose, browser_info,
   181     document_files, graph_file, parent_name, chapter, name, master_dir, theories, sessions,
   184     document_files, graph_file, parent_name, chapter, name, master_dir, theories, sessions,
   182     global_theories, loaded_theories, known_theories}) =
   185     global_theories, loaded_theories, known_theories, bibtex_entries}) =
   183   let
   186   let
   184     val symbols = HTML.make_symbols symbol_codes;
   187     val symbols = HTML.make_symbols symbol_codes;
   185 
   188 
   186     val _ =
   189     val _ =
   187       Resources.init_session_base
   190       Resources.init_session_base
   207 
   210 
   208     val last_timing = get_timings (fold update_timings command_timings empty_timings);
   211     val last_timing = get_timings (fold update_timings command_timings empty_timings);
   209 
   212 
   210     val res1 =
   213     val res1 =
   211       theories |>
   214       theories |>
   212         (List.app (build_theories symbols last_timing name master_dir)
   215         (List.app (build_theories symbols bibtex_entries last_timing name master_dir)
   213           |> session_timing name verbose
   216           |> session_timing name verbose
   214           |> Exn.capture);
   217           |> Exn.capture);
   215     val res2 = Exn.capture Session.finish ();
   218     val res2 = Exn.capture Session.finish ();
   216 
   219 
   217     val _ = Resources.finish_session_base ();
   220     val _ = Resources.finish_session_base ();