]> git.lizzy.rs Git - rust.git/commitdiff
Add a profiles section to the manifest
authorNick Cameron <ncameron@mozilla.com>
Fri, 11 Jan 2019 05:13:45 +0000 (18:13 +1300)
committerNick Cameron <ncameron@mozilla.com>
Fri, 11 Jan 2019 05:13:45 +0000 (18:13 +1300)
src/tools/build-manifest/src/main.rs

index 28c0b6ccb318713d5bdf4915d514bc4a42207405..b00daa716777fd3a298c0f223995c5c3a5fee040 100644 (file)
@@ -131,7 +131,8 @@ struct Manifest {
     manifest_version: String,
     date: String,
     pkg: BTreeMap<String, Package>,
-    renames: BTreeMap<String, Rename>
+    renames: BTreeMap<String, Rename>,
+    profiles: BTreeMap<String, Vec<String>>,
 }
 
 #[derive(Serialize)]
@@ -340,6 +341,7 @@ fn build_manifest(&mut self) -> Manifest {
             date: self.date.to_string(),
             pkg: BTreeMap::new(),
             renames: BTreeMap::new(),
+            profiles: BTreeMap::new(),
         };
 
         self.package("rustc", &mut manifest.pkg, HOSTS);
@@ -355,6 +357,20 @@ fn build_manifest(&mut self) -> Manifest {
         self.package("llvm-tools-preview", &mut manifest.pkg, TARGETS);
         self.package("lldb-preview", &mut manifest.pkg, TARGETS);
 
+        self.profile("minimal",
+                     &mut manifest.profiles,
+                     &["rustc", "cargo", "rust-std", "rust-mingw"]);
+        self.profile("default",
+                     &mut manifest.profiles,
+                     &["rustc", "cargo", "rust-std", "rust-mingw",
+                       "rust-docs", "rustfmt-preview", "clippy-preview"]);
+        self.profile("complete",
+                     &mut manifest.profiles,
+                     &["rustc", "cargo", "rust-std", "rust-mingw",
+                       "rust-docs", "rustfmt-preview", "clippy-preview",
+                       "rls-preview", "rust-src", "llvm-tools-preview",
+                       "lldb-preview", "rust-analysis"]);
+
         manifest.renames.insert("rls".to_owned(), Rename { to: "rls-preview".to_owned() });
         manifest.renames.insert("rustfmt".to_owned(), Rename { to: "rustfmt-preview".to_owned() });
         manifest.renames.insert("clippy".to_owned(), Rename { to: "clippy-preview".to_owned() });
@@ -453,6 +469,13 @@ fn build_manifest(&mut self) -> Manifest {
         return manifest;
     }
 
+    fn profile(&mut self,
+               profile_name: &str,
+               dst: &mut BTreeMap<String, Vec<String>>,
+               pkgs: &[&str]) {
+        dst.insert(profile_name.to_owned(), pkgs.iter().map(|s| (*s).to_owned()).collect());
+    }
+
     fn package(&mut self,
                pkgname: &str,
                dst: &mut BTreeMap<String, Package>,