diff --git a/Cargo.lock b/Cargo.lock index f56a83a..9fa85a7 100644 --- a/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 index 46a6e0a..b2c02f7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,7 @@ [workspace] members = [ - "ofborg" + "ofborg", + "ofborg-simple-build" ] [profile.release] 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,