clarified modules;
authorwenzelm
Fri Oct 07 11:24:58 2016 +0200 (2016-10-07)
changeset 640802e5c0bd708af
parent 64079 ff26032b7f2a
child 64081 38bb09ed965b
clarified modules;
CI_Profile: show all settings;
src/Pure/Tools/build.scala
src/Pure/Tools/build_log.scala
src/Pure/Tools/ci_profile.scala
     1.1 --- a/src/Pure/Tools/build.scala	Fri Oct 07 11:10:17 2016 +0200
     1.2 +++ b/src/Pure/Tools/build.scala	Fri Oct 07 11:24:58 2016 +0200
     1.3 @@ -686,16 +686,8 @@
     1.4  
     1.5    /* Isabelle tool wrapper */
     1.6  
     1.7 -  val build_settings = List("ISABELLE_BUILD_OPTIONS")
     1.8 -  val ml_settings = List("ML_PLATFORM", "ML_HOME", "ML_SYSTEM", "ML_OPTIONS")
     1.9 -  val all_settings = build_settings ::: ml_settings
    1.10 -
    1.11    val isabelle_tool = Isabelle_Tool("build", "build and manage Isabelle sessions", args =>
    1.12    {
    1.13 -    def show(a: String): String = a + "=" + quote(Isabelle_System.getenv(a))
    1.14 -    def show_settings(): String =
    1.15 -      cat_lines(build_settings.map(show(_)) ::: List("") ::: ml_settings.map(show(_)))
    1.16 -
    1.17      val build_options = Word.explode(Isabelle_System.getenv("ISABELLE_BUILD_OPTIONS"))
    1.18  
    1.19      var select_dirs: List[Path] = Nil
    1.20 @@ -738,7 +730,7 @@
    1.21  
    1.22    Build and manage Isabelle sessions, depending on implicit settings:
    1.23  
    1.24 -""" + Library.prefix_lines("  ", show_settings()),
    1.25 +""" + Library.prefix_lines("  ", Build_Log.Setting.show_all()),
    1.26        "D:" -> (arg => select_dirs = select_dirs ::: List(Path.explode(arg))),
    1.27        "R" -> (_ => requirements = true),
    1.28        "X:" -> (arg => exclude_session_groups = exclude_session_groups ::: List(arg)),
    1.29 @@ -765,7 +757,7 @@
    1.30          Library.trim_line(
    1.31            Isabelle_System.bash(
    1.32              """echo "Started at $(date) ($ML_IDENTIFIER on $(hostname))" """).out) + "\n")
    1.33 -      progress.echo(show_settings() + "\n")
    1.34 +      progress.echo(Build_Log.Setting.show_all() + "\n")
    1.35      }
    1.36  
    1.37      val start_time = Time.now()
     2.1 --- a/src/Pure/Tools/build_log.scala	Fri Oct 07 11:10:17 2016 +0200
     2.2 +++ b/src/Pure/Tools/build_log.scala	Fri Oct 07 11:24:58 2016 +0200
     2.3 @@ -16,6 +16,22 @@
     2.4  
     2.5  object Build_Log
     2.6  {
     2.7 +  /** build settings **/
     2.8 +
     2.9 +  val build_settings = List("ISABELLE_BUILD_OPTIONS")
    2.10 +  val ml_settings = List("ML_PLATFORM", "ML_HOME", "ML_SYSTEM", "ML_OPTIONS")
    2.11 +  val all_settings = build_settings ::: ml_settings
    2.12 +
    2.13 +  object Setting
    2.14 +  {
    2.15 +    def apply(a: String, b: String): String = a + "=" + quote(b)
    2.16 +    def getenv(a: String): String = apply(a, Isabelle_System.getenv(a))
    2.17 +
    2.18 +    def show_all(): String =
    2.19 +      cat_lines(build_settings.map(getenv(_)) ::: List("") ::: ml_settings.map(getenv(_)))
    2.20 +  }
    2.21 +
    2.22 +
    2.23    /** log file **/
    2.24  
    2.25    object Log_File
    2.26 @@ -167,7 +183,7 @@
    2.27                  Field.build_end -> end_date.toString,
    2.28                  Field.isabelle_version -> isabelle_version,
    2.29                  Field.afp_version -> afp_version),
    2.30 -              log_file.get_settings(Build.all_settings))
    2.31 +              log_file.get_settings(all_settings))
    2.32  
    2.33            case _ => log_file.err("cannot detect start/end date in afp-test log")
    2.34          }
    2.35 @@ -213,7 +229,7 @@
    2.36          case i =>
    2.37            val a = s.substring(0, i)
    2.38            Library.try_unquote(s.substring(i + 1)) match {
    2.39 -            case Some(b) if Build.ml_settings.contains(a) => Some((a, b))
    2.40 +            case Some(b) if ml_settings.contains(a) => Some((a, b))
    2.41              case _ => None
    2.42            }
    2.43        }
     3.1 --- a/src/Pure/Tools/ci_profile.scala	Fri Oct 07 11:10:17 2016 +0200
     3.2 +++ b/src/Pure/Tools/ci_profile.scala	Fri Oct 07 11:24:58 2016 +0200
     3.3 @@ -86,7 +86,7 @@
     3.4    override final def apply(args: List[String]): Unit =
     3.5    {
     3.6      print_section("CONFIGURATION")
     3.7 -    Build.ml_settings.foreach(a => println(a + "=" + quote(Isabelle_System.getenv(a))))
     3.8 +    println(Build_Log.Setting.show_all())
     3.9      val props = load_properties()
    3.10      System.getProperties().putAll(props)
    3.11