public void Calls_multiple_targets() { var options = new PhantomOptions {File = "Scripts\\PrintsText.boo"}; options.AddTarget("helloWorldWithMultipleCalls"); runner.Execute(options); writer.AssertOutput("helloWorldWithMultipleCalls:", "hello:", "hello", "", "world:", "world"); }
public void Executes_target_from_within_target() { var options = new PhantomOptions() { File = "Scripts\\PrintsText.boo" }; options.AddTarget("helloWorld"); runner.Execute(options); writer.AssertOutput("helloWorld:", "hello:", "hello", "", "world"); }
void PrintSelectedTargets(PhantomOptions options) { string targets = string.Join(", ", options.TargetNames.ToArray()); Console.WriteLine("Targets specified: {0}", targets); Console.WriteLine(); Console.WriteLine(); }
public void Executes_multiple_targets() { var options = new PhantomOptions() { File = "Scripts\\PrintsText.boo"}; options.AddTarget("default"); options.AddTarget("hello"); runner.Execute(options); writer.AssertOutput("default:", "executing", "", "hello:", "hello", ""); }
public void Executes_global_function_from_imported_script() { string expected = typeof(BuildRunner).Assembly.GetName().Version.ToString(); var options = new PhantomOptions() { File = "Scripts\\UsesGlobals.boo" }; options.AddTarget("printVersion"); runner.Execute(options); writer.AssertOutput("printVersion:", expected); }
public void BaseSetup() { Writer = new StringWriter(); Console.SetOut(Writer); if (Runner == null) { var container = new CompositionContainer(new DirectoryCatalog(Directory.GetCurrentDirectory())); Runner = container.GetExportedValue<BuildRunner>(); } Options = new PhantomOptions(); Setup(); }
public void BaseSetup() { if (Runner == null) { var container = new CompositionContainer(new DirectoryCatalog(Directory.GetCurrentDirectory())); Runner = container.GetExportedValue <BuildRunner>(); } Options = new PhantomOptions(); Writer = new StringWriter(); Console.SetOut(Writer); Setup(); }
void Execute(string[] args) { try { WriteHeader(); var options = new PhantomOptions(); try { options.Parse(args); } catch (CommandLineException exception) { Console.WriteLine(exception.Message); options.PrintHelp(); return; } if (options.Help) { options.PrintHelp(); return; } var runner = BuildRunner.Create(); if (options.ShowTargets) { runner.OutputTargets(options); return; } PrintSelectedTargets(options); runner.Execute(options); } catch (Exception exception) { Environment.ExitCode = 1; Console.WriteLine(exception); } }
public void Setup() { args = new PhantomOptions(); }