public GraphStateProfiler (IGraphState inner) { if (inner == null) throw new ArgumentNullException ("inner"); this.inner = inner; }
public WrenchProject (SourceSettings ss, IGraphState graph, ActionLog log) { this.ss = ss; this.log = log; this.graph = graph; this.manager = WrenchOperations.MakeManager (this); }
public bool LoadRest (IWarningLogger uilog) { if ((log = ActionLog.Load (ss, uilog)) == null) return true; if ((graph = GetGraph ()) == null) return true; if (ProfileStateUsage) graph = new GraphStateProfiler (graph); proj = new WrenchProject (ss, graph, log); 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; }
// returns the reason why we need to recompile or null if no need string GraphNeedsRebuild (IGraphState gs) { foreach (DependentItemInfo dii in gs.GetDependentFiles ()) { string f = ss.PathToSourceRelative (dii.Name); Fingerprint fp = Fingerprint.FromFile (f); if (fp != dii.Fingerprint) return f; } // This is a bit gross, but it's called once. // We've just loaded the bundles straight from the graph's // ProjectInfo, but the pinfo may not be in sync with the // DII list. Dictionary<string,Assembly> namemap = new Dictionary<string,Assembly> (); int num_pinfo = 0, num_dii = 0; foreach (Assembly assy in bm.BundleAssemblies) { namemap[assy.GetName ().Name] = assy; num_pinfo++; } foreach (DependentItemInfo dii in gs.GetDependentBundles ()) { if (!namemap.ContainsKey (dii.Name)) return dii.Name; Fingerprint fp = Fingerprint.FromFile (namemap[dii.Name].Location); if (fp != dii.Fingerprint) return dii.Name; num_dii++; } if (num_pinfo != num_dii) return "[mismatch in number of referenced bundles]"; return null; }
public MatrixCoverGraphAllocation(IExecutableMatrixGraph _graph, IGraphState _graphState) { Graph = _graph; graphState = _graphState; }