| author | traytel | 
| Thu, 11 Mar 2021 10:25:04 +0100 | |
| changeset 73408 | be11fe268b33 | 
| parent 73340 | 0ffcad1f6130 | 
| child 73607 | fc13738e1933 | 
| permissions | -rw-r--r-- | 
| 65770 | 1 | /* Title: Pure/Admin/isabelle_devel.scala | 
| 2 | Author: Makarius | |
| 3 | ||
| 4 | Website for Isabelle development resources. | |
| 5 | */ | |
| 6 | ||
| 7 | package isabelle | |
| 8 | ||
| 9 | ||
| 10 | object Isabelle_Devel | |
| 11 | {
 | |
| 65771 | 12 | val RELEASE_SNAPSHOT = "release_snapshot" | 
| 13 | val BUILD_LOG_DB = "build_log.db" | |
| 14 | val BUILD_STATUS = "build_status" | |
| 67854 
8374c80165e1
publish current log file, e.g. for easy error detection;
 wenzelm parents: 
66896diff
changeset | 15 | val CRONJOB_LOG = "cronjob-main.log" | 
| 
8374c80165e1
publish current log file, e.g. for easy error detection;
 wenzelm parents: 
66896diff
changeset | 16 | |
| 71601 | 17 |   val root: Path = Path.explode("~/html-data/devel")
 | 
| 18 | val cronjob_log: Path = root + Path.basic(CRONJOB_LOG) | |
| 65771 | 19 | |
| 20 | ||
| 21 | /* index */ | |
| 22 | ||
| 73340 | 23 | def make_index(): Unit = | 
| 65771 | 24 |   {
 | 
| 71272 
1e7319957408
clarified website: redirect to isabelle-dev Phabricator Overview;
 wenzelm parents: 
70105diff
changeset | 25 | val redirect = "https://isabelle-dev.sketis.net/home/menu/view/20" | 
| 65770 | 26 | |
| 65838 | 27 | HTML.write_document(root, "index.html", | 
| 71272 
1e7319957408
clarified website: redirect to isabelle-dev Phabricator Overview;
 wenzelm parents: 
70105diff
changeset | 28 | List( | 
| 
1e7319957408
clarified website: redirect to isabelle-dev Phabricator Overview;
 wenzelm parents: 
70105diff
changeset | 29 |         XML.Elem(Markup("meta",
 | 
| 
1e7319957408
clarified website: redirect to isabelle-dev Phabricator Overview;
 wenzelm parents: 
70105diff
changeset | 30 |           List("http-equiv" -> "Refresh", "content" -> ("0; url=" + redirect))), Nil)),
 | 
| 
1e7319957408
clarified website: redirect to isabelle-dev Phabricator Overview;
 wenzelm parents: 
70105diff
changeset | 31 |       List(HTML.link(redirect, HTML.text("Isabelle Development Resources"))))
 | 
| 65771 | 32 | } | 
| 65770 | 33 | |
| 34 | ||
| 35 | /* release snapshot */ | |
| 36 | ||
| 37 | def release_snapshot( | |
| 69401 
7a1b7b737c02
eliminated old makedist_bundle and remote_dmg: build_release does everything in Scala;
 wenzelm parents: 
68229diff
changeset | 38 | options: Options, | 
| 65770 | 39 | rev: String = "", | 
| 40 | afp_rev: String = "", | |
| 73340 | 41 | parallel_jobs: Int = 1): Unit = | 
| 65770 | 42 |   {
 | 
| 43 |     Isabelle_System.with_tmp_dir("isadist")(base_dir =>
 | |
| 44 |       {
 | |
| 65793 | 45 | Isabelle_System.update_directory(root + Path.explode(RELEASE_SNAPSHOT), | 
| 46 | website_dir => | |
| 69401 
7a1b7b737c02
eliminated old makedist_bundle and remote_dmg: build_release does everything in Scala;
 wenzelm parents: 
68229diff
changeset | 47 | Build_Release.build_release(base_dir, options, rev = rev, afp_rev = afp_rev, | 
| 70105 | 48 | parallel_jobs = parallel_jobs, | 
| 49 |               build_sessions = List(Isabelle_System.getenv("ISABELLE_LOGIC")),
 | |
| 50 | website = Some(website_dir))) | |
| 65770 | 51 | }) | 
| 52 | } | |
| 53 | ||
| 54 | ||
| 55 | /* maintain build_log database */ | |
| 56 | ||
| 73340 | 57 | def build_log_database(options: Options, log_dirs: List[Path]): Unit = | 
| 65770 | 58 |   {
 | 
| 59 | val store = Build_Log.store(options) | |
| 60 | using(store.open_database())(db => | |
| 61 |     {
 | |
| 66047 
3e8a897042d9
more robust: store important meta info before potential failure;
 wenzelm parents: 
65854diff
changeset | 62 | store.update_database(db, log_dirs) | 
| 65770 | 63 | store.update_database(db, log_dirs, ml_statistics = true) | 
| 65771 | 64 | store.snapshot_database(db, root + Path.explode(BUILD_LOG_DB)) | 
| 65770 | 65 | }) | 
| 66 | } | |
| 65793 | 67 | |
| 68 | ||
| 69 | /* present build status */ | |
| 70 | ||
| 73340 | 71 | def build_status(options: Options): Unit = | 
| 65793 | 72 |   {
 | 
| 73 | Isabelle_System.update_directory(root + Path.explode(BUILD_STATUS), | |
| 65854 | 74 | dir => Build_Status.build_status(options, target_dir = dir, ml_statistics = true)) | 
| 65793 | 75 | } | 
| 65770 | 76 | } |