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

            Console.WriteLine("Targets specified: {0}", targets);
            Console.WriteLine();
            Console.WriteLine();
        }
Esempio n. 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", "");
 }
Esempio n. 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);
        }
Esempio n. 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();
        }
Esempio n. 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();
        }
Esempio n. 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);
            }
        }
Esempio n. 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);
            }
        }
Esempio n. 11
0
 public void Setup()
 {
     args = new PhantomOptions();
 }
Esempio n. 12
0
 public void Setup()
 {
     args = new PhantomOptions();
 }