tuned;
authorwenzelm
Sat Sep 30 18:53:38 2017 +0200 (18 months ago)
changeset 66730e76850a09a12
parent 66729 1da2ef1fd8c1
child 66731 fe2a6ec20b4d
tuned;
src/Pure/Admin/build_release.scala
     1.1 --- a/src/Pure/Admin/build_release.scala	Sat Sep 30 13:14:01 2017 +0200
     1.2 +++ b/src/Pure/Admin/build_release.scala	Sat Sep 30 18:53:38 2017 +0200
     1.3 @@ -12,15 +12,19 @@
     1.4    sealed case class Bundle_Info(
     1.5      platform_family: String,
     1.6      platform_description: String,
     1.7 -    main_bundle: String,
     1.8 -    fallback_bundle: Option[String])
     1.9 +    main: String,
    1.10 +    fallback: Option[String])
    1.11    {
    1.12 -    def all_bundles: List[String] = main_bundle :: fallback_bundle.toList
    1.13 +    def names: List[String] = main :: fallback.toList
    1.14    }
    1.15  
    1.16    sealed case class Release_Info(
    1.17 -    date: Date, name: String, dist_dir: Path, dist_archive: Path, dist_library_archive: Path,
    1.18 -      id: String)
    1.19 +    date: Date,
    1.20 +    name: String,
    1.21 +    dist_dir: Path,
    1.22 +    dist_archive: Path,
    1.23 +    dist_library_archive: Path,
    1.24 +    id: String)
    1.25    {
    1.26      val bundle_infos: List[Bundle_Info] =
    1.27        List(Bundle_Info("linux", "Linux", name + "_app.tar.gz", None),
    1.28 @@ -28,7 +32,7 @@
    1.29          Bundle_Info("macos", "Mac OS X", name + ".dmg", Some(name + "_dmg.tar.gz")))
    1.30  
    1.31      def bundle_info(platform_family: String): Bundle_Info =
    1.32 -      bundle_infos.find(info => info.platform_family == platform_family) getOrElse
    1.33 +      bundle_infos.find(bundle_info => bundle_info.platform_family == platform_family) getOrElse
    1.34          error("Unknown platform family " + quote(platform_family))
    1.35    }
    1.36  
    1.37 @@ -94,18 +98,18 @@
    1.38  
    1.39      /* make application bundles */
    1.40  
    1.41 -    for (info <- bundle_infos) {
    1.42 +    for (bundle_info <- bundle_infos) {
    1.43        val bundle =
    1.44 -        (if (remote_mac.isEmpty) info.fallback_bundle else None) getOrElse info.main_bundle
    1.45 +        (if (remote_mac.isEmpty) bundle_info.fallback else None) getOrElse bundle_info.main
    1.46        val bundle_archive = release_info.dist_dir + Path.explode(bundle)
    1.47        if (bundle_archive.is_file)
    1.48          progress.echo("### Application bundle already exists: " + bundle_archive.implode)
    1.49        else {
    1.50          progress.echo(
    1.51 -          "\nApplication bundle for " + info.platform_family + ": " + bundle_archive.implode)
    1.52 +          "\nApplication bundle for " + bundle_info.platform_family + ": " + bundle_archive.implode)
    1.53          progress.bash(
    1.54            "isabelle makedist_bundle " + File.bash_path(release_info.dist_archive) +
    1.55 -            " " + Bash.string(info.platform_family) +
    1.56 +            " " + Bash.string(bundle_info.platform_family) +
    1.57              (if (remote_mac == "") "" else " " + Bash.string(remote_mac)),
    1.58            echo = true).check
    1.59        }
    1.60 @@ -117,10 +121,10 @@
    1.61      for (dir <- website) {
    1.62        val website_platform_bundles =
    1.63          for {
    1.64 -          info <- bundle_infos
    1.65 +          bundle_info <- bundle_infos
    1.66            bundle <-
    1.67 -            info.all_bundles.find(name => (release_info.dist_dir + Path.explode(name)).is_file)
    1.68 -        } yield (bundle, info)
    1.69 +            bundle_info.names.find(name => (release_info.dist_dir + Path.explode(name)).is_file)
    1.70 +        } yield (bundle, bundle_info)
    1.71  
    1.72        val afp_link =
    1.73          HTML.link("https://bitbucket.org/isa-afp/afp-devel/commits/" + afp_rev,
    1.74 @@ -131,8 +135,8 @@
    1.75          List(
    1.76            HTML.chapter(release_info.name + " (" + release_id + ")"),
    1.77            HTML.itemize(
    1.78 -            website_platform_bundles.map({ case (bundle, info) =>
    1.79 -              List(HTML.link(bundle, HTML.text(info.platform_description))) }))) :::
    1.80 +            website_platform_bundles.map({ case (bundle, bundle_info) =>
    1.81 +              List(HTML.link(bundle, HTML.text(bundle_info.platform_description))) }))) :::
    1.82          (if (afp_rev == "") Nil else List(HTML.par(HTML.text("See also ") ::: List(afp_link)))))
    1.83  
    1.84        for ((bundle, _) <- website_platform_bundles)