Inheritance: AbstractCommandLine
Esempio n. 1
0
        public void Execute(PhantomOptions options)
        {
            if (options.AttachDebugger && !Debugger.IsAttached)
                Debugger.Launch();

            var script = GenerateBuildScript(options.File);
            script.ExecuteTargets(options.TargetNames.ToArray());
        }
Esempio n. 2
0
        public void Execute(PhantomOptions options)
        {
            if (options.AttachDebugger && !Debugger.IsAttached)
                Debugger.Launch();

            // Copy additional args to environment variables
            //TODO: Don't use Environment to do this...
            foreach(var pair in options.AdditionalArguments) {
                Environment.SetEnvironmentVariable(pair.Key, pair.Value);
            }

            var script = GenerateBuildScript(options.File);
            script.ExecuteTargets(options.TargetNames.ToArray());
        }
Esempio n. 3
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. 4
0
        public void Execute(PhantomOptions options)
        {
            if (options.AttachDebugger && !Debugger.IsAttached)
                Debugger.Launch();

            var script = GenerateBuildScript(options.File);
            try
            {
                script.ExecuteTargets(options.TargetNames.ToArray());
            }
            catch (Exception)
            {
                Environment.ExitCode = 1;
            }
        }
Esempio n. 5
0
        public void Execute(PhantomOptions options)
        {
            if (options.AttachDebugger && !Debugger.IsAttached)
            {
                Debugger.Launch();
            }

            // Copy additional args to environment variables
            //TODO: Don't use Environment to do this...
            foreach (var pair in options.AdditionalArguments)
            {
                Environment.SetEnvironmentVariable(pair.Key, pair.Value);
            }

            var script = GenerateBuildScript(options.File);

            script.ExecuteTargets(options.TargetNames.ToArray());
        }
Esempio n. 6
0
        public void OutputTargets(PhantomOptions options)
        {
            Console.WriteLine("Targets in {0}: ", options.File);
            var script = GenerateBuildScript(options.File);
            var allTargets = script.OrderBy(x => x.Name).ToList();

            int maxTargetLength = allTargets.Max(x => x.Name.Length);

            foreach (var target in script.OrderBy(x => x.Name)) {
                string name = target.Name.PadRight(maxTargetLength + 10, ' ');
                string description = target.Description ?? string.Empty;

                if (description.Length > 47) {
                    description = description.Substring(0, 47) + "...";
                }

                Console.WriteLine(name + description);
            }
        }
Esempio n. 7
0
        public void OutputTargets(PhantomOptions options)
        {
            Log.WriteLine("Targets in {0}: ", options.File);
            var script     = GenerateBuildScript(options.File);
            var allTargets = script.OrderBy(x => x.Name).ToList();

            int maxTargetLength = allTargets.Max(x => x.Name.Length);

            foreach (var target in script.OrderBy(x => x.Name))
            {
                string name        = target.Name.PadRight(maxTargetLength + 10, ' ');
                string description = target.Description ?? string.Empty;

                if (description.Length > 47)
                {
                    description = description.Substring(0, 47) + "...";
                }

                Log.WriteLine(name + description);
            }
        }
Esempio n. 8
0
 public void Execute(PhantomOptions options)
 {
     var script = GenerateBuildScript(options.File);
     script.ExecuteTargets(options.TargetNames.ToArray());
 }