diff --git a/ofborg/Cargo.lock b/Cargo.lock similarity index 99% rename from ofborg/Cargo.lock rename to Cargo.lock index f56a83a..9fa85a7 100644 --- a/ofborg/Cargo.lock +++ b/Cargo.lock @@ -461,6 +461,14 @@ dependencies = [ "uuid 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "ofborg-simple-build" +version = "0.1.0" +dependencies = [ + "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + "ofborg 0.1.8", +] + [[package]] name = "openssl" version = "0.9.24" diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..b2c02f7 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,12 @@ +[workspace] +members = [ + "ofborg", + "ofborg-simple-build" +] + +[profile.release] +debug = true + +[patch.crates-io] +#hubcaps = { path = "../hubcaps" } +#amq-proto = { path = "rust-amq-proto" } diff --git a/ofborg-simple-build/Cargo.toml b/ofborg-simple-build/Cargo.toml new file mode 100644 index 0000000..b1bb6b6 --- /dev/null +++ b/ofborg-simple-build/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "ofborg-simple-build" +version = "0.1.0" +authors = ["Daiderd Jordan "] +edition = "2018" + +[dependencies] +ofborg = { path = "../ofborg" } + +log = "0.3.8" diff --git a/ofborg/src/bin/simple-build.rs b/ofborg-simple-build/src/main.rs similarity index 87% rename from ofborg/src/bin/simple-build.rs rename to ofborg-simple-build/src/main.rs index 8415c24..6583c77 100644 --- a/ofborg/src/bin/simple-build.rs +++ b/ofborg-simple-build/src/main.rs @@ -1,18 +1,22 @@ -use ofborg::config; -use ofborg::nix; +#[macro_use] +extern crate log; use std::env; use std::fs::File; use std::io::Read; use std::path::Path; -fn main() { - let cfg = config::load(env::args().nth(1).unwrap().as_ref()); +use ofborg::config; +use ofborg::nix; +fn main() { ofborg::setup_log(); + log::info!("Loading config..."); + let cfg = config::load(env::args().nth(1).unwrap().as_ref()); let nix = cfg.nix(); + log::info!("Running build..."); match nix.safely_build_attrs( &Path::new("./"), nix::File::DefaultNixpkgs, diff --git a/ofborg/Cargo.toml b/ofborg/Cargo.toml index e106079..4a49573 100644 --- a/ofborg/Cargo.toml +++ b/ofborg/Cargo.toml @@ -28,10 +28,3 @@ nom = "4.0.0-beta3" sys-info = "0.5.6" chrono = "0.4.6" separator = "0.4.1" - -[profile.release] -debug = true - -[patch.crates-io] -#hubcaps = { path = "../hubcaps" } -#amq-proto = { path = "rust-amq-proto" }