tuned signature;
authorwenzelm
Tue, 09 May 2017 11:21:42 +0200
changeset 65785 6107504371fb
parent 65784 4763e51ceb78
child 65786 84a0ac8a046e
tuned signature;
src/Pure/Admin/build_status.scala
src/Pure/Admin/isabelle_cronjob.scala
src/Pure/Admin/isabelle_devel.scala
--- a/src/Pure/Admin/build_status.scala	Mon May 08 22:31:54 2017 +0200
+++ b/src/Pure/Admin/build_status.scala	Tue May 09 11:21:42 2017 +0200
@@ -9,8 +9,28 @@
 
 object Build_Status
 {
-  private val default_target_dir = Path.explode("build_status")
-  private val default_image_size = (800, 600)
+  /* build status */
+
+  val default_target_dir = Path.explode("build_status")
+  val default_image_size = (800, 600)
+
+  def default_profiles: List[Profile] =
+    Jenkins.build_status_profiles ::: Isabelle_Cronjob.build_status_profiles
+
+  def build_status(options: Options,
+    progress: Progress = No_Progress,
+    profiles: List[Profile] = default_profiles,
+    only_sessions: Set[String] = Set.empty,
+    verbose: Boolean = false,
+    target_dir: Path = default_target_dir,
+    image_size: (Int, Int) = default_image_size)
+  {
+    val data =
+      read_data(options, progress = progress, profiles = profiles,
+        only_sessions = only_sessions, verbose = verbose)
+
+    present_data(data, progress = progress, target_dir = target_dir, image_size = image_size)
+  }
 
 
   /* data profiles */
@@ -37,9 +57,6 @@
     }
   }
 
-  val standard_profiles: List[Profile] =
-    Jenkins.build_status_profiles ::: Isabelle_Cronjob.build_status_profiles
-
 
   sealed case class Data(date: Date, entries: List[(String, List[Session])])
   sealed case class Session(name: String, threads: Int, entries: List[Entry])
@@ -57,8 +74,8 @@
   /* read data */
 
   def read_data(options: Options,
-    profiles: List[Profile] = standard_profiles,
     progress: Progress = No_Progress,
+    profiles: List[Profile] = default_profiles,
     only_sessions: Set[String] = Set.empty,
     verbose: Boolean = false): Data =
   {
@@ -306,10 +323,8 @@
 
       val progress = new Console_Progress
 
-      val data =
-        read_data(options, progress = progress, only_sessions = only_sessions, verbose = verbose)
-
-      present_data(data, progress = progress, target_dir = target_dir, image_size = image_size)
+      build_status(options, progress = progress, only_sessions = only_sessions, verbose = verbose,
+        target_dir = target_dir, image_size = image_size)
 
   }, admin = true)
 }
--- a/src/Pure/Admin/isabelle_cronjob.scala	Mon May 08 22:31:54 2017 +0200
+++ b/src/Pure/Admin/isabelle_cronjob.scala	Tue May 09 11:21:42 2017 +0200
@@ -354,7 +354,9 @@
             Logger_Task("build_log_database",
               logger => Isabelle_Devel.build_log_database(logger.options)),
             Logger_Task("build_status",
-              logger => Isabelle_Devel.build_status(logger.options)))))))
+              logger =>
+                Build_Status.build_status(logger.options,
+                  target_dir = Isabelle_Devel.build_status_dir)))))))
 
     log_service.shutdown()
 
--- a/src/Pure/Admin/isabelle_devel.scala	Mon May 08 22:31:54 2017 +0200
+++ b/src/Pure/Admin/isabelle_devel.scala	Tue May 09 11:21:42 2017 +0200
@@ -18,6 +18,8 @@
   val standard_log_dirs =
     List(Path.explode("~/log"), Path.explode("~/afp/log"), Path.explode("~/cronjob/log"))
 
+  val build_status_dir = root + Path.explode(BUILD_STATUS)
+
 
   /* index */
 
@@ -87,13 +89,4 @@
       store.snapshot_database(db, root + Path.explode(BUILD_LOG_DB))
     })
   }
-
-
-  /* present build status */
-
-  def build_status(options: Options)
-  {
-    val data = Build_Status.read_data(options)
-    Build_Status.present_data(data, target_dir = root + Path.explode(BUILD_STATUS))
-  }
 }