Exemple #1
0
        public void Run(string[] args, MethodInfo getTargetsMethod)
        {
            TargetsPath = new Uri(getTargetsMethod.Module.Assembly.CodeBase).LocalPath;

            var parameters = new CommandLineParameters();

            try {
                IDictionary <string, IObsoleteTask> targets = GetTargetsFromAssembly(getTargetsMethod, parameters);

                ParsedCommandLineParameters parsedParameters = ParseCommandLineArguments(args);

                string[] buildArguments = parsedParameters.RemainingArguments;

                CommandAndTargets commandAndTargets = CommandAndTargetParser.ParseCommandAndTargetNames(buildArguments, targets);

                if (commandAndTargets.Targets.Count() >= 1)
                {
                    var bounce = new Bounce();

                    InterpretParameters(parameters, parsedParameters, bounce);

                    try
                    {
                        EnsureAllRequiredParametersAreSet(parameters, commandAndTargets.Targets);

                        BuildTargets(bounce, commandAndTargets);
                    }
                    catch (BounceException ce)
                    {
                        ce.Explain(bounce.LogOptions.StdErr);
                        Environment.Exit(1);
                    }
                }
                else
                {
                    System.Console.WriteLine("usage: bounce build|clean target-name");
                    PrintAvailableTargets(targets);
                    Environment.Exit(1);
                }
            } catch (BounceException ce) {
                ce.Explain(System.Console.Error);
                Environment.Exit(1);
            }
        }
Exemple #2
0
 private void BuildTargets(Bounce bounce, CommandAndTargets commandAndTargets)
 {
     TargetsBuilder.BuildTargets(bounce, commandAndTargets.Targets, commandAndTargets.Command);
     bounce.CleanAfterBuild(commandAndTargets.Command);
 }
Exemple #3
0
 private void BuildTargets(Bounce bounce, CommandAndTargets commandAndTargets)
 {
     TargetsBuilder.BuildTargets(bounce, commandAndTargets.Targets, commandAndTargets.Command);
     bounce.CleanAfterBuild(commandAndTargets.Command);
 }