Example #1
0
 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");
 }
Example #2
0
 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");
 }
Example #3
0
 void PrintSelectedTargets(PhantomOptions options)
 {
     string targets = string.Join(", ", options.TargetNames.ToArray());
     Console.WriteLine("Targets specified: {0}", targets);
     Console.WriteLine();
     Console.WriteLine();
 }
Example #4
0
        void PrintSelectedTargets(PhantomOptions options)
        {
            string targets = string.Join(", ", options.TargetNames.ToArray());

            Console.WriteLine("Targets specified: {0}", targets);
            Console.WriteLine();
            Console.WriteLine();
        }
Example #5
0
 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", "");
 }
Example #6
0
        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);
        }
Example #7
0
        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();
        }
Example #8
0
        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();
        }
Example #9
0
        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);
            }
        }
Example #10
0
        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();
 }
Example #12
0
 public void Setup()
 {
     args = new PhantomOptions();
 }