author | wenzelm |
Mon, 22 Oct 2018 11:55:39 +0200 | |
changeset 69177 | 300046d2ec60 |
parent 69176 | 63391630495f |
child 69178 | 242d4eb3407f |
permissions | -rw-r--r-- |
64202 | 1 |
/* Title: Pure/Admin/build_release.scala |
2 |
Author: Makarius |
|
3 |
||
4 |
Build full Isabelle distribution from repository. |
|
5 |
*/ |
|
6 |
||
7 |
package isabelle |
|
8 |
||
9 |
||
10 |
object Build_Release |
|
11 |
{ |
|
69174 | 12 |
/** release info **/ |
13 |
||
14 |
sealed case class Bundle_Info( |
|
15 |
platform_family: String, |
|
16 |
platform_description: String, |
|
17 |
main: String, |
|
18 |
fallback: Option[String]) |
|
19 |
{ |
|
20 |
def names: List[String] = main :: fallback.toList |
|
21 |
} |
|
22 |
||
23 |
class Release private[Build_Release]( |
|
24 |
val date: Date, |
|
25 |
val dist_name: String, |
|
26 |
val dist_dir: Path, |
|
27 |
val dist_version: String, |
|
28 |
val ident: String) |
|
29 |
{ |
|
30 |
val isabelle_dir: Path = dist_dir + Path.explode(dist_name) |
|
31 |
val isabelle_archive: Path = dist_dir + Path.explode(dist_name + ".tar.gz") |
|
32 |
val isabelle_library_archive: Path = dist_dir + Path.explode(dist_name + "_library.tar.gz") |
|
33 |
||
34 |
val other_isabelle_identifier: String = dist_name + "-build" |
|
35 |
||
69177 | 36 |
def bundle_info(platform_family: String): Bundle_Info = |
37 |
platform_family match { |
|
38 |
case "linux" => Bundle_Info("linux", "Linux", dist_name + "_app.tar.gz", None) |
|
39 |
case "windows" => Bundle_Info("windows", "Windows", dist_name + ".exe", None) |
|
40 |
case "macos" => |
|
41 |
Bundle_Info("macos", "Mac OS X", dist_name + ".dmg", Some(dist_name + "_dmg.tar.gz")) |
|
42 |
case _ => error("Unknown platform family " + quote(platform_family)) |
|
43 |
} |
|
69174 | 44 |
} |
45 |
||
46 |
||
47 |
||
69168
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
48 |
/** generated content **/ |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
49 |
|
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
50 |
/* patch release */ |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
51 |
|
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
52 |
private def change_file(dir: Path, name: String, f: String => String) |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
53 |
{ |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
54 |
val file = dir + Path.explode(name) |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
55 |
File.write(file, f(File.read(file))) |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
56 |
} |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
57 |
|
69171
710845a85944
more robust release.read_ident: eliminated odd state files ISABELLE_IDENT, ISABELLE_DIST;
wenzelm
parents:
69170
diff
changeset
|
58 |
private val getsettings_file: String = "lib/scripts/getsettings" |
710845a85944
more robust release.read_ident: eliminated odd state files ISABELLE_IDENT, ISABELLE_DIST;
wenzelm
parents:
69170
diff
changeset
|
59 |
|
710845a85944
more robust release.read_ident: eliminated odd state files ISABELLE_IDENT, ISABELLE_DIST;
wenzelm
parents:
69170
diff
changeset
|
60 |
private val ISABELLE_ID = """ISABELLE_ID="(.+)"""".r |
710845a85944
more robust release.read_ident: eliminated odd state files ISABELLE_IDENT, ISABELLE_DIST;
wenzelm
parents:
69170
diff
changeset
|
61 |
|
69174 | 62 |
def patch_release(release: Release, is_official: Boolean) |
69168
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
63 |
{ |
69174 | 64 |
val dir = release.isabelle_dir |
65 |
||
69168
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
66 |
for (name <- List("src/Pure/System/distribution.ML", "src/Pure/System/distribution.scala")) |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
67 |
{ |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
68 |
change_file(dir, name, |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
69 |
s => |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
70 |
s.replaceAll("val is_identified = false", "val is_identified = true") |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
71 |
.replaceAll("val is_official = false", "val is_official = " + is_official)) |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
72 |
} |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
73 |
|
69171
710845a85944
more robust release.read_ident: eliminated odd state files ISABELLE_IDENT, ISABELLE_DIST;
wenzelm
parents:
69170
diff
changeset
|
74 |
change_file(dir, getsettings_file, |
69168
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
75 |
s => |
69174 | 76 |
s.replaceAll("ISABELLE_ID=\"\"", "ISABELLE_ID=" + quote(release.ident)) |
77 |
.replaceAll("ISABELLE_IDENTIFIER=\"\"", "ISABELLE_IDENTIFIER=" + quote(release.dist_name))) |
|
69168
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
78 |
|
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
79 |
change_file(dir, "lib/html/library_index_header.template", |
69174 | 80 |
s => s.replaceAll("""\{ISABELLE\}""", release.dist_name)) |
69168
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
81 |
|
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
82 |
for { |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
83 |
name <- |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
84 |
List( |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
85 |
"src/Pure/System/distribution.ML", |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
86 |
"src/Pure/System/distribution.scala", |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
87 |
"lib/Tools/version") } |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
88 |
{ |
69174 | 89 |
change_file(dir, name, s => s.replaceAll("repository version", release.dist_version)) |
69168
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
90 |
} |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
91 |
|
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
92 |
change_file(dir, "README", |
69174 | 93 |
s => s.replaceAll("some repository version of Isabelle", release.dist_version)) |
69168
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
94 |
} |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
95 |
|
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
96 |
|
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
97 |
/* ANNOUNCE */ |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
98 |
|
69174 | 99 |
def make_announce(release: Release) |
69168
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
100 |
{ |
69174 | 101 |
File.write(release.isabelle_dir + Path.explode("ANNOUNCE"), |
69168
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
102 |
""" |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
103 |
IMPORTANT NOTE |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
104 |
============== |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
105 |
|
69174 | 106 |
This is a snapshot of Isabelle/""" + release.ident + """ from the repository. |
69168
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
107 |
|
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
108 |
""") |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
109 |
} |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
110 |
|
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
111 |
|
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
112 |
/* NEWS */ |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
113 |
|
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
114 |
def make_news(other_isabelle: Other_Isabelle, dist_version: String) |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
115 |
{ |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
116 |
val target = other_isabelle.isabelle_home + Path.explode("doc") |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
117 |
val target_fonts = target + Path.explode("fonts") |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
118 |
Isabelle_System.mkdirs(target_fonts) |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
119 |
|
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
120 |
for (font <- other_isabelle.fonts(html = true)) |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
121 |
File.copy(font, target_fonts) |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
122 |
|
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
123 |
HTML.write_document(target, "NEWS.html", |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
124 |
List(HTML.title("NEWS (" + dist_version + ")")), |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
125 |
List( |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
126 |
HTML.chapter("NEWS"), |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
127 |
HTML.source( |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
128 |
Symbol.decode(File.read(other_isabelle.isabelle_home + Path.explode("NEWS")))))) |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
129 |
} |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
130 |
|
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
131 |
|
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
132 |
/* contrib */ |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
133 |
|
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
134 |
def make_contrib(dir: Path) |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
135 |
{ |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
136 |
Isabelle_System.mkdirs(dir + Path.explode("contrib")) |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
137 |
File.write(dir + Path.explode("contrib/README"), |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
138 |
"""This directory contains add-on components that contribute to the main |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
139 |
Isabelle distribution. Separate licensing conditions apply, see each |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
140 |
directory individually. |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
141 |
""") |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
142 |
} |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
143 |
|
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
144 |
|
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
145 |
|
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
146 |
/** build_release **/ |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
147 |
|
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
148 |
private def execute(dir: Path, script: String): Unit = |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
149 |
Isabelle_System.bash(script, cwd = dir.file).check |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
150 |
|
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
151 |
private def execute_tar(dir: Path, args: String): Unit = |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
152 |
Isabelle_System.gnutar(args, cwd = dir.file).check |
64203 | 153 |
|
69170 | 154 |
private def tar_options: String = |
155 |
if (Platform.is_macos) "--owner=root --group=staff" else "--owner=root --group=root" |
|
156 |
||
66724 | 157 |
private val default_platform_families = List("linux", "windows", "macos") |
64204 | 158 |
|
64202 | 159 |
def build_release(base_dir: Path, |
64909 | 160 |
progress: Progress = No_Progress, |
64202 | 161 |
rev: String = "", |
64405
81bac77929d9
just one task to identify Isabelle + AFP repository snapshots and build release;
wenzelm
parents:
64371
diff
changeset
|
162 |
afp_rev: String = "", |
64202 | 163 |
official_release: Boolean = false, |
69168
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
164 |
proper_release_name: Option[String] = None, |
64208 | 165 |
platform_families: List[String] = default_platform_families, |
64211 | 166 |
website: Option[Path] = None, |
64202 | 167 |
build_library: Boolean = false, |
168 |
parallel_jobs: Int = 1, |
|
69167 | 169 |
remote_mac: String = ""): Release = |
64202 | 170 |
{ |
69174 | 171 |
val hg = Mercurial.repository(Path.explode("$ISABELLE_HOME")) |
172 |
||
69167 | 173 |
val release = |
64203 | 174 |
{ |
69171
710845a85944
more robust release.read_ident: eliminated odd state files ISABELLE_IDENT, ISABELLE_DIST;
wenzelm
parents:
69170
diff
changeset
|
175 |
val date = Date.now() |
710845a85944
more robust release.read_ident: eliminated odd state files ISABELLE_IDENT, ISABELLE_DIST;
wenzelm
parents:
69170
diff
changeset
|
176 |
val dist_name = proper_release_name getOrElse ("Isabelle_" + Date.Format.date(date)) |
710845a85944
more robust release.read_ident: eliminated odd state files ISABELLE_IDENT, ISABELLE_DIST;
wenzelm
parents:
69170
diff
changeset
|
177 |
val dist_dir = (base_dir + Path.explode("dist-" + dist_name)).absolute |
69174 | 178 |
|
179 |
val version = proper_release_name orElse proper_string(rev) getOrElse "tip" |
|
180 |
val ident = |
|
181 |
try { hg.id(version) } |
|
69176 | 182 |
catch { case ERROR(_) => error("Bad repository version: " + version) } |
69174 | 183 |
|
184 |
val dist_version = |
|
185 |
proper_release_name match { |
|
186 |
case Some(name) => name + ": " + Date.Format("LLLL uuuu")(date) |
|
187 |
case None => "Isabelle repository snapshot " + ident + " " + Date.Format.date(date) |
|
188 |
} |
|
189 |
||
190 |
new Release(date, dist_name, dist_dir, dist_version, ident) |
|
69171
710845a85944
more robust release.read_ident: eliminated odd state files ISABELLE_IDENT, ISABELLE_DIST;
wenzelm
parents:
69170
diff
changeset
|
191 |
} |
710845a85944
more robust release.read_ident: eliminated odd state files ISABELLE_IDENT, ISABELLE_DIST;
wenzelm
parents:
69170
diff
changeset
|
192 |
|
710845a85944
more robust release.read_ident: eliminated odd state files ISABELLE_IDENT, ISABELLE_DIST;
wenzelm
parents:
69170
diff
changeset
|
193 |
|
710845a85944
more robust release.read_ident: eliminated odd state files ISABELLE_IDENT, ISABELLE_DIST;
wenzelm
parents:
69170
diff
changeset
|
194 |
/* make distribution */ |
64202 | 195 |
|
69171
710845a85944
more robust release.read_ident: eliminated odd state files ISABELLE_IDENT, ISABELLE_DIST;
wenzelm
parents:
69170
diff
changeset
|
196 |
if (release.isabelle_archive.is_file) { |
710845a85944
more robust release.read_ident: eliminated odd state files ISABELLE_IDENT, ISABELLE_DIST;
wenzelm
parents:
69170
diff
changeset
|
197 |
progress.echo("### Release archive already exists: " + release.isabelle_archive.implode) |
69175 | 198 |
|
199 |
val archive_ident = |
|
200 |
Isabelle_System.with_tmp_dir("build_release")(tmp_dir => |
|
201 |
{ |
|
202 |
val getsettings = Path.explode(release.dist_name + "/" + getsettings_file) |
|
203 |
execute_tar(tmp_dir, "-xzf " + |
|
204 |
File.bash_path(release.isabelle_archive) + " " + File.bash_path(getsettings)) |
|
205 |
split_lines(File.read(tmp_dir + getsettings)) |
|
206 |
.collectFirst({ case ISABELLE_ID(ident) => ident }) |
|
207 |
.getOrElse(error("Failed to read ISABELLE_ID from " + release.isabelle_archive)) |
|
208 |
}) |
|
209 |
||
210 |
if (release.ident != archive_ident) { |
|
211 |
error("Mismatch of release identification " + release.ident + |
|
212 |
" vs. archive " + archive_ident) |
|
213 |
} |
|
69171
710845a85944
more robust release.read_ident: eliminated odd state files ISABELLE_IDENT, ISABELLE_DIST;
wenzelm
parents:
69170
diff
changeset
|
214 |
} |
710845a85944
more robust release.read_ident: eliminated odd state files ISABELLE_IDENT, ISABELLE_DIST;
wenzelm
parents:
69170
diff
changeset
|
215 |
else { |
710845a85944
more robust release.read_ident: eliminated odd state files ISABELLE_IDENT, ISABELLE_DIST;
wenzelm
parents:
69170
diff
changeset
|
216 |
progress.echo("### Producing release archive " + release.isabelle_archive.implode + " ...") |
710845a85944
more robust release.read_ident: eliminated odd state files ISABELLE_IDENT, ISABELLE_DIST;
wenzelm
parents:
69170
diff
changeset
|
217 |
|
710845a85944
more robust release.read_ident: eliminated odd state files ISABELLE_IDENT, ISABELLE_DIST;
wenzelm
parents:
69170
diff
changeset
|
218 |
Isabelle_System.mkdirs(release.dist_dir) |
64221 | 219 |
|
69171
710845a85944
more robust release.read_ident: eliminated odd state files ISABELLE_IDENT, ISABELLE_DIST;
wenzelm
parents:
69170
diff
changeset
|
220 |
if (release.isabelle_dir.is_dir) |
710845a85944
more robust release.read_ident: eliminated odd state files ISABELLE_IDENT, ISABELLE_DIST;
wenzelm
parents:
69170
diff
changeset
|
221 |
error("Directory " + release.isabelle_dir + " already exists") |
710845a85944
more robust release.read_ident: eliminated odd state files ISABELLE_IDENT, ISABELLE_DIST;
wenzelm
parents:
69170
diff
changeset
|
222 |
|
710845a85944
more robust release.read_ident: eliminated odd state files ISABELLE_IDENT, ISABELLE_DIST;
wenzelm
parents:
69170
diff
changeset
|
223 |
|
69176 | 224 |
progress.echo("### Retrieving Mercurial repository version " + release.ident) |
69168
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
225 |
|
69174 | 226 |
hg.archive(release.isabelle_dir.expand.implode, rev = release.ident, options = "--type files") |
69168
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
227 |
|
69171
710845a85944
more robust release.read_ident: eliminated odd state files ISABELLE_IDENT, ISABELLE_DIST;
wenzelm
parents:
69170
diff
changeset
|
228 |
for (name <- List(".hg_archival.txt", ".hgtags", ".hgignore", "README_REPOSITORY")) { |
710845a85944
more robust release.read_ident: eliminated odd state files ISABELLE_IDENT, ISABELLE_DIST;
wenzelm
parents:
69170
diff
changeset
|
229 |
(release.isabelle_dir + Path.explode(name)).file.delete |
710845a85944
more robust release.read_ident: eliminated odd state files ISABELLE_IDENT, ISABELLE_DIST;
wenzelm
parents:
69170
diff
changeset
|
230 |
} |
69168
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
231 |
|
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
232 |
|
69171
710845a85944
more robust release.read_ident: eliminated odd state files ISABELLE_IDENT, ISABELLE_DIST;
wenzelm
parents:
69170
diff
changeset
|
233 |
progress.echo("### Preparing distribution " + quote(release.dist_name)) |
69168
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
234 |
|
69174 | 235 |
patch_release(release, proper_release_name.isDefined && official_release) |
69168
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
236 |
|
69174 | 237 |
if (proper_release_name.isEmpty) make_announce(release) |
69168
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
238 |
|
69171
710845a85944
more robust release.read_ident: eliminated odd state files ISABELLE_IDENT, ISABELLE_DIST;
wenzelm
parents:
69170
diff
changeset
|
239 |
make_contrib(release.isabelle_dir) |
69168
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
240 |
|
69171
710845a85944
more robust release.read_ident: eliminated odd state files ISABELLE_IDENT, ISABELLE_DIST;
wenzelm
parents:
69170
diff
changeset
|
241 |
execute(release.isabelle_dir, """find . -print | xargs chmod -f u+rw""") |
69168
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
242 |
|
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
243 |
|
69171
710845a85944
more robust release.read_ident: eliminated odd state files ISABELLE_IDENT, ISABELLE_DIST;
wenzelm
parents:
69170
diff
changeset
|
244 |
/* build tools and documentation */ |
69168
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
245 |
|
69171
710845a85944
more robust release.read_ident: eliminated odd state files ISABELLE_IDENT, ISABELLE_DIST;
wenzelm
parents:
69170
diff
changeset
|
246 |
val other_isabelle = |
710845a85944
more robust release.read_ident: eliminated odd state files ISABELLE_IDENT, ISABELLE_DIST;
wenzelm
parents:
69170
diff
changeset
|
247 |
Other_Isabelle(release.isabelle_dir, |
710845a85944
more robust release.read_ident: eliminated odd state files ISABELLE_IDENT, ISABELLE_DIST;
wenzelm
parents:
69170
diff
changeset
|
248 |
isabelle_identifier = release.other_isabelle_identifier, |
710845a85944
more robust release.read_ident: eliminated odd state files ISABELLE_IDENT, ISABELLE_DIST;
wenzelm
parents:
69170
diff
changeset
|
249 |
progress = progress) |
69168
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
250 |
|
69171
710845a85944
more robust release.read_ident: eliminated odd state files ISABELLE_IDENT, ISABELLE_DIST;
wenzelm
parents:
69170
diff
changeset
|
251 |
other_isabelle.init_settings( |
710845a85944
more robust release.read_ident: eliminated odd state files ISABELLE_IDENT, ISABELLE_DIST;
wenzelm
parents:
69170
diff
changeset
|
252 |
(base_dir.absolute + Path.explode("contrib")).implode, nonfree = false, Nil) |
710845a85944
more robust release.read_ident: eliminated odd state files ISABELLE_IDENT, ISABELLE_DIST;
wenzelm
parents:
69170
diff
changeset
|
253 |
other_isabelle.resolve_components(echo = true) |
69168
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
254 |
|
69171
710845a85944
more robust release.read_ident: eliminated odd state files ISABELLE_IDENT, ISABELLE_DIST;
wenzelm
parents:
69170
diff
changeset
|
255 |
try { |
710845a85944
more robust release.read_ident: eliminated odd state files ISABELLE_IDENT, ISABELLE_DIST;
wenzelm
parents:
69170
diff
changeset
|
256 |
val export_classpath = |
710845a85944
more robust release.read_ident: eliminated odd state files ISABELLE_IDENT, ISABELLE_DIST;
wenzelm
parents:
69170
diff
changeset
|
257 |
"export CLASSPATH=" + Bash.string(other_isabelle.getenv("ISABELLE_CLASSPATH")) + "\n" |
710845a85944
more robust release.read_ident: eliminated odd state files ISABELLE_IDENT, ISABELLE_DIST;
wenzelm
parents:
69170
diff
changeset
|
258 |
other_isabelle.bash(export_classpath + "./Admin/build all", echo = true).check |
710845a85944
more robust release.read_ident: eliminated odd state files ISABELLE_IDENT, ISABELLE_DIST;
wenzelm
parents:
69170
diff
changeset
|
259 |
other_isabelle.bash(export_classpath + "./bin/isabelle jedit -b", echo = true).check |
710845a85944
more robust release.read_ident: eliminated odd state files ISABELLE_IDENT, ISABELLE_DIST;
wenzelm
parents:
69170
diff
changeset
|
260 |
} |
710845a85944
more robust release.read_ident: eliminated odd state files ISABELLE_IDENT, ISABELLE_DIST;
wenzelm
parents:
69170
diff
changeset
|
261 |
catch { case ERROR(_) => error("Failed to build tools") } |
69168
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
262 |
|
69171
710845a85944
more robust release.read_ident: eliminated odd state files ISABELLE_IDENT, ISABELLE_DIST;
wenzelm
parents:
69170
diff
changeset
|
263 |
try { |
710845a85944
more robust release.read_ident: eliminated odd state files ISABELLE_IDENT, ISABELLE_DIST;
wenzelm
parents:
69170
diff
changeset
|
264 |
other_isabelle.bash( |
710845a85944
more robust release.read_ident: eliminated odd state files ISABELLE_IDENT, ISABELLE_DIST;
wenzelm
parents:
69170
diff
changeset
|
265 |
"./bin/isabelle build_doc -a -s -j " + parallel_jobs, echo = true).check |
710845a85944
more robust release.read_ident: eliminated odd state files ISABELLE_IDENT, ISABELLE_DIST;
wenzelm
parents:
69170
diff
changeset
|
266 |
} |
710845a85944
more robust release.read_ident: eliminated odd state files ISABELLE_IDENT, ISABELLE_DIST;
wenzelm
parents:
69170
diff
changeset
|
267 |
catch { case ERROR(_) => error("Failed to build documentation") } |
69168
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
268 |
|
69174 | 269 |
make_news(other_isabelle, release.dist_version) |
69168
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
270 |
|
69171
710845a85944
more robust release.read_ident: eliminated odd state files ISABELLE_IDENT, ISABELLE_DIST;
wenzelm
parents:
69170
diff
changeset
|
271 |
for (name <- List("Admin", "browser_info", "heaps")) { |
710845a85944
more robust release.read_ident: eliminated odd state files ISABELLE_IDENT, ISABELLE_DIST;
wenzelm
parents:
69170
diff
changeset
|
272 |
Isabelle_System.rm_tree(other_isabelle.isabelle_home + Path.explode(name)) |
710845a85944
more robust release.read_ident: eliminated odd state files ISABELLE_IDENT, ISABELLE_DIST;
wenzelm
parents:
69170
diff
changeset
|
273 |
} |
69168
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
274 |
|
69171
710845a85944
more robust release.read_ident: eliminated odd state files ISABELLE_IDENT, ISABELLE_DIST;
wenzelm
parents:
69170
diff
changeset
|
275 |
other_isabelle.cleanup() |
69168
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
276 |
|
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
277 |
|
69171
710845a85944
more robust release.read_ident: eliminated odd state files ISABELLE_IDENT, ISABELLE_DIST;
wenzelm
parents:
69170
diff
changeset
|
278 |
progress.echo("### Creating distribution archive " + release.isabelle_archive) |
69168
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
279 |
|
69174 | 280 |
def execute_dist_name(script: String): Unit = |
281 |
Isabelle_System.bash(script, cwd = release.dist_dir.file, |
|
282 |
env = Isabelle_System.settings() + ("DIST_NAME" -> release.dist_name)).check |
|
283 |
||
284 |
execute_dist_name(""" |
|
69168
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
285 |
set -e |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
286 |
|
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
287 |
chmod -R a+r "$DIST_NAME" |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
288 |
chmod -R u+w "$DIST_NAME" |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
289 |
chmod -R g=o "$DIST_NAME" |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
290 |
find "$DIST_NAME" -type f "(" -name "*.thy" -o -name "*.ML" -o -name "*.scala" ")" -print | xargs chmod -f u-w |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
291 |
""") |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
292 |
|
69171
710845a85944
more robust release.read_ident: eliminated odd state files ISABELLE_IDENT, ISABELLE_DIST;
wenzelm
parents:
69170
diff
changeset
|
293 |
execute_tar(release.dist_dir, tar_options + " -czf " + |
710845a85944
more robust release.read_ident: eliminated odd state files ISABELLE_IDENT, ISABELLE_DIST;
wenzelm
parents:
69170
diff
changeset
|
294 |
File.bash_path(release.isabelle_archive) + " " + Bash.string(release.dist_name)) |
69168
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
295 |
|
69174 | 296 |
execute_dist_name(""" |
69168
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
297 |
set -e |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
298 |
|
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
299 |
mv "$DIST_NAME" "${DIST_NAME}-old" |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
300 |
mkdir "$DIST_NAME" |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
301 |
|
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
302 |
mv "${DIST_NAME}-old/README" "${DIST_NAME}-old/NEWS" "${DIST_NAME}-old/ANNOUNCE" \ |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
303 |
"${DIST_NAME}-old/COPYRIGHT" "${DIST_NAME}-old/CONTRIBUTORS" "$DIST_NAME" |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
304 |
mkdir "$DIST_NAME/doc" |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
305 |
mv "${DIST_NAME}-old/doc/"*.pdf \ |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
306 |
"${DIST_NAME}-old/doc/"*.html \ |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
307 |
"${DIST_NAME}-old/doc/"*.css \ |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
308 |
"${DIST_NAME}-old/doc/fonts" \ |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
309 |
"${DIST_NAME}-old/doc/Contents" "$DIST_NAME/doc" |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
310 |
|
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
311 |
rm -f Isabelle && ln -sf "$DIST_NAME" Isabelle |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
312 |
|
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
313 |
rm -rf "${DIST_NAME}-old" |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
314 |
""") |
64203 | 315 |
} |
64202 | 316 |
|
317 |
||
318 |
/* make application bundles */ |
|
319 |
||
69177 | 320 |
val bundle_infos = platform_families.map(release.bundle_info) |
69168
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
321 |
|
66730 | 322 |
for (bundle_info <- bundle_infos) { |
64361 | 323 |
val bundle = |
66730 | 324 |
(if (remote_mac.isEmpty) bundle_info.fallback else None) getOrElse bundle_info.main |
69167 | 325 |
val bundle_archive = release.dist_dir + Path.explode(bundle) |
64203 | 326 |
if (bundle_archive.is_file) |
64209 | 327 |
progress.echo("### Application bundle already exists: " + bundle_archive.implode) |
64203 | 328 |
else { |
64361 | 329 |
progress.echo( |
66730 | 330 |
"\nApplication bundle for " + bundle_info.platform_family + ": " + bundle_archive.implode) |
64203 | 331 |
progress.bash( |
69168
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
332 |
"isabelle makedist_bundle " + File.bash_path(release.isabelle_archive) + |
66730 | 333 |
" " + Bash.string(bundle_info.platform_family) + |
64304 | 334 |
(if (remote_mac == "") "" else " " + Bash.string(remote_mac)), |
64203 | 335 |
echo = true).check |
336 |
} |
|
64202 | 337 |
} |
338 |
||
339 |
||
340 |
/* minimal website */ |
|
341 |
||
64361 | 342 |
for (dir <- website) { |
343 |
val website_platform_bundles = |
|
344 |
for { |
|
66730 | 345 |
bundle_info <- bundle_infos |
69168
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
346 |
bundle <- bundle_info.names.find(name => (release.dist_dir + Path.explode(name)).is_file) |
66730 | 347 |
} yield (bundle, bundle_info) |
64206 | 348 |
|
64405
81bac77929d9
just one task to identify Isabelle + AFP repository snapshots and build release;
wenzelm
parents:
64371
diff
changeset
|
349 |
val afp_link = |
66854 | 350 |
HTML.link(AFP.repos_source + "/commits/" + afp_rev, HTML.text("AFP/" + afp_rev)) |
64405
81bac77929d9
just one task to identify Isabelle + AFP repository snapshots and build release;
wenzelm
parents:
64371
diff
changeset
|
351 |
|
65838 | 352 |
HTML.write_document(dir, "index.html", |
69168
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
353 |
List(HTML.title(release.dist_name)), |
65838 | 354 |
List( |
69175 | 355 |
HTML.chapter(release.dist_name + " (" + release.ident + ")"), |
65838 | 356 |
HTML.itemize( |
66730 | 357 |
website_platform_bundles.map({ case (bundle, bundle_info) => |
358 |
List(HTML.link(bundle, HTML.text(bundle_info.platform_description))) }))) ::: |
|
65838 | 359 |
(if (afp_rev == "") Nil else List(HTML.par(HTML.text("See also ") ::: List(afp_link))))) |
64202 | 360 |
|
64361 | 361 |
for ((bundle, _) <- website_platform_bundles) |
69167 | 362 |
File.copy(release.dist_dir + Path.explode(bundle), dir) |
64361 | 363 |
} |
64202 | 364 |
|
365 |
||
366 |
/* HTML library */ |
|
367 |
||
64203 | 368 |
if (build_library) { |
69168
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
369 |
if (release.isabelle_library_archive.is_file) { |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
370 |
progress.echo( |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
371 |
"### Library archive already exists: " + release.isabelle_library_archive.implode) |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
372 |
} |
64203 | 373 |
else { |
64316 | 374 |
Isabelle_System.with_tmp_dir("build_release")(tmp_dir => |
375 |
{ |
|
69168
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
376 |
val name = release.dist_name |
64316 | 377 |
val platform = Isabelle_System.getenv_strict("ISABELLE_PLATFORM_FAMILY") |
69167 | 378 |
val bundle = release.dist_dir + Path.explode(name + "_" + platform + ".tar.gz") |
69168
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
379 |
execute_tar(tmp_dir, "-xzf " + File.bash_path(bundle)) |
64316 | 380 |
|
381 |
val other_isabelle = |
|
67045 | 382 |
Other_Isabelle(tmp_dir + Path.explode(name), |
69168
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
383 |
isabelle_identifier = release.other_isabelle_identifier, progress = progress) |
64316 | 384 |
|
68755
67d6f1708ea4
enforce ML_system_64: more robust as cold build, without command_timings;
wenzelm
parents:
67045
diff
changeset
|
385 |
Isabelle_System.mkdirs(other_isabelle.etc) |
67d6f1708ea4
enforce ML_system_64: more robust as cold build, without command_timings;
wenzelm
parents:
67045
diff
changeset
|
386 |
File.write(other_isabelle.etc_preferences, "ML_system_64 = true\n") |
67d6f1708ea4
enforce ML_system_64: more robust as cold build, without command_timings;
wenzelm
parents:
67045
diff
changeset
|
387 |
|
69168
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
388 |
other_isabelle.bash("bin/isabelle build -j " + parallel_jobs + |
64316 | 389 |
" -o browser_info -o document=pdf -o document_variants=document:outline=/proof,/ML" + |
390 |
" -s -c -a -d '~~/src/Benchmarks'", echo = true).check |
|
391 |
other_isabelle.isabelle_home_user.file.delete |
|
392 |
||
69168
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
393 |
execute(tmp_dir, "chmod -R a+r " + Bash.string(name)) |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
394 |
execute(tmp_dir, "chmod -R g=o " + Bash.string(name)) |
69170 | 395 |
execute_tar(tmp_dir, |
396 |
tar_options + " -czf " + File.bash_path(release.isabelle_library_archive) + |
|
64316 | 397 |
" " + Bash.string(name + "/browser_info")) |
398 |
}) |
|
64203 | 399 |
} |
400 |
} |
|
401 |
||
69168
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
402 |
release |
64202 | 403 |
} |
404 |
||
405 |
||
406 |
||
407 |
/** command line entry point **/ |
|
408 |
||
409 |
def main(args: Array[String]) |
|
410 |
{ |
|
411 |
Command_Line.tool0 { |
|
64405
81bac77929d9
just one task to identify Isabelle + AFP repository snapshots and build release;
wenzelm
parents:
64371
diff
changeset
|
412 |
var afp_rev = "" |
64202 | 413 |
var remote_mac = "" |
414 |
var official_release = false |
|
69168
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
415 |
var proper_release_name: Option[String] = None |
64211 | 416 |
var website: Option[Path] = None |
64202 | 417 |
var parallel_jobs = 1 |
418 |
var build_library = false |
|
64208 | 419 |
var platform_families = default_platform_families |
64202 | 420 |
var rev = "" |
421 |
||
422 |
val getopts = Getopts(""" |
|
423 |
Usage: Admin/build_release [OPTIONS] BASE_DIR |
|
424 |
||
425 |
Options are: |
|
64405
81bac77929d9
just one task to identify Isabelle + AFP repository snapshots and build release;
wenzelm
parents:
64371
diff
changeset
|
426 |
-A REV corresponding AFP changeset id |
64202 | 427 |
-M USER@HOST remote Mac OS X for dmg build |
428 |
-O official release (not release-candidate) |
|
429 |
-R RELEASE proper release with name |
|
64211 | 430 |
-W WEBSITE produce minimal website in given directory |
64202 | 431 |
-j INT maximum number of parallel jobs (default 1) |
432 |
-l build library |
|
65067 | 433 |
-p NAMES platform families (default: """ + default_platform_families.mkString(",") + """) |
64202 | 434 |
-r REV Mercurial changeset id (default: RELEASE or tip) |
435 |
||
436 |
Build Isabelle release in base directory, using the local repository clone. |
|
437 |
""", |
|
64405
81bac77929d9
just one task to identify Isabelle + AFP repository snapshots and build release;
wenzelm
parents:
64371
diff
changeset
|
438 |
"A:" -> (arg => afp_rev = arg), |
64202 | 439 |
"M:" -> (arg => remote_mac = arg), |
440 |
"O" -> (_ => official_release = true), |
|
69168
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
441 |
"R:" -> (arg => proper_release_name = Some(arg)), |
64211 | 442 |
"W:" -> (arg => website = Some(Path.explode(arg))), |
64202 | 443 |
"j:" -> (arg => parallel_jobs = Value.Int.parse(arg)), |
64316 | 444 |
"l" -> (_ => build_library = true), |
66923 | 445 |
"p:" -> (arg => platform_families = space_explode(',', arg)), |
64204 | 446 |
"r:" -> (arg => rev = arg)) |
64202 | 447 |
|
448 |
val more_args = getopts(args) |
|
449 |
val base_dir = more_args match { case List(base_dir) => base_dir case _ => getopts.usage() } |
|
450 |
||
451 |
val progress = new Console_Progress() |
|
452 |
||
64405
81bac77929d9
just one task to identify Isabelle + AFP repository snapshots and build release;
wenzelm
parents:
64371
diff
changeset
|
453 |
build_release(Path.explode(base_dir), progress = progress, rev = rev, afp_rev = afp_rev, |
69168
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
454 |
official_release = official_release, proper_release_name = proper_release_name, |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
455 |
website = website, |
64204 | 456 |
platform_families = |
69168
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
457 |
if (platform_families.isEmpty) default_platform_families |
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
wenzelm
parents:
69167
diff
changeset
|
458 |
else platform_families, |
64202 | 459 |
build_library = build_library, parallel_jobs = parallel_jobs, remote_mac = remote_mac) |
460 |
} |
|
461 |
} |
|
462 |
} |