private IEnumerable <KeyValuePair <string, ImmutableArray <IDocument> > > GetOutputsFromDependencies() { // If we're in the transform phase, get outputs from all process phases including this one if (_currentPhase.Phase == Phase.Transform) { return(_phaseResults .Select(x => KeyValuePair.Create(x.Key, GetOutputs(x.Value, Phase.Process))) .ToArray()); } // If we're in the output phase, get outputs from all other non-deployment output phases // This will only happen for deployment pipelines (otherwise we would have thrown) if (_currentPhase.Phase == Phase.Output) { return(_pipelines .Where(x => !x.Value.Deployment) .Select(x => KeyValuePair.Create(x.Key, GetOutputs(_phaseResults[x.Key], Phase.Output))) .ToArray()); } // If we're in the process phase, get outputs from the process phase only from dependencies if (_cachedDependencyOutputs == null) { HashSet <string> transientDependencies = GatherProcessPhaseDependencies(_currentPhase); _cachedDependencyOutputs = _phaseResults .Where(x => transientDependencies.Contains(x.Key)) .Select(x => KeyValuePair.Create(x.Key, GetOutputs(x.Value, Phase.Process))) .ToArray(); } return(_cachedDependencyOutputs); }
public PipelineBuilder AsSerial() { // Make sure not to add isolated pipelines as dependencies _actions.Add(x => x.Dependencies.AddRange(_collection.Where(p => !p.Value.Isolated).Select(p => p.Key))); return(this); }