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 root = Path.explode("~/html-data/devel")
|
|
13 |
|
|
14 |
val RELEASE_SNAPSHOT = "release_snapshot"
|
|
15 |
val BUILD_LOG_DB = "build_log.db"
|
|
16 |
val BUILD_STATUS = "build_status"
|
|
17 |
|
|
18 |
val standard_log_dirs =
|
|
19 |
List(Path.explode("~/log"), Path.explode("~/afp/log"), Path.explode("~/cronjob/log"))
|
|
20 |
|
|
21 |
|
|
22 |
/* index */
|
|
23 |
|
|
24 |
def make_index()
|
|
25 |
{
|
|
26 |
val header = "Isabelle Development Resources"
|
65770
|
27 |
|
65771
|
28 |
Isabelle_System.mkdirs(root)
|
|
29 |
File.write(root + Path.explode("index.html"),
|
|
30 |
HTML.output_document(
|
|
31 |
List(HTML.title(header)),
|
|
32 |
List(HTML.chapter(header),
|
|
33 |
HTML.itemize(
|
|
34 |
List(
|
|
35 |
HTML.text("Isabelle nightly ") :::
|
|
36 |
List(HTML.link(RELEASE_SNAPSHOT, HTML.text("release snapshot"))) :::
|
|
37 |
HTML.text(" (for all platforms)"),
|
65770
|
38 |
|
65771
|
39 |
HTML.text("Isabelle ") :::
|
|
40 |
List(HTML.link(BUILD_STATUS + "/index.html", HTML.text("build status"))) :::
|
|
41 |
HTML.text(" information"),
|
|
42 |
|
|
43 |
HTML.text("Database with recent ") :::
|
|
44 |
List(HTML.link(BUILD_LOG_DB, HTML.text("build log"))) :::
|
|
45 |
HTML.text(" information (e.g. for ") :::
|
|
46 |
List(HTML.link("http://sqlitebrowser.org",
|
|
47 |
List(HTML.code(HTML.text("sqlitebrowser"))))))))))
|
|
48 |
}
|
65770
|
49 |
|
|
50 |
|
|
51 |
/* release snapshot */
|
|
52 |
|
|
53 |
def release_snapshot(
|
|
54 |
rev: String = "",
|
|
55 |
afp_rev: String = "",
|
|
56 |
parallel_jobs: Int = 1,
|
|
57 |
remote_mac: String = "")
|
|
58 |
{
|
|
59 |
Isabelle_System.with_tmp_dir("isadist")(base_dir =>
|
|
60 |
{
|
65771
|
61 |
val release_snapshot_dir = root + Path.explode(RELEASE_SNAPSHOT)
|
|
62 |
|
65770
|
63 |
val new_snapshot = release_snapshot_dir.ext("new")
|
|
64 |
val old_snapshot = release_snapshot_dir.ext("old")
|
|
65 |
|
|
66 |
Isabelle_System.rm_tree(new_snapshot)
|
|
67 |
Isabelle_System.rm_tree(old_snapshot)
|
|
68 |
|
|
69 |
Build_Release.build_release(base_dir, rev = rev, afp_rev = afp_rev,
|
|
70 |
parallel_jobs = parallel_jobs, remote_mac = remote_mac, website = Some(new_snapshot))
|
|
71 |
|
|
72 |
if (release_snapshot_dir.is_dir) File.move(release_snapshot_dir, old_snapshot)
|
|
73 |
File.move(new_snapshot, release_snapshot_dir)
|
|
74 |
Isabelle_System.rm_tree(old_snapshot)
|
|
75 |
})
|
|
76 |
}
|
|
77 |
|
|
78 |
|
|
79 |
/* maintain build_log database */
|
|
80 |
|
65771
|
81 |
def build_log_database(options: Options, log_dirs: List[Path] = standard_log_dirs)
|
65770
|
82 |
{
|
|
83 |
val store = Build_Log.store(options)
|
|
84 |
using(store.open_database())(db =>
|
|
85 |
{
|
|
86 |
store.update_database(db, log_dirs, ml_statistics = true)
|
65771
|
87 |
store.snapshot_database(db, root + Path.explode(BUILD_LOG_DB))
|
65770
|
88 |
})
|
|
89 |
}
|
|
90 |
|
|
91 |
|
|
92 |
/* present build status */
|
|
93 |
|
|
94 |
def build_status(options: Options)
|
|
95 |
{
|
|
96 |
val data = Build_Status.read_data(options)
|
65771
|
97 |
Build_Status.present_data(data, target_dir = root + Path.explode(BUILD_STATUS))
|
65770
|
98 |
}
|
|
99 |
}
|