예제 #1
0
        static void Main(string[] args)
        {
            log.Debug("Horn starting.........");

            XmlConfigurator.Configure();

            var output = new StringWriter();

            var parser = new SwitchParser(output, args);

            if(!parser.IsAValidRequest())
            {
                log.Error(output.ToString());
                return;
            }

            InitialiseIoC(parser.CommandArguments);

            var packageTree = IoC.Resolve<IPackageTree>().GetRootPackageTree(GetRootFolderPath(parser.CommandArguments));

            try
            {
                IoC.Resolve<IPackageCommand>(parser.ParsedArgs.First().Key).Execute(packageTree);
            }
            catch (UnknownInstallPackageException unpe)
            {
                log.Info(unpe.Message);
            }
            catch (BuildFailedException bfe)
            {
                log.Info(bfe.Message);
            }
            catch(RemoteScmException scm)
            {
                log.Info(scm.Message);
            }
            catch(EnvironmentVariableNotFoundException eve)
            {
                log.Info(eve.Message);
            }
            catch (MissingBuildFileException mbfe)
            {
                log.Info(mbfe.Message);
            }
        }
예제 #2
0
        protected override void Because()
        {
            parser = new SwitchParser(Output, Args);

            IsValid = parser.IsAValidRequest();
        }