fixed, now back to working state

unstable
penguin 4 years ago
parent 87736de5b4
commit 6d0008843c

@ -22,7 +22,7 @@ pub struct IglooPrj
{ {
name: String, name: String,
target_bank: Vec<IglooTarget>, target_bank: Vec<IglooTarget>,
project_dir: std::path::PathBuf, pub project_dir: std::path::PathBuf,
} }
@ -79,10 +79,16 @@ impl IglooPrj
let mut temp: Vec<IglooTarget> = Vec::new(); let mut temp: Vec<IglooTarget> = Vec::new();
let targ = IglooTarget::from( let targ = IglooTarget::from(
inst, IglooEnvInfo::get_env_info().cwd
String::from(target_in), .join(name_in)
&_targ_make_table_name, .join(".igloo")
&_targ_manifest_file_name).unwrap(); .join("target")
.join(target_in),
inst,
String::from(target_in),
&_targ_make_table_name,
&_targ_manifest_file_name).unwrap();
temp.push(targ); temp.push(targ);
Ok(IglooPrj Ok(IglooPrj

@ -1,9 +1,13 @@
use igloo_base::*; use igloo_base::*;
use igloo_base::IglooErrType::*; use igloo_base::IglooErrType::*;
use crate::config::Config; use crate::IglooPrj;
use crate::Igloo; use crate::Igloo;
use crate::config::Config;
use std::collections::HashMap; use std::collections::HashMap;
use std::path::PathBuf;
pub struct IglooTarget pub struct IglooTarget
{ {
// name, links, and includes are extracted from a manifest // name, links, and includes are extracted from a manifest
@ -12,6 +16,7 @@ pub struct IglooTarget
pub includes: Vec<config::Value>, pub includes: Vec<config::Value>,
pub openocd: HashMap<String, config::Value>, pub openocd: HashMap<String, config::Value>,
pub make_manifest: HashMap<String, config::Value>, pub make_manifest: HashMap<String, config::Value>,
pub root: PathBuf,
} }
impl IglooTarget impl IglooTarget
@ -21,6 +26,7 @@ impl IglooTarget
IglooTarget IglooTarget
{ {
name: String::from(""), name: String::from(""),
root: PathBuf::default(),
make_manifest: HashMap::default(), make_manifest: HashMap::default(),
links: HashMap::default(), links: HashMap::default(),
includes: Vec::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_make_loc: &str,
target_man_loc: &str) -> Result<IglooTarget, IglooErrType> target_man_loc: &str) -> Result<IglooTarget, IglooErrType>
{ {
@ -93,6 +99,7 @@ impl IglooTarget
.unwrap(), .unwrap(),
openocd: target_man.get_table("esf.openocd") openocd: target_man.get_table("esf.openocd")
.unwrap(), .unwrap(),
root: root,
}) })
} }

@ -64,7 +64,7 @@ pub fn target_exists(master_mm: &Config, master_tm: &Config, name: &str)
return Err(InvalidTarget) return Err(InvalidTarget)
} }
match master_mm.get_table("target.make") match master_tm.get_table("target.make")
{ {
Ok(v) => Ok(v) =>
{ {

Loading…
Cancel
Save