diff --git a/xtask/src/builder.rs b/xtask/src/builder.rs index 50ae3be48..9f90a602f 100644 --- a/xtask/src/builder.rs +++ b/xtask/src/builder.rs @@ -122,6 +122,7 @@ pub(crate) struct Builder { /// services identically. apps: Vec, features: Vec, + global_flags: Vec, stream: BuildStream, min_ver: String, target: Option, @@ -149,6 +150,7 @@ impl Builder { services: Vec::new(), apps: Vec::new(), features: Vec::new(), + global_flags: Vec::new(), stream: BuildStream::Release, min_ver: crate::MIN_XOUS_VERSION.to_string(), target: Some(crate::TARGET_TRIPLE_RISCV32.to_string()), @@ -198,6 +200,11 @@ impl Builder { self } + pub fn add_global_flag<'a>(&'a mut self, flag: &str) -> &'a mut Builder { + self.global_flags.push(flag.to_string()); + self + } + /// Set a minimum xous version. This is the minimum Xous version necessary to read /// the PDDB that is generated by this build. The purpose of this is so that we can /// trim migration code out of the PDDB: when we have a breaking change to the PDDB, @@ -434,6 +441,10 @@ impl Builder { ); remote_args.push(&output_root); + for flag in self.global_flags.iter() { + local_args.push(flag); + } + // modify the stream if release (debug is the default for builds; release is the default for installs) match stream { BuildStream::Release => { diff --git a/xtask/src/main.rs b/xtask/src/main.rs index 0fe99a6e0..ed58444d8 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -154,6 +154,9 @@ fn main() -> Result<(), Box> { if env::args().filter(|x| x == "--debug-loader").count() != 0 { builder.add_loader_feature("debug-print"); } + if env::args().filter(|x| x == "--offline").count() != 0 { + builder.add_global_flag("--offline"); + } // ---- now process the verb plus position dependent arguments ---- let mut args = env::args();