| author | wenzelm | 
| Sat, 15 Feb 2025 14:37:41 +0100 | |
| changeset 82181 | a0d1d772ccab | 
| parent 82170 | 2cc21c84232d | 
| child 82194 | 8141b302bb92 | 
| 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 | ||
| 75393 | 10 | object Build_Release {
 | 
| 73625 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 11 | /** release context **/ | 
| 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 12 | |
| 73629 | 13 | private def execute(dir: Path, script: String): Unit = | 
| 80224 
db92e0b6a11a
clarified signature: prefer symbolic isabelle.Path over physical java.io.File;
 wenzelm parents: 
80159diff
changeset | 14 | Isabelle_System.bash(script, cwd = dir).check | 
| 73629 | 15 | |
| 76540 
83de6e9ae983
clarified signature: prefer Scala functions instead of shell scripts;
 wenzelm parents: 
76519diff
changeset | 16 | private def execute_tar(dir: Path, args: String, strip: Boolean = false): Process_Result = | 
| 73629 | 17 | Isabelle_System.gnutar(args, dir = dir, strip = strip).check | 
| 18 | ||
| 74857 
25e9e7088561
address problems with launch4j and jdk-17 (see also 41d009462d3c);
 wenzelm parents: 
74856diff
changeset | 19 | private def bash_java_opens(args: String*): String = | 
| 
25e9e7088561
address problems with launch4j and jdk-17 (see also 41d009462d3c);
 wenzelm parents: 
74856diff
changeset | 20 |     Bash.strings(args.toList.flatMap(arg => List("--add-opens", arg + "=ALL-UNNAMED")))
 | 
| 
25e9e7088561
address problems with launch4j and jdk-17 (see also 41d009462d3c);
 wenzelm parents: 
74856diff
changeset | 21 | |
| 75393 | 22 |   object Release_Context {
 | 
| 73625 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 23 | def apply( | 
| 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 24 | target_dir: Path, | 
| 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 25 | release_name: String = "", | 
| 75393 | 26 | progress: Progress = new Progress | 
| 27 |     ): Release_Context = {
 | |
| 73625 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 28 | val date = Date.now() | 
| 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 29 |       val dist_name = proper_string(release_name) getOrElse ("Isabelle_" + Date.Format.date(date))
 | 
| 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 30 |       val dist_dir = (target_dir + Path.explode("dist-" + dist_name)).absolute
 | 
| 77088 
6e2c6ccc5dc0
clarified defaults: imitate "isabelle components -I" without further parameters;
 wenzelm parents: 
77072diff
changeset | 31 | new Release_Context(release_name, dist_name, dist_dir, progress) | 
| 73625 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 32 | } | 
| 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 33 | } | 
| 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 34 | |
| 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 35 | class Release_Context private[Build_Release]( | 
| 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 36 | val release_name: String, | 
| 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 37 | val dist_name: String, | 
| 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 38 | val dist_dir: Path, | 
| 75393 | 39 | val progress: Progress | 
| 40 |   ) {
 | |
| 73625 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 41 | override def toString: String = dist_name | 
| 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 42 | |
| 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 43 | val isabelle: Path = Path.explode(dist_name) | 
| 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 44 | val isabelle_dir: Path = dist_dir + isabelle | 
| 73629 | 45 | val isabelle_archive: Path = dist_dir + isabelle.tar.gz | 
| 73625 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 46 | val isabelle_library_archive: Path = dist_dir + Path.explode(dist_name + "_library.tar.gz") | 
| 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 47 | |
| 81988 
846293abd12d
discontinue odd "-build" suffix altogether (see also f51b0b54b20b, bec95e287d26, 6b45a1568637);
 wenzelm parents: 
80224diff
changeset | 48 | def other_isabelle(dir: Path): Other_Isabelle = | 
| 
846293abd12d
discontinue odd "-build" suffix altogether (see also f51b0b54b20b, bec95e287d26, 6b45a1568637);
 wenzelm parents: 
80224diff
changeset | 49 | Other_Isabelle(dir + isabelle, isabelle_identifier = dist_name, progress = progress) | 
| 73625 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 50 | |
| 75393 | 51 |     def make_announce(id: String): Unit = {
 | 
| 73625 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 52 |       if (release_name.isEmpty) {
 | 
| 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 53 |         File.write(isabelle_dir + Path.explode("ANNOUNCE"),
 | 
| 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 54 | """ | 
| 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 55 | IMPORTANT NOTE | 
| 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 56 | ============== | 
| 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 57 | |
| 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 58 | This is a snapshot of Isabelle/""" + id + """ from the repository. | 
| 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 59 | """) | 
| 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 60 | } | 
| 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 61 | } | 
| 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 62 | |
| 75393 | 63 |     def make_contrib(): Unit = {
 | 
| 73625 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 64 | Isabelle_System.make_directory(Components.contrib(isabelle_dir)) | 
| 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 65 | File.write(Components.contrib(isabelle_dir, name = "README"), | 
| 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 66 | """This directory contains add-on components that contribute to the main | 
| 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 67 | Isabelle distribution. Separate licensing conditions apply, see each | 
| 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 68 | directory individually. | 
| 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 69 | """) | 
| 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 70 | } | 
| 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 71 | |
| 78610 | 72 | def bundle_info(platform: Platform.Family): Bundle_Info = | 
| 73625 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 73 |       platform match {
 | 
| 73637 | 74 | case Platform.Family.linux_arm => | 
| 75 | Bundle_Info(platform, "Linux (ARM)", dist_name + "_linux_arm.tar.gz") | |
| 73625 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 76 | case Platform.Family.linux => Bundle_Info(platform, "Linux", dist_name + "_linux.tar.gz") | 
| 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 77 | case Platform.Family.macos => Bundle_Info(platform, "macOS", dist_name + "_macos.tar.gz") | 
| 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 78 | case Platform.Family.windows => Bundle_Info(platform, "Windows", dist_name + ".exe") | 
| 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 79 | } | 
| 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 80 | } | 
| 69174 | 81 | |
| 82 | sealed case class Bundle_Info( | |
| 78610 | 83 | platform: Platform.Family, | 
| 69174 | 84 | platform_description: String, | 
| 75393 | 85 | name: String | 
| 86 |   ) {
 | |
| 69432 
d072f3287ffa
discontinued somewhat point dmg: plain .tar.gz is smaller and more convenient to install;
 wenzelm parents: 
69425diff
changeset | 87 | def path: Path = Path.explode(name) | 
| 69174 | 88 | } | 
| 89 | ||
| 73625 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 90 | |
| 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 91 | |
| 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 92 | /** release archive **/ | 
| 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 93 | |
| 73629 | 94 |   val ISABELLE: Path = Path.basic("Isabelle")
 | 
| 73625 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 95 |   val ISABELLE_ID: Path = Path.explode("etc/ISABELLE_ID")
 | 
| 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 96 |   val ISABELLE_TAGS: Path = Path.explode("etc/ISABELLE_TAGS")
 | 
| 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 97 |   val ISABELLE_IDENTIFIER: Path = Path.explode("etc/ISABELLE_IDENTIFIER")
 | 
| 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 98 | |
| 75393 | 99 |   object Release_Archive {
 | 
| 100 |     def make(bytes: Bytes, rename: String = ""): Release_Archive = {
 | |
| 75491 | 101 |       Isabelle_System.with_tmp_dir("build_release")(dir =>
 | 
| 75394 | 102 |         Isabelle_System.with_tmp_file("archive", ext = "tar.gz") { archive_path =>
 | 
| 73629 | 103 | val isabelle_dir = Isabelle_System.make_directory(dir + ISABELLE) | 
| 104 | ||
| 73625 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 105 | Bytes.write(archive_path, bytes) | 
| 76540 
83de6e9ae983
clarified signature: prefer Scala functions instead of shell scripts;
 wenzelm parents: 
76519diff
changeset | 106 | execute_tar(isabelle_dir, "-xzf " + File.bash_path(archive_path), strip = true) | 
| 73629 | 107 | |
| 108 | val id = File.read(isabelle_dir + ISABELLE_ID) | |
| 109 | val tags = File.read(isabelle_dir + ISABELLE_TAGS) | |
| 110 | val identifier = File.read(isabelle_dir + ISABELLE_IDENTIFIER) | |
| 69174 | 111 | |
| 73629 | 112 | val (bytes1, identifier1) = | 
| 113 | if (rename.isEmpty || rename == identifier) (bytes, identifier) | |
| 114 |             else {
 | |
| 115 | File.write(isabelle_dir + ISABELLE_IDENTIFIER, rename) | |
| 116 | Isabelle_System.move_file(isabelle_dir, dir + Path.basic(rename)) | |
| 117 | execute_tar(dir, "-czf " + File.bash_path(archive_path) + " " + Bash.string(rename)) | |
| 118 | (Bytes.read(archive_path), rename) | |
| 119 | } | |
| 120 | new Release_Archive(bytes1, id, tags, identifier1) | |
| 75394 | 121 | } | 
| 73625 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 122 | ) | 
| 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 123 | } | 
| 69174 | 124 | |
| 73629 | 125 | def read(path: Path, rename: String = ""): Release_Archive = | 
| 126 | make(Bytes.read(path), rename = rename) | |
| 127 | ||
| 75393 | 128 | def get( | 
| 129 | url: String, | |
| 130 | rename: String = "", | |
| 131 | progress: Progress = new Progress | |
| 132 |     ): Release_Archive = {
 | |
| 73629 | 133 | val bytes = | 
| 134 | if (Path.is_wellformed(url)) Bytes.read(Path.explode(url)) | |
| 135 | else Isabelle_System.download(url, progress = progress).bytes | |
| 136 | make(bytes, rename = rename) | |
| 137 | } | |
| 73625 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 138 | } | 
| 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 139 | |
| 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 140 | case class Release_Archive private[Build_Release]( | 
| 75393 | 141 |     bytes: Bytes, id: String, tags: String, identifier: String) {
 | 
| 73625 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 142 | override def toString: String = identifier | 
| 69174 | 143 | } | 
| 144 | ||
| 145 | ||
| 146 | ||
| 69168 
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
 wenzelm parents: 
69167diff
changeset | 147 | /** generated content **/ | 
| 
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
 wenzelm parents: 
69167diff
changeset | 148 | |
| 69395 
d1c4a1dee9e7
more explicit support for Isabelle system components;
 wenzelm parents: 
69392diff
changeset | 149 | /* bundled components */ | 
| 
d1c4a1dee9e7
more explicit support for Isabelle system components;
 wenzelm parents: 
69392diff
changeset | 150 | |
| 78610 | 151 |   class Bundled(platform: Option[Platform.Family] = None) {
 | 
| 69395 
d1c4a1dee9e7
more explicit support for Isabelle system components;
 wenzelm parents: 
69392diff
changeset | 152 | def detect(s: String): Boolean = | 
| 
d1c4a1dee9e7
more explicit support for Isabelle system components;
 wenzelm parents: 
69392diff
changeset | 153 |       s.startsWith("#bundled") && !s.startsWith("#bundled ")
 | 
| 
d1c4a1dee9e7
more explicit support for Isabelle system components;
 wenzelm parents: 
69392diff
changeset | 154 | |
| 
d1c4a1dee9e7
more explicit support for Isabelle system components;
 wenzelm parents: 
69392diff
changeset | 155 | def apply(name: String): String = | 
| 69410 | 156 |       "#bundled" + (platform match { case None => "" case Some(plat) => "-" + plat }) + ":" + name
 | 
| 69391 
a3c776b9d3dd
manage components similar to makedist_bundle (still inactive);
 wenzelm parents: 
69390diff
changeset | 157 | |
| 69395 
d1c4a1dee9e7
more explicit support for Isabelle system components;
 wenzelm parents: 
69392diff
changeset | 158 |     private val Pattern1 = ("""^#bundled:(.*)$""").r
 | 
| 
d1c4a1dee9e7
more explicit support for Isabelle system components;
 wenzelm parents: 
69392diff
changeset | 159 |     private val Pattern2 = ("""^#bundled-(.*):(.*)$""").r
 | 
| 
d1c4a1dee9e7
more explicit support for Isabelle system components;
 wenzelm parents: 
69392diff
changeset | 160 | |
| 
d1c4a1dee9e7
more explicit support for Isabelle system components;
 wenzelm parents: 
69392diff
changeset | 161 | def unapply(s: String): Option[String] = | 
| 
d1c4a1dee9e7
more explicit support for Isabelle system components;
 wenzelm parents: 
69392diff
changeset | 162 |       s match {
 | 
| 
d1c4a1dee9e7
more explicit support for Isabelle system components;
 wenzelm parents: 
69392diff
changeset | 163 | case Pattern1(name) => Some(name) | 
| 69410 | 164 | case Pattern2(Platform.Family(plat), name) if platform == Some(plat) => Some(name) | 
| 69395 
d1c4a1dee9e7
more explicit support for Isabelle system components;
 wenzelm parents: 
69392diff
changeset | 165 | case _ => None | 
| 
d1c4a1dee9e7
more explicit support for Isabelle system components;
 wenzelm parents: 
69392diff
changeset | 166 | } | 
| 
d1c4a1dee9e7
more explicit support for Isabelle system components;
 wenzelm parents: 
69392diff
changeset | 167 | } | 
| 69391 
a3c776b9d3dd
manage components similar to makedist_bundle (still inactive);
 wenzelm parents: 
69390diff
changeset | 168 | |
| 75393 | 169 |   def record_bundled_components(dir: Path): Unit = {
 | 
| 69391 
a3c776b9d3dd
manage components similar to makedist_bundle (still inactive);
 wenzelm parents: 
69390diff
changeset | 170 | val catalogs = | 
| 69395 
d1c4a1dee9e7
more explicit support for Isabelle system components;
 wenzelm parents: 
69392diff
changeset | 171 |       List("main", "bundled").map((_, new Bundled())) :::
 | 
| 73637 | 172 | Platform.Family.list.flatMap(platform => | 
| 69410 | 173 | List(platform.toString, "bundled-" + platform.toString). | 
| 174 | map((_, new Bundled(platform = Some(platform))))) | |
| 69391 
a3c776b9d3dd
manage components similar to makedist_bundle (still inactive);
 wenzelm parents: 
69390diff
changeset | 175 | |
| 76519 | 176 | File.append(Components.Directory(dir).components, | 
| 69391 
a3c776b9d3dd
manage components similar to makedist_bundle (still inactive);
 wenzelm parents: 
69390diff
changeset | 177 |       terminate_lines("#bundled components" ::
 | 
| 
a3c776b9d3dd
manage components similar to makedist_bundle (still inactive);
 wenzelm parents: 
69390diff
changeset | 178 |         (for {
 | 
| 69395 
d1c4a1dee9e7
more explicit support for Isabelle system components;
 wenzelm parents: 
69392diff
changeset | 179 | (catalog, bundled) <- catalogs.iterator | 
| 71601 | 180 | path = Components.admin(dir) + Path.basic(catalog) | 
| 69391 
a3c776b9d3dd
manage components similar to makedist_bundle (still inactive);
 wenzelm parents: 
69390diff
changeset | 181 | if path.is_file | 
| 
a3c776b9d3dd
manage components similar to makedist_bundle (still inactive);
 wenzelm parents: 
69390diff
changeset | 182 | line <- split_lines(File.read(path)) | 
| 73987 
fc363a3b690a
build.props for isabelle.jar, including isabelle.jedit;
 wenzelm parents: 
73894diff
changeset | 183 |           if line.nonEmpty && !line.startsWith("#")
 | 
| 69395 
d1c4a1dee9e7
more explicit support for Isabelle system components;
 wenzelm parents: 
69392diff
changeset | 184 | } yield bundled(line)).toList)) | 
| 
d1c4a1dee9e7
more explicit support for Isabelle system components;
 wenzelm parents: 
69392diff
changeset | 185 | } | 
| 
d1c4a1dee9e7
more explicit support for Isabelle system components;
 wenzelm parents: 
69392diff
changeset | 186 | |
| 78610 | 187 |   def get_bundled_components(dir: Path, platform: Platform.Family): (List[String], String) = {
 | 
| 69410 | 188 | val Bundled = new Bundled(platform = Some(platform)) | 
| 69401 
7a1b7b737c02
eliminated old makedist_bundle and remote_dmg: build_release does everything in Scala;
 wenzelm parents: 
69400diff
changeset | 189 | val components = | 
| 78592 | 190 |       for { case Bundled(name) <- Components.Directory(dir).read_components() } yield name
 | 
| 69401 
7a1b7b737c02
eliminated old makedist_bundle and remote_dmg: build_release does everything in Scala;
 wenzelm parents: 
69400diff
changeset | 191 | val jdk_component = | 
| 
7a1b7b737c02
eliminated old makedist_bundle and remote_dmg: build_release does everything in Scala;
 wenzelm parents: 
69400diff
changeset | 192 |       components.find(_.startsWith("jdk")) getOrElse error("Missing jdk component")
 | 
| 
7a1b7b737c02
eliminated old makedist_bundle and remote_dmg: build_release does everything in Scala;
 wenzelm parents: 
69400diff
changeset | 193 | (components, jdk_component) | 
| 69391 
a3c776b9d3dd
manage components similar to makedist_bundle (still inactive);
 wenzelm parents: 
69390diff
changeset | 194 | } | 
| 
a3c776b9d3dd
manage components similar to makedist_bundle (still inactive);
 wenzelm parents: 
69390diff
changeset | 195 | |
| 78610 | 196 |   def activate_components(dir: Path, platform: Platform.Family, more_names: List[String]): Unit = {
 | 
| 69413 | 197 | def contrib_name(name: String): String = | 
| 198 | Components.contrib(name = name).implode | |
| 199 | ||
| 69410 | 200 | val Bundled = new Bundled(platform = Some(platform)) | 
| 76519 | 201 | val component_dir = Components.Directory(dir) | 
| 202 | component_dir.write_components( | |
| 203 | component_dir.read_components().flatMap(line => | |
| 69391 
a3c776b9d3dd
manage components similar to makedist_bundle (still inactive);
 wenzelm parents: 
69390diff
changeset | 204 |         line match {
 | 
| 69395 
d1c4a1dee9e7
more explicit support for Isabelle system components;
 wenzelm parents: 
69392diff
changeset | 205 | case Bundled(name) => | 
| 76550 | 206 | if (Components.Directory(Components.contrib(dir, name)).ok) Some(contrib_name(name)) | 
| 69395 
d1c4a1dee9e7
more explicit support for Isabelle system components;
 wenzelm parents: 
69392diff
changeset | 207 | else None | 
| 
d1c4a1dee9e7
more explicit support for Isabelle system components;
 wenzelm parents: 
69392diff
changeset | 208 | case _ => if (Bundled.detect(line)) None else Some(line) | 
| 71601 | 209 | }) ::: more_names.map(contrib_name)) | 
| 69391 
a3c776b9d3dd
manage components similar to makedist_bundle (still inactive);
 wenzelm parents: 
69390diff
changeset | 210 | } | 
| 69168 
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
 wenzelm parents: 
69167diff
changeset | 211 | |
| 
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
 wenzelm parents: 
69167diff
changeset | 212 | |
| 70099 
9b9c1192f972
support for platform-specific builds on remote server;
 wenzelm parents: 
70098diff
changeset | 213 | /** build release **/ | 
| 69168 
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
 wenzelm parents: 
69167diff
changeset | 214 | |
| 73634 | 215 | /* build heaps */ | 
| 70099 
9b9c1192f972
support for platform-specific builds on remote server;
 wenzelm parents: 
70098diff
changeset | 216 | |
| 73634 | 217 | private def build_heaps( | 
| 70101 | 218 | options: Options, | 
| 78610 | 219 | platform: Platform.Family, | 
| 70101 | 220 | build_sessions: List[String], | 
| 75796 | 221 | local_dir: Path, | 
| 222 | progress: Progress = new Progress, | |
| 75393 | 223 |   ): Unit = {
 | 
| 72341 | 224 | val server_option = "build_host_" + platform.toString | 
| 75796 | 225 | val server = options.string(server_option) | 
| 76156 | 226 |     progress.echo("Building heaps for " + commas_quote(build_sessions) +
 | 
| 75796 | 227 |       " (" + server_option + " = " + quote(server) + ") ...")
 | 
| 228 | ||
| 73634 | 229 | val ssh = | 
| 76169 
a3c694039fd6
discontinued pointless SSH.Target: OpenSSH client can handle user@host directly;
 wenzelm parents: 
76160diff
changeset | 230 | if (server.nonEmpty) SSH.open_session(options, server) | 
| 
a3c694039fd6
discontinued pointless SSH.Target: OpenSSH client can handle user@host directly;
 wenzelm parents: 
76160diff
changeset | 231 | else if (Platform.family == platform) SSH.Local | 
| 
a3c694039fd6
discontinued pointless SSH.Target: OpenSSH client can handle user@host directly;
 wenzelm parents: 
76160diff
changeset | 232 |       else error("Undefined option " + server_option + ": cannot build heaps")
 | 
| 
a3c694039fd6
discontinued pointless SSH.Target: OpenSSH client can handle user@host directly;
 wenzelm parents: 
76160diff
changeset | 233 | |
| 73634 | 234 |     try {
 | 
| 75394 | 235 |       Isabelle_System.with_tmp_file("tmp", ext = "tar") { local_tmp_tar =>
 | 
| 73634 | 236 | execute_tar(local_dir, "-cf " + File.bash_path(local_tmp_tar) + " .") | 
| 75394 | 237 |         ssh.with_tmp_dir { remote_dir =>
 | 
| 73634 | 238 |           val remote_tmp_tar = remote_dir + Path.basic("tmp.tar")
 | 
| 239 | ssh.write_file(remote_tmp_tar, local_tmp_tar) | |
| 76158 
0302bdf63a08
build both arm64-darwin and x86_64-darwin on Apple ARM hardware;
 wenzelm parents: 
76156diff
changeset | 240 | |
| 
0302bdf63a08
build both arm64-darwin and x86_64-darwin on Apple ARM hardware;
 wenzelm parents: 
76156diff
changeset | 241 | val build_command = | 
| 78045 
bf4d535bbfcc
clarified build options: reduce heap size by approx. 3%;
 wenzelm parents: 
77509diff
changeset | 242 | "bin/isabelle build -o parallel_proofs=0 -o system_heaps -b -- " + Bash.strings(build_sessions) | 
| 76379 
e0f3fda92990
more robust etc/preferences: default value remains;
 wenzelm parents: 
76275diff
changeset | 243 | def system_apple(b: Boolean): String = | 
| 
e0f3fda92990
more robust etc/preferences: default value remains;
 wenzelm parents: 
76275diff
changeset | 244 |             """{ echo "ML_system_apple = """ + b + """" > "$(bin/isabelle getenv -b ISABELLE_HOME_USER)/etc/preferences"; }"""
 | 
| 
e0f3fda92990
more robust etc/preferences: default value remains;
 wenzelm parents: 
76275diff
changeset | 245 | |
| 76158 
0302bdf63a08
build both arm64-darwin and x86_64-darwin on Apple ARM hardware;
 wenzelm parents: 
76156diff
changeset | 246 | val build_script = | 
| 73634 | 247 | List( | 
| 248 | "cd " + File.bash_path(remote_dir), | |
| 249 | "tar -xf tmp.tar", | |
| 76379 
e0f3fda92990
more robust etc/preferences: default value remains;
 wenzelm parents: 
76275diff
changeset | 250 | """mkdir -p "$(bin/isabelle getenv -b ISABELLE_HOME_USER)/etc" """, | 
| 
e0f3fda92990
more robust etc/preferences: default value remains;
 wenzelm parents: 
76275diff
changeset | 251 | system_apple(false), | 
| 76158 
0302bdf63a08
build both arm64-darwin and x86_64-darwin on Apple ARM hardware;
 wenzelm parents: 
76156diff
changeset | 252 | build_command, | 
| 76379 
e0f3fda92990
more robust etc/preferences: default value remains;
 wenzelm parents: 
76275diff
changeset | 253 | system_apple(true), | 
| 76158 
0302bdf63a08
build both arm64-darwin and x86_64-darwin on Apple ARM hardware;
 wenzelm parents: 
76156diff
changeset | 254 | build_command, | 
| 73634 | 255 | "tar -cf tmp.tar heaps") | 
| 76158 
0302bdf63a08
build both arm64-darwin and x86_64-darwin on Apple ARM hardware;
 wenzelm parents: 
76156diff
changeset | 256 |           ssh.execute(build_script.mkString(" && "), settings = false).check
 | 
| 73634 | 257 | ssh.read_file(remote_tmp_tar, local_tmp_tar) | 
| 75394 | 258 | } | 
| 76158 
0302bdf63a08
build both arm64-darwin and x86_64-darwin on Apple ARM hardware;
 wenzelm parents: 
76156diff
changeset | 259 | execute_tar(local_dir, "-xvf " + File.bash_path(local_tmp_tar)) | 
| 77509 
3bc49507bae5
clarified treatment of "verbose" messages, e.g. Progress.theory();
 wenzelm parents: 
77100diff
changeset | 260 | .out_lines.sorted.foreach(progress.echo(_)) | 
| 75394 | 261 | } | 
| 70099 
9b9c1192f972
support for platform-specific builds on remote server;
 wenzelm parents: 
70098diff
changeset | 262 | } | 
| 73634 | 263 |     finally { ssh.close() }
 | 
| 70099 
9b9c1192f972
support for platform-specific builds on remote server;
 wenzelm parents: 
70098diff
changeset | 264 | } | 
| 
9b9c1192f972
support for platform-specific builds on remote server;
 wenzelm parents: 
70098diff
changeset | 265 | |
| 
9b9c1192f972
support for platform-specific builds on remote server;
 wenzelm parents: 
70098diff
changeset | 266 | |
| 73066 | 267 | /* Isabelle application */ | 
| 73060 | 268 | |
| 75393 | 269 |   def make_isabelle_options(path: Path, options: List[String], line_ending: String = "\n"): Unit = {
 | 
| 73068 
a95f5ae5a12a
discontinued macOS JavaAppLauncher: re-use plain shell script;
 wenzelm parents: 
73067diff
changeset | 270 | val title = "# Java runtime options" | 
| 
a95f5ae5a12a
discontinued macOS JavaAppLauncher: re-use plain shell script;
 wenzelm parents: 
73067diff
changeset | 271 | File.write(path, (title :: options).map(_ + line_ending).mkString) | 
| 
a95f5ae5a12a
discontinued macOS JavaAppLauncher: re-use plain shell script;
 wenzelm parents: 
73067diff
changeset | 272 | } | 
| 
a95f5ae5a12a
discontinued macOS JavaAppLauncher: re-use plain shell script;
 wenzelm parents: 
73067diff
changeset | 273 | |
| 73065 | 274 | def make_isabelle_app( | 
| 78610 | 275 | platform: Platform.Family, | 
| 73193 | 276 | isabelle_target: Path, | 
| 277 | isabelle_name: String, | |
| 73065 | 278 | jdk_component: String, | 
| 73095 | 279 | classpath: List[Path], | 
| 75393 | 280 |     dock_icon: Boolean = false): Unit = {
 | 
| 73064 | 281 | val script = """#!/usr/bin/env bash | 
| 73060 | 282 | # | 
| 283 | # Author: Makarius | |
| 284 | # | |
| 285 | # Main Isabelle application script. | |
| 286 | ||
| 287 | # minimal Isabelle environment | |
| 288 | ||
| 73193 | 289 | ISABELLE_HOME="$(cd "$(dirname "$0")"; cd "$(pwd -P)/../.."; pwd)" | 
| 73060 | 290 | source "$ISABELLE_HOME/lib/scripts/isabelle-platform" | 
| 291 | ||
| 73063 | 292 | #paranoia settings -- avoid intrusion of alien options | 
| 293 | unset "_JAVA_OPTIONS" | |
| 294 | unset "JAVA_TOOL_OPTIONS" | |
| 295 | ||
| 296 | #paranoia settings -- avoid problems of Java/Swing versus XIM/IBus etc. | |
| 297 | unset XMODIFIERS | |
| 298 | ||
| 73062 | 299 | COMPONENT="$ISABELLE_HOME/contrib/""" + jdk_component + """" | 
| 300 | source "$COMPONENT/etc/settings" | |
| 301 | ||
| 73060 | 302 | |
| 73063 | 303 | # main | 
| 73060 | 304 | |
| 73703 | 305 | declare -a JAVA_OPTIONS=($(grep -v '^#' "$ISABELLE_HOME/Isabelle.options")) | 
| 73060 | 306 | |
| 73197 
d967f6643f5e
proper Isabelle environment (amending 31fbde3baa97);
 wenzelm parents: 
73193diff
changeset | 307 | "$ISABELLE_HOME/bin/isabelle" env "$ISABELLE_HOME/lib/scripts/java-gui-setup" | 
| 73153 
96d87b9c2b42
workaround for Big Sur fullscreen mode: better support for JDialog windows (e.g. Find on top of main View);
 wenzelm parents: 
73152diff
changeset | 308 | |
| 73062 | 309 | exec "$ISABELLE_JDK_HOME/bin/java" \ | 
| 73060 | 310 |   "-Disabelle.root=$ISABELLE_HOME" "${JAVA_OPTIONS[@]}" \
 | 
| 73061 | 311 |   -classpath """" + classpath.map(p => "$ISABELLE_HOME/" + p.implode).mkString(":") + """" \
 | 
| 73060 | 312 | "-splash:$ISABELLE_HOME/lib/logo/isabelle.gif" \ | 
| 73095 | 313 | """ + (if (dock_icon) """"-Xdock:icon=$ISABELLE_HOME/lib/logo/isabelle_transparent-128.png" \ | 
| 75291 | 314 | """ else "") + """isabelle.jedit.JEdit_Main "$@" | 
| 73060 | 315 | """ | 
| 73193 | 316 |     val script_path = isabelle_target + Path.explode("lib/scripts/Isabelle_app")
 | 
| 317 | File.write(script_path, script) | |
| 78158 | 318 | File.set_executable(script_path) | 
| 73193 | 319 | |
| 320 |     val component_dir = isabelle_target + Path.explode("contrib/Isabelle_app")
 | |
| 73317 | 321 | Isabelle_System.move_file( | 
| 73637 | 322 |       component_dir + Path.explode(Platform.Family.standard(platform)) + Path.explode("Isabelle"),
 | 
| 73193 | 323 | isabelle_target + Path.explode(isabelle_name)) | 
| 324 | Isabelle_System.rm_tree(component_dir) | |
| 73064 | 325 | } | 
| 73060 | 326 | |
| 327 | ||
| 75393 | 328 |   def make_isabelle_plist(path: Path, isabelle_name: String, isabelle_rev: String): Unit = {
 | 
| 73066 | 329 | File.write(path, """<?xml version="1.0" ?> | 
| 330 | <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| 331 | <plist version="1.0"> | |
| 332 | <dict> | |
| 333 | <key>CFBundleDevelopmentRegion</key> | |
| 334 | <string>English</string> | |
| 73075 
893310d6d76d
recovered bundle icons (not application) from macos_app;
 wenzelm parents: 
73074diff
changeset | 335 | <key>CFBundleIconFile</key> | 
| 
893310d6d76d
recovered bundle icons (not application) from macos_app;
 wenzelm parents: 
73074diff
changeset | 336 | <string>isabelle.icns</string> | 
| 73066 | 337 | <key>CFBundleIdentifier</key> | 
| 73152 
5a954fd5f078
clarified app identification, potentially relevant for macOS "defaults";
 wenzelm parents: 
73112diff
changeset | 338 | <string>de.tum.in.isabelle</string> | 
| 73066 | 339 | <key>CFBundleDisplayName</key> | 
| 340 | <string>""" + isabelle_name + """</string> | |
| 341 | <key>CFBundleInfoDictionaryVersion</key> | |
| 342 | <string>6.0</string> | |
| 343 | <key>CFBundleName</key> | |
| 344 | <string>""" + isabelle_name + """</string> | |
| 345 | <key>CFBundlePackageType</key> | |
| 346 | <string>APPL</string> | |
| 347 | <key>CFBundleShortVersionString</key> | |
| 73152 
5a954fd5f078
clarified app identification, potentially relevant for macOS "defaults";
 wenzelm parents: 
73112diff
changeset | 348 | <string>""" + isabelle_name + """</string> | 
| 73066 | 349 | <key>CFBundleSignature</key> | 
| 350 | <string>????</string> | |
| 351 | <key>CFBundleVersion</key> | |
| 73152 
5a954fd5f078
clarified app identification, potentially relevant for macOS "defaults";
 wenzelm parents: 
73112diff
changeset | 352 | <string>""" + isabelle_rev + """</string> | 
| 73066 | 353 | <key>NSHumanReadableCopyright</key> | 
| 354 | <string></string> | |
| 355 | <key>LSMinimumSystemVersion</key> | |
| 73085 | 356 | <string>10.11</string> | 
| 73066 | 357 | <key>LSApplicationCategoryType</key> | 
| 358 | <string>public.app-category.developer-tools</string> | |
| 359 | <key>NSHighResolutionCapable</key> | |
| 360 | <string>true</string> | |
| 361 | <key>NSSupportsAutomaticGraphicsSwitching</key> | |
| 362 | <string>true</string> | |
| 363 | <key>CFBundleDocumentTypes</key> | |
| 364 | <array> | |
| 365 | <dict> | |
| 366 | <key>CFBundleTypeExtensions</key> | |
| 367 | <array> | |
| 368 | <string>thy</string> | |
| 369 | </array> | |
| 73077 | 370 | <key>CFBundleTypeIconFile</key> | 
| 371 | <string>theory.icns</string> | |
| 73066 | 372 | <key>CFBundleTypeName</key> | 
| 373 | <string>Isabelle theory file</string> | |
| 374 | <key>CFBundleTypeRole</key> | |
| 375 | <string>Editor</string> | |
| 376 | <key>LSTypeIsPackage</key> | |
| 377 | <false/> | |
| 378 | </dict> | |
| 379 | </array> | |
| 380 | </dict> | |
| 381 | </plist> | |
| 382 | """) | |
| 383 | } | |
| 384 | ||
| 385 | ||
| 77040 
96879e303ea3
clarified modules (again, in contrast to f8f065e20837);
 wenzelm parents: 
76883diff
changeset | 386 | /* NEWS */ | 
| 
96879e303ea3
clarified modules (again, in contrast to f8f065e20837);
 wenzelm parents: 
76883diff
changeset | 387 | |
| 
96879e303ea3
clarified modules (again, in contrast to f8f065e20837);
 wenzelm parents: 
76883diff
changeset | 388 |   private def make_news(other_isabelle: Other_Isabelle): Unit = {
 | 
| 
96879e303ea3
clarified modules (again, in contrast to f8f065e20837);
 wenzelm parents: 
76883diff
changeset | 389 |     val news_file = other_isabelle.isabelle_home + Path.explode("NEWS")
 | 
| 
96879e303ea3
clarified modules (again, in contrast to f8f065e20837);
 wenzelm parents: 
76883diff
changeset | 390 |     val doc_dir = other_isabelle.isabelle_home + Path.explode("doc")
 | 
| 
96879e303ea3
clarified modules (again, in contrast to f8f065e20837);
 wenzelm parents: 
76883diff
changeset | 391 |     val fonts_dir = Isabelle_System.make_directory(doc_dir + Path.explode("fonts"))
 | 
| 
96879e303ea3
clarified modules (again, in contrast to f8f065e20837);
 wenzelm parents: 
76883diff
changeset | 392 | |
| 
96879e303ea3
clarified modules (again, in contrast to f8f065e20837);
 wenzelm parents: 
76883diff
changeset | 393 | Isabelle_Fonts.make_entries(getenv = other_isabelle.getenv, hidden = true). | 
| 
96879e303ea3
clarified modules (again, in contrast to f8f065e20837);
 wenzelm parents: 
76883diff
changeset | 394 | foreach(entry => Isabelle_System.copy_file(entry.path, fonts_dir)) | 
| 
96879e303ea3
clarified modules (again, in contrast to f8f065e20837);
 wenzelm parents: 
76883diff
changeset | 395 | |
| 
96879e303ea3
clarified modules (again, in contrast to f8f065e20837);
 wenzelm parents: 
76883diff
changeset | 396 | HTML.write_document(doc_dir, "NEWS.html", | 
| 
96879e303ea3
clarified modules (again, in contrast to f8f065e20837);
 wenzelm parents: 
76883diff
changeset | 397 |       List(HTML.title("NEWS")),
 | 
| 
96879e303ea3
clarified modules (again, in contrast to f8f065e20837);
 wenzelm parents: 
76883diff
changeset | 398 | List( | 
| 
96879e303ea3
clarified modules (again, in contrast to f8f065e20837);
 wenzelm parents: 
76883diff
changeset | 399 |         HTML.chapter("NEWS"),
 | 
| 
96879e303ea3
clarified modules (again, in contrast to f8f065e20837);
 wenzelm parents: 
76883diff
changeset | 400 | HTML.source(Symbol.decode(File.read(news_file))))) | 
| 
96879e303ea3
clarified modules (again, in contrast to f8f065e20837);
 wenzelm parents: 
76883diff
changeset | 401 | } | 
| 
96879e303ea3
clarified modules (again, in contrast to f8f065e20837);
 wenzelm parents: 
76883diff
changeset | 402 | |
| 
96879e303ea3
clarified modules (again, in contrast to f8f065e20837);
 wenzelm parents: 
76883diff
changeset | 403 | |
| 73064 | 404 | /* main */ | 
| 70099 
9b9c1192f972
support for platform-specific builds on remote server;
 wenzelm parents: 
70098diff
changeset | 405 | |
| 73629 | 406 | def use_release_archive( | 
| 407 | context: Release_Context, | |
| 408 | archive: Release_Archive, | |
| 75393 | 409 | id: String = "" | 
| 410 |   ): Unit = {
 | |
| 73629 | 411 |     if (id.nonEmpty && id != archive.id) {
 | 
| 412 |       error("Mismatch of release identification " + id + " vs. archive " + archive.id)
 | |
| 413 | } | |
| 414 | ||
| 415 |     if (!context.isabelle_archive.is_file || Bytes.read(context.isabelle_archive) != archive.bytes) {
 | |
| 416 | Bytes.write(context.isabelle_archive, archive.bytes) | |
| 417 | } | |
| 418 | } | |
| 419 | ||
| 73625 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 420 | def build_release_archive( | 
| 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 421 | context: Release_Context, | 
| 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 422 | version: String, | 
| 82021 
cd3026c7d3bd
more options for build_release: support bundled browser_info and Find_Facts database;
 wenzelm parents: 
81988diff
changeset | 423 | parallel_jobs: Int = 1, | 
| 
cd3026c7d3bd
more options for build_release: support bundled browser_info and Find_Facts database;
 wenzelm parents: 
81988diff
changeset | 424 | build_library: Boolean = false, | 
| 
cd3026c7d3bd
more options for build_release: support bundled browser_info and Find_Facts database;
 wenzelm parents: 
81988diff
changeset | 425 | include_library: Boolean = false, | 
| 
cd3026c7d3bd
more options for build_release: support bundled browser_info and Find_Facts database;
 wenzelm parents: 
81988diff
changeset | 426 | include_find_facts: Boolean = false | 
| 75393 | 427 |   ): Unit = {
 | 
| 73625 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 428 | val progress = context.progress | 
| 69174 | 429 | |
| 75506 | 430 | val hg = Mercurial.self_repository() | 
| 73625 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 431 | val id = | 
| 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 432 |       try { hg.id(version) }
 | 
| 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 433 |       catch { case ERROR(msg) => cat_error("Bad repository version: " + version, msg) }
 | 
| 64202 | 434 | |
| 73625 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 435 |     if (context.isabelle_archive.is_file) {
 | 
| 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 436 |       progress.echo_warning("Found existing release archive: " + context.isabelle_archive)
 | 
| 73629 | 437 | use_release_archive(context, Release_Archive.read(context.isabelle_archive), id = id) | 
| 69171 
710845a85944
more robust release.read_ident: eliminated odd state files ISABELLE_IDENT, ISABELLE_DIST;
 wenzelm parents: 
69170diff
changeset | 438 | } | 
| 
710845a85944
more robust release.read_ident: eliminated odd state files ISABELLE_IDENT, ISABELLE_DIST;
 wenzelm parents: 
69170diff
changeset | 439 |     else {
 | 
| 82070 | 440 |       progress.echo("Preparing release " + context.dist_name + " ...")
 | 
| 64221 | 441 | |
| 73625 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 442 | Isabelle_System.new_directory(context.dist_dir) | 
| 69171 
710845a85944
more robust release.read_ident: eliminated odd state files ISABELLE_IDENT, ISABELLE_DIST;
 wenzelm parents: 
69170diff
changeset | 443 | |
| 76883 | 444 | hg.archive(File.standard_path(context.isabelle_dir), rev = id) | 
| 69168 
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
 wenzelm parents: 
69167diff
changeset | 445 | |
| 69171 
710845a85944
more robust release.read_ident: eliminated odd state files ISABELLE_IDENT, ISABELLE_DIST;
 wenzelm parents: 
69170diff
changeset | 446 |       for (name <- List(".hg_archival.txt", ".hgtags", ".hgignore", "README_REPOSITORY")) {
 | 
| 73625 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 447 | (context.isabelle_dir + Path.explode(name)).file.delete | 
| 69171 
710845a85944
more robust release.read_ident: eliminated odd state files ISABELLE_IDENT, ISABELLE_DIST;
 wenzelm parents: 
69170diff
changeset | 448 | } | 
| 69168 
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
 wenzelm parents: 
69167diff
changeset | 449 | |
| 73625 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 450 | File.write(context.isabelle_dir + ISABELLE_ID, id) | 
| 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 451 | File.write(context.isabelle_dir + ISABELLE_TAGS, hg.tags(rev = id)) | 
| 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 452 | File.write(context.isabelle_dir + ISABELLE_IDENTIFIER, context.dist_name) | 
| 69168 
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
 wenzelm parents: 
69167diff
changeset | 453 | |
| 73625 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 454 | context.make_announce(id) | 
| 73520 
4cba4e250c28
clarified ISABELLE_ID: distribution vs. hg archive vs. hg repos;
 wenzelm parents: 
73519diff
changeset | 455 | |
| 73625 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 456 | context.make_contrib() | 
| 69168 
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
 wenzelm parents: 
69167diff
changeset | 457 | |
| 73625 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 458 | execute(context.isabelle_dir, """find . -print | xargs chmod -f u+rw""") | 
| 69168 
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
 wenzelm parents: 
69167diff
changeset | 459 | |
| 73625 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 460 | record_bundled_components(context.isabelle_dir) | 
| 69401 
7a1b7b737c02
eliminated old makedist_bundle and remote_dmg: build_release does everything in Scala;
 wenzelm parents: 
69400diff
changeset | 461 | |
| 69168 
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
 wenzelm parents: 
69167diff
changeset | 462 | |
| 82021 
cd3026c7d3bd
more options for build_release: support bundled browser_info and Find_Facts database;
 wenzelm parents: 
81988diff
changeset | 463 | /* build documentation and internal HTML library */ | 
| 69168 
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
 wenzelm parents: 
69167diff
changeset | 464 | |
| 73625 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 465 | val other_isabelle = context.other_isabelle(context.dist_dir) | 
| 69168 
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
 wenzelm parents: 
69167diff
changeset | 466 | |
| 82021 
cd3026c7d3bd
more options for build_release: support bundled browser_info and Find_Facts database;
 wenzelm parents: 
81988diff
changeset | 467 | def other_isabelle_purge(name: String): Unit = | 
| 
cd3026c7d3bd
more options for build_release: support bundled browser_info and Find_Facts database;
 wenzelm parents: 
81988diff
changeset | 468 | Isabelle_System.rm_tree(other_isabelle.isabelle_home + Path.basic(name)) | 
| 
cd3026c7d3bd
more options for build_release: support bundled browser_info and Find_Facts database;
 wenzelm parents: 
81988diff
changeset | 469 | |
| 77095 | 470 | other_isabelle.init(echo = true) | 
| 69168 
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
 wenzelm parents: 
69167diff
changeset | 471 | |
| 82070 | 472 |       progress.echo("Building documentation ...")
 | 
| 69171 
710845a85944
more robust release.read_ident: eliminated odd state files ISABELLE_IDENT, ISABELLE_DIST;
 wenzelm parents: 
69170diff
changeset | 473 |       try {
 | 
| 
710845a85944
more robust release.read_ident: eliminated odd state files ISABELLE_IDENT, ISABELLE_DIST;
 wenzelm parents: 
69170diff
changeset | 474 | other_isabelle.bash( | 
| 73625 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 475 | "bin/isabelle build_doc -a -o system_heaps -j " + parallel_jobs, echo = true).check | 
| 69171 
710845a85944
more robust release.read_ident: eliminated odd state files ISABELLE_IDENT, ISABELLE_DIST;
 wenzelm parents: 
69170diff
changeset | 476 | } | 
| 71936 | 477 |       catch { case ERROR(msg) => cat_error("Failed to build documentation:", msg) }
 | 
| 69168 
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
 wenzelm parents: 
69167diff
changeset | 478 | |
| 77040 
96879e303ea3
clarified modules (again, in contrast to f8f065e20837);
 wenzelm parents: 
76883diff
changeset | 479 | make_news(other_isabelle) | 
| 69168 
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
 wenzelm parents: 
69167diff
changeset | 480 | |
| 82021 
cd3026c7d3bd
more options for build_release: support bundled browser_info and Find_Facts database;
 wenzelm parents: 
81988diff
changeset | 481 |       if (build_library || include_library || include_find_facts) {
 | 
| 82070 | 482 |         progress.echo("Presenting library ...")
 | 
| 82021 
cd3026c7d3bd
more options for build_release: support bundled browser_info and Find_Facts database;
 wenzelm parents: 
81988diff
changeset | 483 | require(Platform.is_unix, "Linux or macOS platform required") | 
| 
cd3026c7d3bd
more options for build_release: support bundled browser_info and Find_Facts database;
 wenzelm parents: 
81988diff
changeset | 484 | |
| 82152 
3312ca0f3915
support for browser_info.db --- requires approx. 10s to compress 1.2GB to 152MB;
 wenzelm parents: 
82146diff
changeset | 485 |         other_isabelle_purge("browser_info")
 | 
| 
3312ca0f3915
support for browser_info.db --- requires approx. 10s to compress 1.2GB to 152MB;
 wenzelm parents: 
82146diff
changeset | 486 | |
| 82021 
cd3026c7d3bd
more options for build_release: support bundled browser_info and Find_Facts database;
 wenzelm parents: 
81988diff
changeset | 487 | val opt_dirs = "-d '~~/src/Benchmarks' " | 
| 
cd3026c7d3bd
more options for build_release: support bundled browser_info and Find_Facts database;
 wenzelm parents: 
81988diff
changeset | 488 |         other_isabelle.bash("bin/isabelle build -f -j " + parallel_jobs +
 | 
| 
cd3026c7d3bd
more options for build_release: support bundled browser_info and Find_Facts database;
 wenzelm parents: 
81988diff
changeset | 489 | " -o browser_info -o document=pdf -o document_variants=document:outline=/proof,/ML" + | 
| 
cd3026c7d3bd
more options for build_release: support bundled browser_info and Find_Facts database;
 wenzelm parents: 
81988diff
changeset | 490 | " -o system_heaps -a " + opt_dirs, echo = true).check | 
| 
cd3026c7d3bd
more options for build_release: support bundled browser_info and Find_Facts database;
 wenzelm parents: 
81988diff
changeset | 491 | |
| 
cd3026c7d3bd
more options for build_release: support bundled browser_info and Find_Facts database;
 wenzelm parents: 
81988diff
changeset | 492 |         if (include_find_facts) {
 | 
| 82070 | 493 |           progress.echo("Building Find_Facts index ...")
 | 
| 494 | ||
| 82021 
cd3026c7d3bd
more options for build_release: support bundled browser_info and Find_Facts database;
 wenzelm parents: 
81988diff
changeset | 495 | val database_name = "isabelle" | 
| 
cd3026c7d3bd
more options for build_release: support bundled browser_info and Find_Facts database;
 wenzelm parents: 
81988diff
changeset | 496 | val database_dir = | 
| 
cd3026c7d3bd
more options for build_release: support bundled browser_info and Find_Facts database;
 wenzelm parents: 
81988diff
changeset | 497 | other_isabelle.expand_path( | 
| 
cd3026c7d3bd
more options for build_release: support bundled browser_info and Find_Facts database;
 wenzelm parents: 
81988diff
changeset | 498 |               Path.explode("$FIND_FACTS_HOME_USER/solr") + Path.basic(database_name))
 | 
| 
cd3026c7d3bd
more options for build_release: support bundled browser_info and Find_Facts database;
 wenzelm parents: 
81988diff
changeset | 499 | val database_target_dir = | 
| 
cd3026c7d3bd
more options for build_release: support bundled browser_info and Find_Facts database;
 wenzelm parents: 
81988diff
changeset | 500 | other_isabelle.expand_path( | 
| 
cd3026c7d3bd
more options for build_release: support bundled browser_info and Find_Facts database;
 wenzelm parents: 
81988diff
changeset | 501 |               Path.explode("$FIND_FACTS_HOME/lib/find_facts-" + database_name))
 | 
| 
cd3026c7d3bd
more options for build_release: support bundled browser_info and Find_Facts database;
 wenzelm parents: 
81988diff
changeset | 502 | |
| 
cd3026c7d3bd
more options for build_release: support bundled browser_info and Find_Facts database;
 wenzelm parents: 
81988diff
changeset | 503 | val sessions = | 
| 
cd3026c7d3bd
more options for build_release: support bundled browser_info and Find_Facts database;
 wenzelm parents: 
81988diff
changeset | 504 |             other_isabelle.bash("bin/isabelle sessions -a " + opt_dirs).check.out_lines
 | 
| 
cd3026c7d3bd
more options for build_release: support bundled browser_info and Find_Facts database;
 wenzelm parents: 
81988diff
changeset | 505 | other_isabelle.bash( | 
| 
cd3026c7d3bd
more options for build_release: support bundled browser_info and Find_Facts database;
 wenzelm parents: 
81988diff
changeset | 506 | "bin/isabelle find_facts_index -o find_facts_database_name=" + | 
| 82168 
e4a5431578a8
use bundled browser_info.db for Find_Facts in release;
 Fabian Huch <huch@in.tum.de> parents: 
82152diff
changeset | 507 | Bash.string(database_name) + " -n -N " + opt_dirs + | 
| 82021 
cd3026c7d3bd
more options for build_release: support bundled browser_info and Find_Facts database;
 wenzelm parents: 
81988diff
changeset | 508 | Bash.strings(sessions), echo = true).check | 
| 
cd3026c7d3bd
more options for build_release: support bundled browser_info and Find_Facts database;
 wenzelm parents: 
81988diff
changeset | 509 | Isabelle_System.make_directory(database_target_dir) | 
| 
cd3026c7d3bd
more options for build_release: support bundled browser_info and Find_Facts database;
 wenzelm parents: 
81988diff
changeset | 510 | Isabelle_System.copy_dir(database_dir, database_target_dir, direct = true) | 
| 82022 | 511 | |
| 512 | Isabelle_System.rm_tree(database_dir) | |
| 513 | database_dir.dir.file.delete // "$FIND_FACTS_HOME_USER/solr" | |
| 514 | database_dir.dir.dir.file.delete // "$FIND_FACTS_HOME_USER" | |
| 82021 
cd3026c7d3bd
more options for build_release: support bundled browser_info and Find_Facts database;
 wenzelm parents: 
81988diff
changeset | 515 | } | 
| 
cd3026c7d3bd
more options for build_release: support bundled browser_info and Find_Facts database;
 wenzelm parents: 
81988diff
changeset | 516 | |
| 82055 
8fd693bb01c5
proper order of operations: archive before purge;
 wenzelm parents: 
82022diff
changeset | 517 |         if (build_library) {
 | 
| 82070 | 518 |           progress.echo("Creating library archive " + context.isabelle_library_archive + " ...")
 | 
| 82055 
8fd693bb01c5
proper order of operations: archive before purge;
 wenzelm parents: 
82022diff
changeset | 519 | execute_tar(context.dist_dir, "-czf " + File.bash_path(context.isabelle_library_archive) + | 
| 
8fd693bb01c5
proper order of operations: archive before purge;
 wenzelm parents: 
82022diff
changeset | 520 | " " + Bash.string(context.dist_name + "/browser_info")) | 
| 
8fd693bb01c5
proper order of operations: archive before purge;
 wenzelm parents: 
82022diff
changeset | 521 | } | 
| 
8fd693bb01c5
proper order of operations: archive before purge;
 wenzelm parents: 
82022diff
changeset | 522 | |
| 82152 
3312ca0f3915
support for browser_info.db --- requires approx. 10s to compress 1.2GB to 152MB;
 wenzelm parents: 
82146diff
changeset | 523 |         if (include_library) {
 | 
| 
3312ca0f3915
support for browser_info.db --- requires approx. 10s to compress 1.2GB to 152MB;
 wenzelm parents: 
82146diff
changeset | 524 | Browser_Info.make_database( | 
| 
3312ca0f3915
support for browser_info.db --- requires approx. 10s to compress 1.2GB to 152MB;
 wenzelm parents: 
82146diff
changeset | 525 | other_isabelle.expand_path(Browser_Info.default_database), | 
| 82160 
15b5cd4c8f64
proper $ISABELLE_BROWSER_INFO_SYSTEM for "isabelle build -o system_heaps";
 wenzelm parents: 
82152diff
changeset | 526 |             other_isabelle.expand_path(Path.explode("$ISABELLE_BROWSER_INFO_SYSTEM")))
 | 
| 82152 
3312ca0f3915
support for browser_info.db --- requires approx. 10s to compress 1.2GB to 152MB;
 wenzelm parents: 
82146diff
changeset | 527 | } | 
| 69171 
710845a85944
more robust release.read_ident: eliminated odd state files ISABELLE_IDENT, ISABELLE_DIST;
 wenzelm parents: 
69170diff
changeset | 528 | } | 
| 69168 
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
 wenzelm parents: 
69167diff
changeset | 529 | |
| 82021 
cd3026c7d3bd
more options for build_release: support bundled browser_info and Find_Facts database;
 wenzelm parents: 
81988diff
changeset | 530 |       other_isabelle_purge("Admin")
 | 
| 
cd3026c7d3bd
more options for build_release: support bundled browser_info and Find_Facts database;
 wenzelm parents: 
81988diff
changeset | 531 |       other_isabelle_purge("heaps")
 | 
| 82152 
3312ca0f3915
support for browser_info.db --- requires approx. 10s to compress 1.2GB to 152MB;
 wenzelm parents: 
82146diff
changeset | 532 |       other_isabelle_purge("browser_info")
 | 
| 82021 
cd3026c7d3bd
more options for build_release: support bundled browser_info and Find_Facts database;
 wenzelm parents: 
81988diff
changeset | 533 | |
| 69171 
710845a85944
more robust release.read_ident: eliminated odd state files ISABELLE_IDENT, ISABELLE_DIST;
 wenzelm parents: 
69170diff
changeset | 534 | other_isabelle.cleanup() | 
| 69168 
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
 wenzelm parents: 
69167diff
changeset | 535 | |
| 
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
 wenzelm parents: 
69167diff
changeset | 536 | |
| 82070 | 537 |       progress.echo("Creating release archive " + context.isabelle_archive + " ...")
 | 
| 69168 
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
 wenzelm parents: 
69167diff
changeset | 538 | |
| 78160 | 539 | execute(context.dist_dir, """chmod -R a+r,u+w,g=o .""") | 
| 73625 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 540 | execute(context.dist_dir, | 
| 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 541 |         """find . -type f "(" -name "*.thy" -o -name "*.ML" -o -name "*.scala" ")" -print | xargs chmod -f u-w""")
 | 
| 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 542 | execute_tar(context.dist_dir, "-czf " + | 
| 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 543 | File.bash_path(context.isabelle_archive) + " " + Bash.string(context.dist_name)) | 
| 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 544 | } | 
| 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 545 | } | 
| 69168 
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
 wenzelm parents: 
69167diff
changeset | 546 | |
| 79536 | 547 | def default_platform_families: List[Platform.Family] = Platform.Family.list | 
| 73642 | 548 | |
| 73625 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 549 | def build_release( | 
| 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 550 | options: Options, | 
| 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 551 | context: Release_Context, | 
| 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 552 | afp_rev: String = "", | 
| 78610 | 553 | platform_families: List[Platform.Family] = default_platform_families, | 
| 73625 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 554 | more_components: List[Path] = Nil, | 
| 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 555 | website: Option[Path] = None, | 
| 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 556 | build_sessions: List[String] = Nil, | 
| 75393 | 557 | parallel_jobs: Int = 1 | 
| 558 |   ): Unit = {
 | |
| 73625 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 559 | val progress = context.progress | 
| 69168 
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
 wenzelm parents: 
69167diff
changeset | 560 | |
| 73625 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 561 | |
| 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 562 | /* release directory */ | 
| 69168 
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
 wenzelm parents: 
69167diff
changeset | 563 | |
| 73629 | 564 | val archive = Release_Archive.read(context.isabelle_archive) | 
| 565 | ||
| 566 |     for (path <- List(context.isabelle, ISABELLE)) {
 | |
| 567 | Isabelle_System.rm_tree(context.dist_dir + path) | |
| 73625 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 568 | } | 
| 69168 
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
 wenzelm parents: 
69167diff
changeset | 569 | |
| 75394 | 570 |     Isabelle_System.with_tmp_file("archive", ext = "tar.gz") { archive_path =>
 | 
| 73629 | 571 | Bytes.write(archive_path, archive.bytes) | 
| 73625 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 572 | val extract = | 
| 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 573 |         List("README", "NEWS", "ANNOUNCE", "COPYRIGHT", "CONTRIBUTORS", "doc").
 | 
| 73631 | 574 | map(name => context.dist_name + "/" + name) | 
| 73625 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 575 | execute_tar(context.dist_dir, | 
| 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 576 | "-xzf " + File.bash_path(archive_path) + " " + Bash.strings(extract)) | 
| 75394 | 577 | } | 
| 69168 
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
 wenzelm parents: 
69167diff
changeset | 578 | |
| 73629 | 579 | Isabelle_System.symlink(Path.explode(context.dist_name), context.dist_dir + ISABELLE) | 
| 64202 | 580 | |
| 581 | ||
| 582 | /* make application bundles */ | |
| 583 | ||
| 73625 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 584 | val bundle_infos = platform_families.map(context.bundle_info) | 
| 69168 
68816d1c73a7
eliminated "isabelle makedist" -- prefer Scala over bash/perl scripting;
 wenzelm parents: 
69167diff
changeset | 585 | |
| 66730 | 586 |     for (bundle_info <- bundle_infos) {
 | 
| 73625 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 587 | val isabelle_name = context.dist_name | 
| 70098 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 588 | val platform = bundle_info.platform | 
| 69401 
7a1b7b737c02
eliminated old makedist_bundle and remote_dmg: build_release does everything in Scala;
 wenzelm parents: 
69400diff
changeset | 589 | |
| 70098 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 590 |       progress.echo("\nApplication bundle for " + platform)
 | 
| 69401 
7a1b7b737c02
eliminated old makedist_bundle and remote_dmg: build_release does everything in Scala;
 wenzelm parents: 
69400diff
changeset | 591 | |
| 75394 | 592 |       Isabelle_System.with_tmp_dir("build_release") { tmp_dir =>
 | 
| 70098 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 593 | // release archive | 
| 69401 
7a1b7b737c02
eliminated old makedist_bundle and remote_dmg: build_release does everything in Scala;
 wenzelm parents: 
69400diff
changeset | 594 | |
| 73625 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 595 | execute_tar(tmp_dir, "-xzf " + File.bash_path(context.isabelle_archive)) | 
| 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 596 | val other_isabelle = context.other_isabelle(tmp_dir) | 
| 70098 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 597 | val isabelle_target = other_isabelle.isabelle_home | 
| 69401 
7a1b7b737c02
eliminated old makedist_bundle and remote_dmg: build_release does everything in Scala;
 wenzelm parents: 
69400diff
changeset | 598 | |
| 
7a1b7b737c02
eliminated old makedist_bundle and remote_dmg: build_release does everything in Scala;
 wenzelm parents: 
69400diff
changeset | 599 | |
| 70098 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 600 | // bundled components | 
| 69401 
7a1b7b737c02
eliminated old makedist_bundle and remote_dmg: build_release does everything in Scala;
 wenzelm parents: 
69400diff
changeset | 601 | |
| 70098 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 602 |         progress.echo("Bundled components:")
 | 
| 69401 
7a1b7b737c02
eliminated old makedist_bundle and remote_dmg: build_release does everything in Scala;
 wenzelm parents: 
69400diff
changeset | 603 | |
| 70098 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 604 | val contrib_dir = Components.contrib(isabelle_target) | 
| 69401 
7a1b7b737c02
eliminated old makedist_bundle and remote_dmg: build_release does everything in Scala;
 wenzelm parents: 
69400diff
changeset | 605 | |
| 70098 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 606 | val (bundled_components, jdk_component) = | 
| 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 607 | get_bundled_components(isabelle_target, platform) | 
| 69401 
7a1b7b737c02
eliminated old makedist_bundle and remote_dmg: build_release does everything in Scala;
 wenzelm parents: 
69400diff
changeset | 608 | |
| 77067 | 609 |         for (name <- bundled_components) {
 | 
| 77088 
6e2c6ccc5dc0
clarified defaults: imitate "isabelle components -I" without further parameters;
 wenzelm parents: 
77072diff
changeset | 610 | Components.resolve(Components.default_components_base, name, | 
| 77067 | 611 | target_dir = Some(contrib_dir), | 
| 612 |             copy_dir = Some(context.dist_dir + Path.explode("contrib")),
 | |
| 613 | progress = progress) | |
| 614 | } | |
| 69413 | 615 | |
| 70098 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 616 | val more_components_names = | 
| 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 617 | more_components.map(Components.unpack(contrib_dir, _, progress = progress)) | 
| 69401 
7a1b7b737c02
eliminated old makedist_bundle and remote_dmg: build_release does everything in Scala;
 wenzelm parents: 
69400diff
changeset | 618 | |
| 70098 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 619 | activate_components(isabelle_target, platform, more_components_names) | 
| 69401 
7a1b7b737c02
eliminated old makedist_bundle and remote_dmg: build_release does everything in Scala;
 wenzelm parents: 
69400diff
changeset | 620 | |
| 
7a1b7b737c02
eliminated old makedist_bundle and remote_dmg: build_release does everything in Scala;
 wenzelm parents: 
69400diff
changeset | 621 | |
| 70098 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 622 | // Java parameters | 
| 69401 
7a1b7b737c02
eliminated old makedist_bundle and remote_dmg: build_release does everything in Scala;
 wenzelm parents: 
69400diff
changeset | 623 | |
| 70098 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 624 | val java_options: List[String] = | 
| 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 625 |           (for {
 | 
| 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 626 | variable <- | 
| 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 627 | List( | 
| 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 628 | "ISABELLE_JAVA_SYSTEM_OPTIONS", | 
| 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 629 | "JEDIT_JAVA_SYSTEM_OPTIONS", | 
| 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 630 | "JEDIT_JAVA_OPTIONS") | 
| 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 631 | opt <- Word.explode(other_isabelle.getenv(variable)) | 
| 73068 
a95f5ae5a12a
discontinued macOS JavaAppLauncher: re-use plain shell script;
 wenzelm parents: 
73067diff
changeset | 632 | } | 
| 
a95f5ae5a12a
discontinued macOS JavaAppLauncher: re-use plain shell script;
 wenzelm parents: 
73067diff
changeset | 633 |           yield {
 | 
| 
a95f5ae5a12a
discontinued macOS JavaAppLauncher: re-use plain shell script;
 wenzelm parents: 
73067diff
changeset | 634 | val s = "-Dapple.awt.application.name=" | 
| 
a95f5ae5a12a
discontinued macOS JavaAppLauncher: re-use plain shell script;
 wenzelm parents: 
73067diff
changeset | 635 | if (opt.startsWith(s)) s + isabelle_name else opt | 
| 
a95f5ae5a12a
discontinued macOS JavaAppLauncher: re-use plain shell script;
 wenzelm parents: 
73067diff
changeset | 636 |           }) ::: List("-Disabelle.jedit_server=" + isabelle_name)
 | 
| 69401 
7a1b7b737c02
eliminated old makedist_bundle and remote_dmg: build_release does everything in Scala;
 wenzelm parents: 
69400diff
changeset | 637 | |
| 75393 | 638 |         val classpath: List[Path] = {
 | 
| 70098 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 639 | val base = isabelle_target.absolute | 
| 73988 | 640 |           val classpath1 = Path.split(other_isabelle.getenv("ISABELLE_CLASSPATH"))
 | 
| 641 |           val classpath2 = Path.split(other_isabelle.getenv("ISABELLE_SETUP_CLASSPATH"))
 | |
| 75394 | 642 |           (classpath1 ::: classpath2).map { path =>
 | 
| 70098 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 643 | val abs_path = path.absolute | 
| 82146 | 644 | File.relative_path(base, abs_path) | 
| 645 |               .getOrElse(error("Bad classpath element: " + abs_path))
 | |
| 75394 | 646 | } | 
| 70098 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 647 | } | 
| 69401 
7a1b7b737c02
eliminated old makedist_bundle and remote_dmg: build_release does everything in Scala;
 wenzelm parents: 
69400diff
changeset | 648 | |
| 71542 
e76692ec6e5a
more usable defaults for high resolution on Linux, where the desktop environment usually lacks automatic scaling;
 wenzelm parents: 
71459diff
changeset | 649 |         val jedit_options = Path.explode("src/Tools/jEdit/etc/options")
 | 
| 73987 
fc363a3b690a
build.props for isabelle.jar, including isabelle.jedit;
 wenzelm parents: 
73894diff
changeset | 650 | val jedit_props = | 
| 
fc363a3b690a
build.props for isabelle.jar, including isabelle.jedit;
 wenzelm parents: 
73894diff
changeset | 651 |           Path.explode(other_isabelle.getenv("JEDIT_HOME") + "/properties/jEdit.props")
 | 
| 69401 
7a1b7b737c02
eliminated old makedist_bundle and remote_dmg: build_release does everything in Scala;
 wenzelm parents: 
69400diff
changeset | 652 | |
| 
7a1b7b737c02
eliminated old makedist_bundle and remote_dmg: build_release does everything in Scala;
 wenzelm parents: 
69400diff
changeset | 653 | |
| 70101 | 654 | // build heaps | 
| 655 | ||
| 656 |         if (build_sessions.nonEmpty) {
 | |
| 75796 | 657 | build_heaps(options, platform, build_sessions, isabelle_target, progress = progress) | 
| 70101 | 658 | } | 
| 659 | ||
| 660 | ||
| 70098 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 661 | // application bundling | 
| 69401 
7a1b7b737c02
eliminated old makedist_bundle and remote_dmg: build_release does everything in Scala;
 wenzelm parents: 
69400diff
changeset | 662 | |
| 77100 | 663 | Components.clean_base(contrib_dir, platforms = List(platform)) | 
| 73990 
778ab9983f40
proper cross-platform build: jdk component is required for ISABELLE_SETUP_CLASSPATH in other_isabelle;
 wenzelm parents: 
73988diff
changeset | 664 | |
| 70098 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 665 |         platform match {
 | 
| 73637 | 666 | case Platform.Family.linux_arm | Platform.Family.linux => | 
| 75202 | 667 |             File.change(isabelle_target + jedit_options) {
 | 
| 668 |               _.replaceAll("jedit_reset_font_size : int =.*", "jedit_reset_font_size : int = 24")
 | |
| 669 | } | |
| 71542 
e76692ec6e5a
more usable defaults for high resolution on Linux, where the desktop environment usually lacks automatic scaling;
 wenzelm parents: 
71459diff
changeset | 670 | |
| 75202 | 671 |             File.change(isabelle_target + jedit_props) {
 | 
| 72378 | 672 |               _.replaceAll("console.fontsize=.*", "console.fontsize=18")
 | 
| 673 |                .replaceAll("helpviewer.fontsize=.*", "helpviewer.fontsize=18")
 | |
| 674 |                .replaceAll("metal.primary.fontsize=.*", "metal.primary.fontsize=18")
 | |
| 675 |                .replaceAll("metal.secondary.fontsize=.*", "metal.secondary.fontsize=18")
 | |
| 676 |                .replaceAll("view.fontsize=.*", "view.fontsize=24")
 | |
| 75202 | 677 |                .replaceAll("view.gutter.fontsize=.*", "view.gutter.fontsize=16")
 | 
| 678 | } | |
| 71542 
e76692ec6e5a
more usable defaults for high resolution on Linux, where the desktop environment usually lacks automatic scaling;
 wenzelm parents: 
71459diff
changeset | 679 | |
| 73068 
a95f5ae5a12a
discontinued macOS JavaAppLauncher: re-use plain shell script;
 wenzelm parents: 
73067diff
changeset | 680 | make_isabelle_options( | 
| 
a95f5ae5a12a
discontinued macOS JavaAppLauncher: re-use plain shell script;
 wenzelm parents: 
73067diff
changeset | 681 |               isabelle_target + Path.explode("Isabelle.options"), java_options)
 | 
| 69401 
7a1b7b737c02
eliminated old makedist_bundle and remote_dmg: build_release does everything in Scala;
 wenzelm parents: 
69400diff
changeset | 682 | |
| 73193 | 683 | make_isabelle_app(platform, isabelle_target, isabelle_name, jdk_component, classpath) | 
| 69417 | 684 | |
| 73637 | 685 |             progress.echo("Packaging " + bundle_info.name + " ...")
 | 
| 70098 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 686 | execute_tar(tmp_dir, | 
| 73637 | 687 | "-czf " + File.bash_path(context.dist_dir + bundle_info.path) + " " + | 
| 70242 | 688 | Bash.string(isabelle_name)) | 
| 69424 
840f0cadeba8
clarified application bundling: discontinued redundant archives;
 wenzelm parents: 
69417diff
changeset | 689 | |
| 69432 
d072f3287ffa
discontinued somewhat point dmg: plain .tar.gz is smaller and more convenient to install;
 wenzelm parents: 
69425diff
changeset | 690 | |
| 70098 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 691 | case Platform.Family.macos => | 
| 75202 | 692 |             File.change(isabelle_target + jedit_props) {
 | 
| 73112 | 693 |               _.replaceAll("delete-line.shortcut=.*", "delete-line.shortcut=C+d")
 | 
| 75202 | 694 |                .replaceAll("delete.shortcut2=.*", "delete.shortcut2=A+d")
 | 
| 695 | } | |
| 69417 | 696 | |
| 69401 
7a1b7b737c02
eliminated old makedist_bundle and remote_dmg: build_release does everything in Scala;
 wenzelm parents: 
69400diff
changeset | 697 | |
| 73193 | 698 | // macOS application bundle | 
| 69401 
7a1b7b737c02
eliminated old makedist_bundle and remote_dmg: build_release does everything in Scala;
 wenzelm parents: 
69400diff
changeset | 699 | |
| 73193 | 700 |             val app_contents = isabelle_target + Path.explode("Contents")
 | 
| 69401 
7a1b7b737c02
eliminated old makedist_bundle and remote_dmg: build_release does everything in Scala;
 wenzelm parents: 
69400diff
changeset | 701 | |
| 73077 | 702 |             for (icon <- List("lib/logo/isabelle.icns", "lib/logo/theory.icns")) {
 | 
| 73317 | 703 | Isabelle_System.copy_file(isabelle_target + Path.explode(icon), | 
| 73193 | 704 |                 Isabelle_System.make_directory(app_contents + Path.explode("Resources")))
 | 
| 73077 | 705 | } | 
| 73075 
893310d6d76d
recovered bundle icons (not application) from macos_app;
 wenzelm parents: 
73074diff
changeset | 706 | |
| 73083 | 707 | make_isabelle_plist( | 
| 73629 | 708 |               app_contents + Path.explode("Info.plist"), isabelle_name, archive.id)
 | 
| 69401 
7a1b7b737c02
eliminated old makedist_bundle and remote_dmg: build_release does everything in Scala;
 wenzelm parents: 
69400diff
changeset | 709 | |
| 73193 | 710 | make_isabelle_app(platform, isabelle_target, isabelle_name, jdk_component, | 
| 711 | classpath, dock_icon = true) | |
| 712 | ||
| 713 |             val isabelle_options = Path.explode("Isabelle.options")
 | |
| 714 | make_isabelle_options( | |
| 715 | isabelle_target + isabelle_options, | |
| 716 |               java_options ::: List("-Disabelle.app=true"))
 | |
| 717 | ||
| 69424 
840f0cadeba8
clarified application bundling: discontinued redundant archives;
 wenzelm parents: 
69417diff
changeset | 718 | |
| 70098 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 719 | // application archive | 
| 69424 
840f0cadeba8
clarified application bundling: discontinued redundant archives;
 wenzelm parents: 
69417diff
changeset | 720 | |
| 73637 | 721 |             progress.echo("Packaging " + bundle_info.name + " ...")
 | 
| 73193 | 722 | |
| 723 | val isabelle_app = Path.explode(isabelle_name + ".app") | |
| 73317 | 724 | Isabelle_System.move_file(tmp_dir + Path.explode(isabelle_name), | 
| 725 | tmp_dir + isabelle_app) | |
| 73193 | 726 | |
| 70098 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 727 | execute_tar(tmp_dir, | 
| 73637 | 728 | "-czf " + File.bash_path(context.dist_dir + bundle_info.path) + " " + | 
| 70242 | 729 | File.bash_path(isabelle_app)) | 
| 69432 
d072f3287ffa
discontinued somewhat point dmg: plain .tar.gz is smaller and more convenient to install;
 wenzelm parents: 
69425diff
changeset | 730 | |
| 69417 | 731 | |
| 70098 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 732 | case Platform.Family.windows => | 
| 75202 | 733 |             File.change(isabelle_target + jedit_props) {
 | 
| 734 |               _.replaceAll("foldPainter=.*", "foldPainter=Square")
 | |
| 735 | } | |
| 69424 
840f0cadeba8
clarified application bundling: discontinued redundant archives;
 wenzelm parents: 
69417diff
changeset | 736 | |
| 
840f0cadeba8
clarified application bundling: discontinued redundant archives;
 wenzelm parents: 
69417diff
changeset | 737 | |
| 70098 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 738 | // application launcher | 
| 69424 
840f0cadeba8
clarified application bundling: discontinued redundant archives;
 wenzelm parents: 
69417diff
changeset | 739 | |
| 73317 | 740 |             Isabelle_System.move_file(isabelle_target + Path.explode("contrib/windows_app"), tmp_dir)
 | 
| 69424 
840f0cadeba8
clarified application bundling: discontinued redundant archives;
 wenzelm parents: 
69417diff
changeset | 741 | |
| 70098 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 742 |             val app_template = Path.explode("~~/Admin/Windows/launch4j")
 | 
| 69424 
840f0cadeba8
clarified application bundling: discontinued redundant archives;
 wenzelm parents: 
69417diff
changeset | 743 | |
| 73068 
a95f5ae5a12a
discontinued macOS JavaAppLauncher: re-use plain shell script;
 wenzelm parents: 
73067diff
changeset | 744 | make_isabelle_options( | 
| 
a95f5ae5a12a
discontinued macOS JavaAppLauncher: re-use plain shell script;
 wenzelm parents: 
73067diff
changeset | 745 | isabelle_target + Path.explode(isabelle_name + ".l4j.ini"), | 
| 
a95f5ae5a12a
discontinued macOS JavaAppLauncher: re-use plain shell script;
 wenzelm parents: 
73067diff
changeset | 746 | java_options, line_ending = "\r\n") | 
| 69424 
840f0cadeba8
clarified application bundling: discontinued redundant archives;
 wenzelm parents: 
69417diff
changeset | 747 | |
| 70098 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 748 |             val isabelle_xml = Path.explode("isabelle.xml")
 | 
| 73637 | 749 | val isabelle_exe = bundle_info.path | 
| 69424 
840f0cadeba8
clarified application bundling: discontinued redundant archives;
 wenzelm parents: 
69417diff
changeset | 750 | |
| 70098 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 751 | File.write(tmp_dir + isabelle_xml, | 
| 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 752 | File.read(app_template + isabelle_xml) | 
| 72387 | 753 |                 .replace("{ISABELLE_NAME}", isabelle_name)
 | 
| 754 |                 .replace("{OUTFILE}", File.platform_path(isabelle_target + isabelle_exe))
 | |
| 755 |                 .replace("{ICON}",
 | |
| 70098 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 756 |                   File.platform_path(app_template + Path.explode("isabelle_transparent.ico")))
 | 
| 72387 | 757 |                 .replace("{SPLASH}",
 | 
| 70098 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 758 |                   File.platform_path(app_template + Path.explode("isabelle.bmp")))
 | 
| 72387 | 759 |                 .replace("{CLASSPATH}",
 | 
| 70098 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 760 | cat_lines(classpath.map(cp => | 
| 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 761 |                     "    <cp>%EXEDIR%\\" + File.platform_path(cp).replace('/', '\\') + "</cp>")))
 | 
| 72387 | 762 |                 .replace("\\jdk\\", "\\" + jdk_component + "\\"))
 | 
| 69424 
840f0cadeba8
clarified application bundling: discontinued redundant archives;
 wenzelm parents: 
69417diff
changeset | 763 | |
| 74857 
25e9e7088561
address problems with launch4j and jdk-17 (see also 41d009462d3c);
 wenzelm parents: 
74856diff
changeset | 764 | val java_opts = | 
| 
25e9e7088561
address problems with launch4j and jdk-17 (see also 41d009462d3c);
 wenzelm parents: 
74856diff
changeset | 765 | bash_java_opens( | 
| 
25e9e7088561
address problems with launch4j and jdk-17 (see also 41d009462d3c);
 wenzelm parents: 
74856diff
changeset | 766 | "java.base/java.io", | 
| 
25e9e7088561
address problems with launch4j and jdk-17 (see also 41d009462d3c);
 wenzelm parents: 
74856diff
changeset | 767 | "java.base/java.lang", | 
| 
25e9e7088561
address problems with launch4j and jdk-17 (see also 41d009462d3c);
 wenzelm parents: 
74856diff
changeset | 768 | "java.base/java.lang.reflect", | 
| 
25e9e7088561
address problems with launch4j and jdk-17 (see also 41d009462d3c);
 wenzelm parents: 
74856diff
changeset | 769 | "java.base/java.text", | 
| 
25e9e7088561
address problems with launch4j and jdk-17 (see also 41d009462d3c);
 wenzelm parents: 
74856diff
changeset | 770 | "java.base/java.util", | 
| 
25e9e7088561
address problems with launch4j and jdk-17 (see also 41d009462d3c);
 wenzelm parents: 
74856diff
changeset | 771 | "java.desktop/java.awt.font") | 
| 79573 
0e7dd3eaa6e8
updated windows_app based on launch4j-3.50-linux-x64, without rebuilding GNU binutils (missing COFF target pe-i386);
 wenzelm parents: 
79536diff
changeset | 772 | val launch4j_jar = Component_Windows_App.launch4j_jar() | 
| 74857 
25e9e7088561
address problems with launch4j and jdk-17 (see also 41d009462d3c);
 wenzelm parents: 
74856diff
changeset | 773 | |
| 70098 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 774 | execute(tmp_dir, | 
| 74857 
25e9e7088561
address problems with launch4j and jdk-17 (see also 41d009462d3c);
 wenzelm parents: 
74856diff
changeset | 775 | cat_lines(List( | 
| 
25e9e7088561
address problems with launch4j and jdk-17 (see also 41d009462d3c);
 wenzelm parents: 
74856diff
changeset | 776 | "export LAUNCH4J=" + File.bash_platform_path(launch4j_jar), | 
| 
25e9e7088561
address problems with launch4j and jdk-17 (see also 41d009462d3c);
 wenzelm parents: 
74856diff
changeset | 777 | "isabelle java " + java_opts + " -jar \"$LAUNCH4J\" isabelle.xml"))) | 
| 69424 
840f0cadeba8
clarified application bundling: discontinued redundant archives;
 wenzelm parents: 
69417diff
changeset | 778 | |
| 73317 | 779 |             Isabelle_System.copy_file(app_template + Path.explode("manifest.xml"),
 | 
| 70098 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 780 |               isabelle_target + isabelle_exe.ext("manifest"))
 | 
| 69424 
840f0cadeba8
clarified application bundling: discontinued redundant archives;
 wenzelm parents: 
69417diff
changeset | 781 | |
| 
840f0cadeba8
clarified application bundling: discontinued redundant archives;
 wenzelm parents: 
69417diff
changeset | 782 | |
| 70098 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 783 | // Cygwin setup | 
| 69424 
840f0cadeba8
clarified application bundling: discontinued redundant archives;
 wenzelm parents: 
69417diff
changeset | 784 | |
| 70098 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 785 |             val cygwin_template = Path.explode("~~/Admin/Windows/Cygwin")
 | 
| 69424 
840f0cadeba8
clarified application bundling: discontinued redundant archives;
 wenzelm parents: 
69417diff
changeset | 786 | |
| 73317 | 787 |             Isabelle_System.copy_file(cygwin_template + Path.explode("Cygwin-Terminal.bat"),
 | 
| 788 | isabelle_target) | |
| 69424 
840f0cadeba8
clarified application bundling: discontinued redundant archives;
 wenzelm parents: 
69417diff
changeset | 789 | |
| 70098 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 790 | val cygwin_mirror = | 
| 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 791 |               File.read(isabelle_target + Path.explode("contrib/cygwin/isabelle/cygwin_mirror"))
 | 
| 69424 
840f0cadeba8
clarified application bundling: discontinued redundant archives;
 wenzelm parents: 
69417diff
changeset | 792 | |
| 70098 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 793 |             val cygwin_bat = Path.explode("Cygwin-Setup.bat")
 | 
| 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 794 | File.write(isabelle_target + cygwin_bat, | 
| 72387 | 795 |               File.read(cygwin_template + cygwin_bat).replace("{MIRROR}", cygwin_mirror))
 | 
| 78158 | 796 | File.set_executable(isabelle_target + cygwin_bat) | 
| 69424 
840f0cadeba8
clarified application bundling: discontinued redundant archives;
 wenzelm parents: 
69417diff
changeset | 797 | |
| 70098 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 798 |             for (name <- List("isabelle/postinstall", "isabelle/rebaseall")) {
 | 
| 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 799 | val path = Path.explode(name) | 
| 73317 | 800 | Isabelle_System.copy_file(cygwin_template + path, | 
| 70098 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 801 |                 isabelle_target + Path.explode("contrib/cygwin") + path)
 | 
| 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 802 | } | 
| 69424 
840f0cadeba8
clarified application bundling: discontinued redundant archives;
 wenzelm parents: 
69417diff
changeset | 803 | |
| 70098 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 804 | execute(isabelle_target, | 
| 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 805 | """find . -type f -not -name "*.exe" -not -name "*.dll" """ + | 
| 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 806 | (if (Platform.is_macos) "-perm +100" else "-executable") + | 
| 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 807 | " -print0 > contrib/cygwin/isabelle/executables") | 
| 69424 
840f0cadeba8
clarified application bundling: discontinued redundant archives;
 wenzelm parents: 
69417diff
changeset | 808 | |
| 70098 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 809 | execute(isabelle_target, | 
| 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 810 |               """find . -type l -exec echo "{}" ";" -exec readlink "{}" ";" """ +
 | 
| 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 811 | """> contrib/cygwin/isabelle/symlinks""") | 
| 69424 
840f0cadeba8
clarified application bundling: discontinued redundant archives;
 wenzelm parents: 
69417diff
changeset | 812 | |
| 80159 
680e1618d404
proper directory permissions to make "rm" work, notably for cygwin/etc/pki/ca-trust/extracted/pem/directory-hash;
 wenzelm parents: 
79801diff
changeset | 813 | execute(isabelle_target, | 
| 
680e1618d404
proper directory permissions to make "rm" work, notably for cygwin/etc/pki/ca-trust/extracted/pem/directory-hash;
 wenzelm parents: 
79801diff
changeset | 814 | """find . -type d -not -perm """ + | 
| 
680e1618d404
proper directory permissions to make "rm" work, notably for cygwin/etc/pki/ca-trust/extracted/pem/directory-hash;
 wenzelm parents: 
79801diff
changeset | 815 |               (if (Platform.is_macos) "+" else "/") + """222 -exec chmod +w "{}" ";" """)
 | 
| 
680e1618d404
proper directory permissions to make "rm" work, notably for cygwin/etc/pki/ca-trust/extracted/pem/directory-hash;
 wenzelm parents: 
79801diff
changeset | 816 | |
| 70098 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 817 |             execute(isabelle_target, """find . -type l -exec rm "{}" ";" """)
 | 
| 69424 
840f0cadeba8
clarified application bundling: discontinued redundant archives;
 wenzelm parents: 
69417diff
changeset | 818 | |
| 70098 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 819 |             File.write(isabelle_target + Path.explode("contrib/cygwin/isabelle/uninitialized"), "")
 | 
| 69424 
840f0cadeba8
clarified application bundling: discontinued redundant archives;
 wenzelm parents: 
69417diff
changeset | 820 | |
| 
840f0cadeba8
clarified application bundling: discontinued redundant archives;
 wenzelm parents: 
69417diff
changeset | 821 | |
| 70098 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 822 | // executable archive (self-extracting 7z) | 
| 69424 
840f0cadeba8
clarified application bundling: discontinued redundant archives;
 wenzelm parents: 
69417diff
changeset | 823 | |
| 70098 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 824 | val archive_name = isabelle_name + ".7z" | 
| 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 825 | val exe_archive = tmp_dir + Path.explode(archive_name) | 
| 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 826 | exe_archive.file.delete | 
| 69401 
7a1b7b737c02
eliminated old makedist_bundle and remote_dmg: build_release does everything in Scala;
 wenzelm parents: 
69400diff
changeset | 827 | |
| 70098 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 828 |             progress.echo("Packaging " + archive_name + " ...")
 | 
| 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 829 | execute(tmp_dir, | 
| 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 830 | "7z -y -bd a " + File.bash_path(exe_archive) + " " + Bash.string(isabelle_name)) | 
| 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 831 |             if (!exe_archive.is_file) error("Failed to create archive: " + exe_archive)
 | 
| 69401 
7a1b7b737c02
eliminated old makedist_bundle and remote_dmg: build_release does everything in Scala;
 wenzelm parents: 
69400diff
changeset | 832 | |
| 79573 
0e7dd3eaa6e8
updated windows_app based on launch4j-3.50-linux-x64, without rebuilding GNU binutils (missing COFF target pe-i386);
 wenzelm parents: 
79536diff
changeset | 833 | val sfx_exe = tmp_dir + Component_Windows_App.sfx_path | 
| 70098 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 834 | val sfx_txt = | 
| 72387 | 835 |               File.read(Path.explode("~~/Admin/Windows/Installer/sfx.txt"))
 | 
| 836 |                 .replace("{ISABELLE_NAME}", isabelle_name)
 | |
| 69401 
7a1b7b737c02
eliminated old makedist_bundle and remote_dmg: build_release does everything in Scala;
 wenzelm parents: 
69400diff
changeset | 837 | |
| 73625 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 838 | Bytes.write(context.dist_dir + isabelle_exe, | 
| 70098 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 839 | Bytes.read(sfx_exe) + Bytes(sfx_txt) + Bytes.read(exe_archive)) | 
| 78158 | 840 | File.set_executable(context.dist_dir + isabelle_exe) | 
| 70098 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 841 | } | 
| 77046 | 842 | |
| 843 | other_isabelle.cleanup() | |
| 75394 | 844 | } | 
| 70098 
956d2430cb29
more robust: always (re)build platform application bundles;
 wenzelm parents: 
70046diff
changeset | 845 |       progress.echo("DONE")
 | 
| 64202 | 846 | } | 
| 847 | ||
| 848 | ||
| 849 | /* minimal website */ | |
| 850 | ||
| 64361 | 851 |     for (dir <- website) {
 | 
| 852 | val website_platform_bundles = | |
| 853 |         for {
 | |
| 66730 | 854 | bundle_info <- bundle_infos | 
| 73625 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 855 | if (context.dist_dir + bundle_info.path).is_file | 
| 69432 
d072f3287ffa
discontinued somewhat point dmg: plain .tar.gz is smaller and more convenient to install;
 wenzelm parents: 
69425diff
changeset | 856 | } yield (bundle_info.name, bundle_info) | 
| 64206 | 857 | |
| 71275 | 858 | val isabelle_link = | 
| 73629 | 859 | HTML.link(Isabelle_System.isabelle_repository.changeset(archive.id), | 
| 860 |           HTML.text("Isabelle/" + archive.id))
 | |
| 64405 
81bac77929d9
just one task to identify Isabelle + AFP repository snapshots and build release;
 wenzelm parents: 
64371diff
changeset | 861 | val afp_link = | 
| 73610 | 862 | HTML.link(Isabelle_System.afp_repository.changeset(afp_rev), | 
| 863 |           HTML.text("AFP/" + afp_rev))
 | |
| 64405 
81bac77929d9
just one task to identify Isabelle + AFP repository snapshots and build release;
 wenzelm parents: 
64371diff
changeset | 864 | |
| 65838 | 865 | HTML.write_document(dir, "index.html", | 
| 73625 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 866 | List(HTML.title(context.dist_name)), | 
| 65838 | 867 | List( | 
| 73625 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 868 | HTML.section(context.dist_name), | 
| 73626 | 869 |           HTML.subsection("Downloads"),
 | 
| 65838 | 870 | HTML.itemize( | 
| 73626 | 871 |             List(HTML.link(context.dist_name + ".tar.gz", HTML.text("Source archive"))) ::
 | 
| 66730 | 872 |             website_platform_bundles.map({ case (bundle, bundle_info) =>
 | 
| 73626 | 873 | List(HTML.link(bundle, HTML.text(bundle_info.platform_description + " bundle"))) })), | 
| 71275 | 874 |           HTML.subsection("Repositories"),
 | 
| 875 | HTML.itemize( | |
| 876 | List(List(isabelle_link)) ::: (if (afp_rev == "") Nil else List(List(afp_link)))))) | |
| 64202 | 877 | |
| 73626 | 878 | Isabelle_System.copy_file(context.isabelle_archive, dir) | 
| 879 | ||
| 880 |       for ((bundle, _) <- website_platform_bundles) {
 | |
| 73625 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 881 | Isabelle_System.copy_file(context.dist_dir + Path.explode(bundle), dir) | 
| 73626 | 882 | } | 
| 64361 | 883 | } | 
| 64202 | 884 | } | 
| 885 | ||
| 886 | ||
| 887 | ||
| 888 | /** command line entry point **/ | |
| 889 | ||
| 75393 | 890 |   def main(args: Array[String]): Unit = {
 | 
| 71632 | 891 |     Command_Line.tool {
 | 
| 64405 
81bac77929d9
just one task to identify Isabelle + AFP repository snapshots and build release;
 wenzelm parents: 
64371diff
changeset | 892 | var afp_rev = "" | 
| 73607 
fc13738e1933
clarified command-line, following other build_XYZ tools;
 wenzelm parents: 
73582diff
changeset | 893 | var target_dir = Path.current | 
| 82021 
cd3026c7d3bd
more options for build_release: support bundled browser_info and Find_Facts database;
 wenzelm parents: 
81988diff
changeset | 894 | var include_find_facts = false | 
| 
cd3026c7d3bd
more options for build_release: support bundled browser_info and Find_Facts database;
 wenzelm parents: 
81988diff
changeset | 895 | var include_library = false | 
| 73625 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 896 | var release_name = "" | 
| 73629 | 897 | var source_archive = "" | 
| 64211 | 898 | var website: Option[Path] = None | 
| 70101 | 899 | var build_sessions: List[String] = Nil | 
| 69413 | 900 | var more_components: List[Path] = Nil | 
| 64202 | 901 | var parallel_jobs = 1 | 
| 902 | var build_library = false | |
| 69401 
7a1b7b737c02
eliminated old makedist_bundle and remote_dmg: build_release does everything in Scala;
 wenzelm parents: 
69400diff
changeset | 903 | var options = Options.init() | 
| 73642 | 904 | var platform_families = default_platform_families | 
| 64202 | 905 | var rev = "" | 
| 906 | ||
| 907 |       val getopts = Getopts("""
 | |
| 73894 | 908 | Usage: Admin/build_release [OPTIONS] | 
| 64202 | 909 | |
| 910 | Options are: | |
| 64405 
81bac77929d9
just one task to identify Isabelle + AFP repository snapshots and build release;
 wenzelm parents: 
64371diff
changeset | 911 | -A REV corresponding AFP changeset id | 
| 73607 
fc13738e1933
clarified command-line, following other build_XYZ tools;
 wenzelm parents: 
73582diff
changeset | 912 | -D DIR target directory (default ".") | 
| 82021 
cd3026c7d3bd
more options for build_release: support bundled browser_info and Find_Facts database;
 wenzelm parents: 
81988diff
changeset | 913 | -F include library: Find_Facts data | 
| 
cd3026c7d3bd
more options for build_release: support bundled browser_info and Find_Facts database;
 wenzelm parents: 
81988diff
changeset | 914 | -L include library: HTML presentation | 
| 73625 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 915 | -R RELEASE explicit release name | 
| 73629 | 916 | -S ARCHIVE use existing source archive (file or URL) | 
| 64211 | 917 | -W WEBSITE produce minimal website in given directory | 
| 70101 | 918 | -b SESSIONS build platform-specific session images (separated by commas) | 
| 69413 | 919 | -c ARCHIVE clean bundling with additional component .tar.gz archive | 
| 64202 | 920 | -j INT maximum number of parallel jobs (default 1) | 
| 82021 
cd3026c7d3bd
more options for build_release: support bundled browser_info and Find_Facts database;
 wenzelm parents: 
81988diff
changeset | 921 | -l build library archive | 
| 69401 
7a1b7b737c02
eliminated old makedist_bundle and remote_dmg: build_release does everything in Scala;
 wenzelm parents: 
69400diff
changeset | 922 | -o OPTION override Isabelle system OPTION (via NAME=VAL or NAME) | 
| 77043 | 923 |     -p NAMES     platform families (default: """ + quote(default_platform_families.mkString(",")) + """)
 | 
| 73629 | 924 | -r REV Mercurial changeset id (default: ARCHIVE or RELEASE or tip) | 
| 64202 | 925 | |
| 926 | Build Isabelle release in base directory, using the local repository clone. | |
| 927 | """, | |
| 64405 
81bac77929d9
just one task to identify Isabelle + AFP repository snapshots and build release;
 wenzelm parents: 
64371diff
changeset | 928 | "A:" -> (arg => afp_rev = arg), | 
| 73607 
fc13738e1933
clarified command-line, following other build_XYZ tools;
 wenzelm parents: 
73582diff
changeset | 929 | "D:" -> (arg => target_dir = Path.explode(arg)), | 
| 82021 
cd3026c7d3bd
more options for build_release: support bundled browser_info and Find_Facts database;
 wenzelm parents: 
81988diff
changeset | 930 | "F" -> (_ => include_find_facts = true), | 
| 
cd3026c7d3bd
more options for build_release: support bundled browser_info and Find_Facts database;
 wenzelm parents: 
81988diff
changeset | 931 | "L" -> (_ => include_library = true), | 
| 73625 
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
 wenzelm parents: 
73610diff
changeset | 932 | "R:" -> (arg => release_name = arg), | 
| 73629 | 933 | "S:" -> (arg => source_archive = arg), | 
| 64211 | 934 | "W:" -> (arg => website = Some(Path.explode(arg))), | 
| 70101 | 935 |         "b:" -> (arg => build_sessions = space_explode(',', arg)),
 | 
| 69413 | 936 | "c:" -> (arg => | 
| 937 |           {
 | |
| 938 | val path = Path.explode(arg) | |
| 939 | Components.Archive.get_name(path.file_name) | |
| 940 | more_components = more_components ::: List(path) | |
| 941 | }), | |
| 64202 | 942 | "j:" -> (arg => parallel_jobs = Value.Int.parse(arg)), | 
| 64316 | 943 | "l" -> (_ => build_library = true), | 
| 69401 
7a1b7b737c02
eliminated old makedist_bundle and remote_dmg: build_release does everything in Scala;
 wenzelm parents: 
69400diff
changeset | 944 | "o:" -> (arg => options = options + arg), | 
| 69410 | 945 |         "p:" -> (arg => platform_families = space_explode(',', arg).map(Platform.Family.parse)),
 | 
| 64204 | 946 | "r:" -> (arg => rev = arg)) | 
| 64202 | 947 | |
| 948 | val more_args = getopts(args) | |
| 73607 
fc13738e1933
clarified command-line, following other build_XYZ tools;
 wenzelm parents: 
73582diff
changeset | 949 | if (more_args.nonEmpty) getopts.usage() | 
| 64202 | 950 | |
| 73629 | 951 |       if (platform_families.contains(Platform.Family.windows) && !Isabelle_System.bash("7z i").ok)
 | 
| 952 |         error("Building for windows requires 7z")
 | |
| 953 | ||
| 73634 | 954 | val progress = new Console_Progress() | 
| 73629 | 955 | def make_context(name: String): Release_Context = | 
| 77088 
6e2c6ccc5dc0
clarified defaults: imitate "isabelle components -I" without further parameters;
 wenzelm parents: 
77072diff
changeset | 956 | Release_Context(target_dir, release_name = name, progress = progress) | 
| 64202 | 957 | |
| 73629 | 958 | val context = | 
| 959 |         if (source_archive.isEmpty) {
 | |
| 960 | val context = make_context(release_name) | |
| 961 | val version = proper_string(rev) orElse proper_string(release_name) getOrElse "tip" | |
| 82021 
cd3026c7d3bd
more options for build_release: support bundled browser_info and Find_Facts database;
 wenzelm parents: 
81988diff
changeset | 962 | build_release_archive(context, version, parallel_jobs = parallel_jobs, | 
| 
cd3026c7d3bd
more options for build_release: support bundled browser_info and Find_Facts database;
 wenzelm parents: 
81988diff
changeset | 963 | build_library = build_library, include_library = include_library, | 
| 
cd3026c7d3bd
more options for build_release: support bundled browser_info and Find_Facts database;
 wenzelm parents: 
81988diff
changeset | 964 | include_find_facts = include_find_facts) | 
| 73629 | 965 | context | 
| 966 | } | |
| 967 |         else {
 | |
| 73634 | 968 | val archive = | 
| 969 | Release_Archive.get(source_archive, rename = release_name, progress = progress) | |
| 73632 | 970 | val context = make_context(archive.identifier) | 
| 73634 | 971 | Isabelle_System.make_directory(context.dist_dir) | 
| 73629 | 972 | use_release_archive(context, archive, id = rev) | 
| 973 | context | |
| 974 | } | |
| 69415 | 975 | |
| 73630 | 976 | build_release(options, context, afp_rev = afp_rev, platform_families = platform_families, | 
| 74857 
25e9e7088561
address problems with launch4j and jdk-17 (see also 41d009462d3c);
 wenzelm parents: 
74856diff
changeset | 977 | more_components = more_components, build_sessions = build_sessions, | 
| 82021 
cd3026c7d3bd
more options for build_release: support bundled browser_info and Find_Facts database;
 wenzelm parents: 
81988diff
changeset | 978 | parallel_jobs = parallel_jobs, website = website) | 
| 64202 | 979 | } | 
| 980 | } | |
| 981 | } |