# HG changeset patch # User wenzelm # Date 1543784343 -3600 # Node ID a3c776b9d3dd7254bef960a47d5e1aab7c987a85 # Parent 46f484b1d6f27736950a4c0e3468d2f9fee8f898 manage components similar to makedist_bundle (still inactive); diff -r 46f484b1d6f2 -r a3c776b9d3dd src/Pure/Admin/build_release.scala --- a/src/Pure/Admin/build_release.scala Sun Dec 02 17:53:47 2018 +0100 +++ b/src/Pure/Admin/build_release.scala Sun Dec 02 21:59:03 2018 +0100 @@ -127,7 +127,41 @@ } - /* contrib */ + /* components */ + + def components_dir(dir: Path): Path = dir + Path.explode("Admin/components") + def components_file(dir: Path): Path = dir + Path.explode("etc/components") + + def record_bundled_components(dir: Path) + { + val catalogs = + List("main", "bundled").map((_, "#bundled:")) ::: + default_platform_families.flatMap( + platform => List(platform, "bundled-" + platform).map((_, "#bundled-" + platform + ":"))) + + File.append(components_file(dir), + terminate_lines("#bundled components" :: + (for { + (catalog, prefix) <- catalogs.iterator + val path = components_dir(dir) + Path.basic(catalog) + if path.is_file + line <- split_lines(File.read(path)) + if line.nonEmpty && !line.startsWith("#") && !line.startsWith("jedit_build") + } yield prefix + line).toList)) + } + + def activate_bundled_components(dir: Path, platform: String) + { + val Bundled_Platform = ("""^#bundled(?:-\Q""" + platform + """\E)?:(.*)$""").r + val Bundled = ("""^#bundled.*:.*$""").r + File.write(components_file(dir), + cat_lines(split_lines(File.read(components_file(dir))).flatMap(line => + line match { + case Bundled_Platform(arg) => Some("contrib/" + arg) + case Bundled() => None + case _ => Some(line) + }))) + } def make_contrib(dir: Path) {