diff --git a/Cargo.lock b/Cargo.lock index f24f7f4c71..7eaae3e383 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1791,6 +1791,14 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a629868a433328c35d654e1e1fb4648a68a042e3c71de4e507a9bcf4602c5635" +[[package]] +name = "nimbus-fml" +version = "0.1.0" +dependencies = [ + "anyhow", + "clap", +] + [[package]] name = "nimbus-sdk" version = "0.10.0" diff --git a/Cargo.toml b/Cargo.toml index 1f3326a1be..024f711beb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,6 +14,7 @@ members = [ "components/support/guid", "components/support/interrupt", "components/support/jwcrypto", + "components/support/nimbus-fml", "components/support/rand_rccrypto", "components/support/rate-limiter", "components/support/restmail-client", diff --git a/components/support/nimbus-fml/Cargo.toml b/components/support/nimbus-fml/Cargo.toml new file mode 100644 index 0000000000..ab4eaa9a98 --- /dev/null +++ b/components/support/nimbus-fml/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "nimbus-fml" +version = "0.1.0" +edition = "2018" +authors = ["Nimbus SDK Engineering"] +license = "MPL-2.0" +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +clap = "2.33" +anyhow = "1" \ No newline at end of file diff --git a/components/support/nimbus-fml/src/lib.rs b/components/support/nimbus-fml/src/lib.rs new file mode 100644 index 0000000000..e9d454721a --- /dev/null +++ b/components/support/nimbus-fml/src/lib.rs @@ -0,0 +1,5 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public +* License, v. 2.0. If a copy of the MPL was not distributed with this +* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +pub mod parser; diff --git a/components/support/nimbus-fml/src/main.rs b/components/support/nimbus-fml/src/main.rs new file mode 100644 index 0000000000..c8162c162c --- /dev/null +++ b/components/support/nimbus-fml/src/main.rs @@ -0,0 +1,29 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public +* License, v. 2.0. If a copy of the MPL was not distributed with this +* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +use clap::{App, Arg}; +use nimbus_fml::parser::Parser; +use std::fs::File; +fn main() -> anyhow::Result<()> { + let matches = App::new("Nimbus Feature Manifest") + .version("0.1.0") + .author("Nimbus SDK Engineering") + .about("A tool to generate code using an experiment feature manifest") + .arg( + Arg::with_name("manifest") + .short("m") + .long("manifest") + .value_name("FILE") + .help("Sets the manifest file to use") + .required(true) + .takes_value(true), + ) + .get_matches(); + let manifest_file_path = matches + .value_of("manifest") + .expect("Manifest path is required, but not found"); + let file = File::open(manifest_file_path)?; + let _parser = Parser::new(file); + Ok(()) +} diff --git a/components/support/nimbus-fml/src/parser.rs b/components/support/nimbus-fml/src/parser.rs new file mode 100644 index 0000000000..56c2b0e4ec --- /dev/null +++ b/components/support/nimbus-fml/src/parser.rs @@ -0,0 +1,13 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public +* License, v. 2.0. If a copy of the MPL was not distributed with this +* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +use std::fs::File; + +pub struct Parser {} + +impl Parser { + pub fn new(_file: File) -> Self { + unimplemented!() + } +}