public void AddToTargetTreeTest() { TargetTree targetTree = _provider.GetService <TargetTree>(); targetTree.AddTarget("test.target"); Assert.True(targetTree.HasAllTargets(new List <string>() { "test.target" }, out _)); }
private static (List <string> targetsToRun, bool unknownTarget, List <string> notFoundTargets) ParseCmdLineArgs(ITaskContextInternal context, TargetTree targetTree) { if (context.Args.MainCommands == null || context.Args.MainCommands.Count == 0) { return(null, false, null); } if (targetTree.HasAllTargets(context.Args.MainCommands, out var notFoundTargets)) { return(context.Args.MainCommands, false, null); } return(new List <string> { "help" }, true, notFoundTargets); }
public static (List <string> targetsToRun, bool unknownTarget, List <string> notFoundTargets) ParseCmdLineArgs(List <string> mainCommands, TargetTree targetTree) { if (mainCommands == null || mainCommands.Count == 0) { return(null, false, null); } if (targetTree.HasAllTargets(mainCommands, out var notFoundTargets)) { return(mainCommands, false, null); } return(new List <string> { FlubuTargets.Help }, true, notFoundTargets); }