# HG changeset patch # User wenzelm # Date 1680116203 -7200 # Node ID 4649c7bfd3f0402049e50e6fc149a8354b61ffbe # Parent 5a2a297a91f8f1e8448063d707e55dc4800bf817 provide Isabelle tool wrapper; diff -r 5a2a297a91f8 -r 4649c7bfd3f0 src/Pure/Admin/build_log.scala --- a/src/Pure/Admin/build_log.scala Wed Mar 29 20:41:54 2023 +0200 +++ b/src/Pure/Admin/build_log.scala Wed Mar 29 20:56:43 2023 +0200 @@ -1146,7 +1146,7 @@ } - /* maintain build_log database */ + /** maintain build_log database **/ def build_log_database(options: Options, log_dirs: List[Path], progress: Progress = new Progress, @@ -1186,4 +1186,44 @@ } } } + + + /* Isabelle tool wrapper */ + + val isabelle_tool = Isabelle_Tool("build_log_database", "update build_log database from log files", + Scala_Project.here, + { args => + var ml_statistics: Boolean = false + var snapshot: Option[Path] = None + var dirs: List[Path] = Nil + var options = Options.init() + var verbose = false + + val getopts = Getopts(""" +Usage: isabelle build_log_database [OPTIONS] + + Options are: + -M include ML statistics + -S FILE snapshot to SQLite db file + -d DIR include directory with log files + -o OPTION override Isabelle system OPTION (via NAME=VAL or NAME) + -v verbose + + Update the build_log database server from log files, recursively collected + from given directories. +""", + "M" -> (_ => ml_statistics = true), + "S:" -> (arg => snapshot = Some(Path.explode(arg))), + "d:" -> (arg => dirs = dirs ::: List(Path.explode(arg))), + "o:" -> (arg => options = options + arg), + "v" -> (_ => verbose = true)) + + val more_args = getopts(args) + if (more_args.nonEmpty) getopts.usage() + + val progress = new Console_Progress(verbose = verbose) + + build_log_database(options, dirs, progress = progress, + ml_statistics = ml_statistics, snapshot = snapshot) + }) } diff -r 5a2a297a91f8 -r 4649c7bfd3f0 src/Pure/System/isabelle_tool.scala --- a/src/Pure/System/isabelle_tool.scala Wed Mar 29 20:41:54 2023 +0200 +++ b/src/Pure/System/isabelle_tool.scala Wed Mar 29 20:56:43 2023 +0200 @@ -157,6 +157,7 @@ class Admin_Tools extends Isabelle_Scala_Tools( Build_Doc.isabelle_tool, + Build_Log.isabelle_tool, Build_Status.isabelle_tool, Check_Sources.isabelle_tool, Component_CSDP.isabelle_tool,