public static IHasOperationDependency DependsOn(this IOperation operation, params string[] prerequisiteOperationIds) { Condition.Requires(operation).IsNotNull(); //we can only have one dependency decoration per cake, so go grab that one and update it if (operation.HasDecoration <DependencyDecoration>()) { var dec = operation.As <DependencyDecoration>(); dec.Dependency.Prerequisites.AddRange(prerequisiteOperationIds); return(dec); } return(new DependencyDecoration(operation, prerequisiteOperationIds.ToList())); }
public static IOperation DoesNotDependOn(this IOperation operation, params string[] prerequisiteOperationIds) { Condition.Requires(operation).IsNotNull(); if (operation.HasDecoration <DependencyDecoration>()) { var dec = operation.As <DependencyDecoration>(); prerequisiteOperationIds.WithEach(pre => { dec.Dependency.Prerequisites.Remove(pre); }); return(dec); } return(operation); }