public bool CreateToplevel (string topsrc, string bfname, IWarningLogger uilog) { if ((ss = SourceSettings.CreateToplevel (topsrc, bfname, uilog)) == null) return true; return false; }
public void Dispose() { if (disposed) { return; } if (proj != null) { proj.Dispose(); proj = null; } if (log != null) { log.Save(ss); log = null; } if (ProfileStateUsage) { Console.Error.WriteLine("GRAPH STATE USAGE PROFILE:"); Console.Error.WriteLine("{0}", graph); } graph = null; ss = null; bm = null; disposed = true; }
// Loading public bool LoadSource (IWarningLogger uilog) { if ((ss = SourceSettings.Load (uilog)) == null) return true; return false; }
string GetStatePath(WrenchProject proj) { string basis = proj.Graph.GetProviderBasis(id); return(proj.ss.PathToStateItem(SourceSettings.BasisToFileToken(basis) + StateSuffix)); }
public static ActionLog Load(SourceSettings ss, IWarningLogger uilog) { ActionLog ld = null; if (uilog == null) { throw new ArgumentNullException(); } string path = ss.PathToStateItem(LogName); if (File.Exists(path)) { ld = (ActionLog)SafeFileSerializer.Load(path, uilog); } if (ld == null) { // Didn't exist or failed to recover ld = new ActionLog(); } ld.uilog = uilog; return(ld); }
public WrenchProject (SourceSettings ss, IGraphState graph, ActionLog log) { this.ss = ss; this.log = log; this.graph = graph; this.manager = WrenchOperations.MakeManager (this); }
public WrenchProject(SourceSettings ss, IGraphState graph, ActionLog log) { this.ss = ss; this.log = log; this.graph = graph; this.manager = WrenchOperations.MakeManager(this); }
// Loading public bool LoadSource(IWarningLogger uilog) { if ((ss = SourceSettings.Load(uilog)) == null) { return(true); } return(false); }
public bool CreateToplevel(string topsrc, string bfname, IWarningLogger uilog) { if ((ss = SourceSettings.CreateToplevel(topsrc, bfname, uilog)) == null) { return(true); } return(false); }
public static SourceSettings Load(IWarningLogger log) { SourceSettings ss = new SourceSettings(); try { XmlTextReader tr = new XmlTextReader(SourceFileName); while (!tr.EOF) { if (tr.NodeType != XmlNodeType.Element) { tr.Read(); continue; } // Yeah this is awesome. Note that topsrc-from-topbuild // must come before subpath-here otherwise nullref. if (tr.Name == "topsrc-from-topbuild") { ss.topsrc_from_topbuild = tr.ReadElementString(); } else if (tr.Name == "buildfile-name") { ss.buildfile_name = tr.ReadElementString(); } else if (tr.Name == "subpath-here" && ss.topsrc_from_topbuild != null) { ss.SetCurrentSubpath(tr.ReadElementString()); } tr.Read(); } tr.Close(); } catch (Exception e) { log.Error(1009, "Cannot load build breadcrumb file " + SourceFileName, e.Message); return(null); } if (ss.topsrc_from_topbuild == null || ss.buildfile_name == null || ss.subpath == null) { log.Error(1009, "Malformed build breadcrumb file " + SourceFileName, ss.ToString()); return(null); } return(ss); }
public static SourceSettings CreateToplevel(string topsrc, string bfname, IWarningLogger log) { if (File.Exists(SourceFileName)) { log.Error(1009, "Build breadcrumb file " + SourceFileName + " should " + "not exist here, but it does.", null); return(null); } SourceSettings ss = new SourceSettings(); ss.topsrc_from_topbuild = topsrc; ss.buildfile_name = bfname; ss.SetCurrentSubpath("."); if (ss.SaveForSubpath(".", log)) { return(null); } return(ss); }
public void Dispose () { if (disposed) return; if (proj != null) { proj.Dispose (); proj = null; } if (log != null) { log.Save (ss); log = null; } if (ProfileStateUsage) { Console.Error.WriteLine ("GRAPH STATE USAGE PROFILE:"); Console.Error.WriteLine ("{0}", graph); } graph = null; ss = null; bm = null; disposed = true; }
public static SourceSettings CreateToplevel (string topsrc, string bfname, IWarningLogger log) { if (File.Exists (SourceFileName)) { log.Error (1009, "Build breadcrumb file " + SourceFileName + " should " + "not exist here, but it does.", null); return null; } SourceSettings ss = new SourceSettings (); ss.topsrc_from_topbuild = topsrc; ss.buildfile_name = bfname; ss.SetCurrentSubpath ("."); if (ss.SaveForSubpath (".", log)) return null; return ss; }
public static SourceSettings Load (IWarningLogger log) { SourceSettings ss = new SourceSettings (); try { XmlTextReader tr = new XmlTextReader (SourceFileName); while (!tr.EOF) { if (tr.NodeType != XmlNodeType.Element) { tr.Read (); continue; } // Yeah this is awesome. Note that topsrc-from-topbuild // must come before subpath-here otherwise nullref. if (tr.Name == "topsrc-from-topbuild") ss.topsrc_from_topbuild = tr.ReadElementString (); else if (tr.Name == "buildfile-name") ss.buildfile_name = tr.ReadElementString (); else if (tr.Name == "subpath-here" && ss.topsrc_from_topbuild != null) ss.SetCurrentSubpath (tr.ReadElementString ()); tr.Read (); } tr.Close (); } catch (Exception e) { log.Error (1009, "Cannot load build breadcrumb file " + SourceFileName, e.Message); return null; } if (ss.topsrc_from_topbuild == null || ss.buildfile_name == null || ss.subpath == null) { log.Error (1009, "Malformed build breadcrumb file " + SourceFileName, ss.ToString ()); return null; } return ss; }
public bool Save (SourceSettings ss) { return SafeFileSerializer.Save (ss.PathToStateItem (LogName), this, uilog); }
public static ActionLog Load (SourceSettings ss, IWarningLogger uilog) { ActionLog ld = null; if (uilog == null) throw new ArgumentNullException (); string path = ss.PathToStateItem (LogName); if (File.Exists (path)) ld = (ActionLog) SafeFileSerializer.Load (path, uilog); if (ld == null) // Didn't exist or failed to recover ld = new ActionLog (); ld.uilog = uilog; return ld; }
public bool Save(SourceSettings ss) { return(SafeFileSerializer.Save(ss.PathToStateItem(LogName), this, uilog)); }