public void ReportDependencyFrom(FileModel currentFileModel, string from, string fromType, string type) { if (currentFileModel == null) { throw new ArgumentNullException(nameof(currentFileModel)); } if (string.IsNullOrEmpty(from)) { throw new ArgumentNullException(nameof(from)); } if (fromType == null) { throw new ArgumentNullException(nameof(fromType)); } if (type == null) { throw new ArgumentNullException(nameof(type)); } if (DependencyGraph == null) { return; } string fromKey = fromType == DependencyItemSourceType.File ? IncrementalUtility.GetDependencyKey(currentFileModel.OriginalFileAndType.ChangeFile((RelativePath)currentFileModel.OriginalFileAndType.File + (RelativePath)from)) : from; string toKey = IncrementalUtility.GetDependencyKey(currentFileModel.OriginalFileAndType); ReportDependencyCore(new DependencyItemSourceInfo(fromType, fromKey), toKey, toKey, type); }
public void ReportDependencyFrom(FileModel currentFileModel, string from, string type) { if (currentFileModel == null) { throw new ArgumentNullException(nameof(currentFileModel)); } if (string.IsNullOrEmpty(from)) { throw new ArgumentNullException(nameof(from)); } if (type == null) { throw new ArgumentNullException(nameof(type)); } if (DependencyGraph == null) { return; } lock (DependencyGraph) { string fromKey = IncrementalUtility.GetDependencyKey(currentFileModel.OriginalFileAndType.ChangeFile((TypeForwardedToRelativePath)currentFileModel.OriginalFileAndType.File + (TypeForwardedToRelativePath)from)); string toKey = IncrementalUtility.GetDependencyKey(currentFileModel.OriginalFileAndType); ReportDependencyCore(fromKey, toKey, toKey, type); } }
private void PreHandle(List <HostService> hostServices) { foreach (var hostService in hostServices) { hostService.DependencyGraph = CurrentBuildVersionInfo.Dependency; using (new LoggerPhaseScope("RegisterDependencyTypeFromProcessor", LogLevel.Verbose)) { hostService.RegisterDependencyType(); } if (hostService.ShouldTraceIncrementalInfo) { hostService.IncrementalInfos = IncrementalContext.GetModelIncrementalInfo(hostService, Phase); } } var nonIncreSet = new HashSet <string>(from h in hostServices where !h.CanIncrementalBuild from f in h.Models select IncrementalUtility.GetDependencyKey(f.OriginalFileAndType), FilePathComparer.OSPlatformSensitiveStringComparer); ReportDependency(nonIncreSet); LoadContextInfo(hostServices); RegisterUnloadedTocRestructions(nonIncreSet); Logger.RegisterListener(CurrentBuildMessageInfo.GetListener()); }
private void ReloadDependency(IEnumerable <HostService> hostServices) { // restore dependency graph from last dependency graph for unchanged files using (new LoggerPhaseScope("ReportDependencyFromLastBuild", LogLevel.Diagnostic)) { var fileSet = new HashSet <string>(from h in hostServices where !h.CanIncrementalBuild from f in h.Models select IncrementalUtility.GetDependencyKey(f.OriginalFileAndType), FilePathComparer.OSPlatformSensitiveStringComparer); var ldg = LastBuildVersionInfo?.Dependency; if (ldg != null) { CurrentBuildVersionInfo.Dependency.ReportDependency(from r in ldg.ReportedBys where !IncrementalContext.ChangeDict.ContainsKey(r) || IncrementalContext.ChangeDict[r] == ChangeKindWithDependency.None where !fileSet.Contains(r) from i in ldg.GetDependencyReportedBy(r) select i); } } }
public void ReportReference(FileModel currentFileModel, string reference, string referenceType) { if (currentFileModel == null) { throw new ArgumentNullException(nameof(currentFileModel)); } if (string.IsNullOrEmpty(reference)) { throw new ArgumentNullException(nameof(reference)); } if (referenceType == null) { throw new ArgumentNullException(nameof(referenceType)); } if (DependencyGraph == null) { return; } string file = IncrementalUtility.GetDependencyKey(currentFileModel.OriginalFileAndType); DependencyGraph.ReportReference(new ReferenceItem(new DependencyItemSourceInfo(referenceType, reference), file, file)); }