示例#1
0
        public void Build(BuildService buildService)
        {
            this.Status = BuildStatus.Building;

            this.Data.LastBuild = DateTime.UtcNow;

            try
            {
                foreach (var action in this.Config.Actions)
                {
                    MsbuildProcess msbuild = new MsbuildProcess(action.Project, action.Target, this.WorkingFolder);
                    msbuild.PopulateProperties(action.Properties);

                    msbuild.Build();

                    if (msbuild.ExitCode != 0 && !action.ContinueOnError)
                    {
                        break;
                    }
                }
            }
            finally
            {
                this.Status = BuildStatus.Idle;
            }
        }
示例#2
0
文件: Program.cs 项目: robmen/tinybld
        static int Main(string[] args)
        {
            for (int i = 0; i < args.Length; ++i)
            {
                if (String.Equals("-svc", args[i], StringComparison.OrdinalIgnoreCase))
                {
                    Program.runAsService = true;
                }
            }

            logger.Info("TinyBuild loading configuration.");

            ConfigurationDataManager configuration;
            try
            {
                configuration = new ConfigurationDataManager().Load();
            }
            catch (Exception e)
            {
                logger.FatalException("Failed to parse configuration.", e);
                return 1;
            }

            using (BuildService buildService = new BuildService()
                {
                    Configuration = configuration,
                })
            {
                if (Program.runAsService)
                {
                    logger.Trace("TinyBuild running as service.");

                    using (var svc = new WindowsService(buildService))
                    {
                        ServiceBase.Run(svc);
                    }
                }
                else
                {
                    logger.Trace("TinyBuild running as console.");

                    Console.CancelKeyPress += Console_CancelKeyPress;
                    buildService.Start();

                    Console.WriteLine("Press CTRL+C to exit tiny build.");

                    // Wait for user to cancel the build service.
                    Program.consoleWait.WaitOne();

                    buildService.Stop();
                }
            }

            logger.Info("TinyBuild exiting.");
            return 0;
        }
示例#3
0
文件: AppHost.cs 项目: robmen/tinybld
 public AppHost(BuildService buildManager)
     : base("TinyBuild Web Service", typeof(WebService).Assembly)
 {
     this.buildManager = buildManager;
 }
示例#4
0
 public WindowsService(BuildService buildManager)
 {
     this.buildManager = buildManager;
     this.InitializeComponent();
 }