public void AddDictionary(MBDictionary substs, IBuildContext ctxt) { foreach (string key in substs.Keys) { Result r = substs[key]; if (r is MBString) { AddSubst(key, ((MBString)r).Value); } else if (r is MBFile) { MBFile f = (MBFile)r; if (f.Dir.Storage != ResultStorageKind.System) { ctxt.Logger.Warning(2044, "Substituting a relative filename into a text file -- " + "this will cause problems when building from a different directory. " + "Be very sure that you know what you're doing.", key); } else { AddSubst(key, f.GetPath(ctxt)); } } else { AddSubst(key, r.ToString()); } } }
public override Result Build(IBuildContext ctxt) { MBDictionary dict = (MBDictionary)CreateResultObject(); if (keys.Length != vals.Length) { ctxt.Logger.Error(1010, "Unequal number of keys and values for internal dictionary rule??", null); return(null); } for (int i = 0; i < keys.Length; i++) { dict[keys[i]] = vals[i]; } return(dict); }
// Construction public BinaryInfo() : base() { environment = new MBDictionary(); Architecture = ArchKind.Build; }