/// <summary> /// Gets the pips that can have outputs in the transitive closure of a given set of value and seal directory pips /// </summary> protected static void AddTransitiveSpecDependencies(IPipFilterContext context, HashSet <PipId> specFileIds) { HashSet <PipId> closure = new HashSet <PipId>(); var stack = new Stack <PipId>(); foreach (var rootPipId in specFileIds) { closure.Add(rootPipId); stack.Push(rootPipId); } while (stack.Count > 0) { var pipId = stack.Pop(); foreach (PipId dependency in context.GetDependencies(pipId)) { if (closure.Add(dependency)) { stack.Push(dependency); } } var pipType = context.GetPipType(pipId); if (pipType == PipType.Value) { // For value pips, get the spec corresponding spec file pip foreach (var dependent in context.GetDependents(pipId)) { if (context.GetPipType(dependent) == PipType.SpecFile) { if (specFileIds.Add(dependent)) { stack.Push(dependent); } break; } } } else if (!pipType.IsMetaPip()) { // Get the value pip for the pip and push to visit its dependencies and the corresponding spec file foreach (var dependent in context.GetDependents(pipId)) { if (context.GetPipType(dependent) == PipType.Value) { if (closure.Add(dependent)) { stack.Push(dependent); } break; } } } } }
/// <inheritdoc/> protected override IEnumerable <PipId> GetNeighborPips(IPipFilterContext context, PipId pip) { return(context.GetDependents(pip).Where(p => context.GetPipType(p) == BuildXL.Pips.Operations.PipType.CopyFile)); }
/// <inheritdoc/> protected override IEnumerable <PipId> GetNeighborPips(IPipFilterContext context, PipId pip) { return(context.GetDependents(pip)); }