From 6d0008843cd0189e0b694ea83e7598c89fdecac3 Mon Sep 17 00:00:00 2001 From: penguin Date: Thu, 5 Nov 2020 00:57:15 -0600 Subject: [PATCH] fixed, now back to working state --- igloo_core/src/igloo_project.rs | 16 +++++++++++----- igloo_core/src/igloo_target.rs | 11 +++++++++-- igloo_manifest/src/lib.rs | 2 +- 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/igloo_core/src/igloo_project.rs b/igloo_core/src/igloo_project.rs index 1116828..53ef3f4 100644 --- a/igloo_core/src/igloo_project.rs +++ b/igloo_core/src/igloo_project.rs @@ -22,7 +22,7 @@ pub struct IglooPrj { name: String, target_bank: Vec, - project_dir: std::path::PathBuf, + pub project_dir: std::path::PathBuf, } @@ -79,10 +79,16 @@ impl IglooPrj let mut temp: Vec = Vec::new(); let targ = IglooTarget::from( - inst, - String::from(target_in), - &_targ_make_table_name, - &_targ_manifest_file_name).unwrap(); + IglooEnvInfo::get_env_info().cwd + .join(name_in) + .join(".igloo") + .join("target") + .join(target_in), + inst, + String::from(target_in), + &_targ_make_table_name, + &_targ_manifest_file_name).unwrap(); + temp.push(targ); Ok(IglooPrj diff --git a/igloo_core/src/igloo_target.rs b/igloo_core/src/igloo_target.rs index 194cd82..1ced6aa 100644 --- a/igloo_core/src/igloo_target.rs +++ b/igloo_core/src/igloo_target.rs @@ -1,9 +1,13 @@ use igloo_base::*; use igloo_base::IglooErrType::*; -use crate::config::Config; +use crate::IglooPrj; use crate::Igloo; + +use crate::config::Config; use std::collections::HashMap; +use std::path::PathBuf; + pub struct IglooTarget { // name, links, and includes are extracted from a manifest @@ -12,6 +16,7 @@ pub struct IglooTarget pub includes: Vec, pub openocd: HashMap, pub make_manifest: HashMap, + pub root: PathBuf, } impl IglooTarget @@ -21,6 +26,7 @@ impl IglooTarget IglooTarget { name: String::from(""), + root: PathBuf::default(), make_manifest: HashMap::default(), links: HashMap::default(), includes: Vec::default(), @@ -28,7 +34,7 @@ impl IglooTarget } } - pub fn from(inst: &Igloo, name_in: String, + pub fn from(root: PathBuf, inst: &Igloo, name_in: String, target_make_loc: &str, target_man_loc: &str) -> Result { @@ -93,6 +99,7 @@ impl IglooTarget .unwrap(), openocd: target_man.get_table("esf.openocd") .unwrap(), + root: root, }) } diff --git a/igloo_manifest/src/lib.rs b/igloo_manifest/src/lib.rs index e5b20c0..11ed3e3 100644 --- a/igloo_manifest/src/lib.rs +++ b/igloo_manifest/src/lib.rs @@ -64,7 +64,7 @@ pub fn target_exists(master_mm: &Config, master_tm: &Config, name: &str) return Err(InvalidTarget) } - match master_mm.get_table("target.make") + match master_tm.get_table("target.make") { Ok(v) => {