예제 #1
0
        static void Main(string[] args)
        {
            if (args.Length != 3)
             {
            System.Console.WriteLine("Wrong number of parameters passed to Builder.Console");
            Environment.ExitCode = -1;
            return;
             }

             Settings settings = new Settings();
             settings.LoadSettings();

             BuildLoader loader = new BuildLoader();
             Builder.Common.Builder builder = loader.Load(settings.BuildInstructions);

             // Run all steps.
             builder.StepStart = -1;
             builder.StepEnd = -1;

             builder.LoadMacros(args[0], args[1], args[2]);

             string result;
             if (!settings.ValidateSettings(builder, out result))
             {
            System.Console.WriteLine(result);
            Environment.ExitCode = -1;
            return;
             }

             builder.LoadSettings(settings);

             ManualResetEvent eventStopThread= new ManualResetEvent(false);
             ManualResetEvent eventThreadStopped= new ManualResetEvent(false);

             BuildRunner runner = new BuildRunner(eventStopThread, eventThreadStopped, builder);
             runner.StepError+= runner_StepError;
             builder.MessageLog += builder_MessageLog;
             runner.Run();

             return;
        }
예제 #2
0
        // Worker thread function.
        // Called indirectly from btnStartThread_Click
        private void ThreadEntryPoint()
        {
            BuildRunner worker = new BuildRunner(m_EventStopThread, m_EventThreadStopped, m_oBuilder);

             worker.StepCompleted += new BuildRunner.StepCompletedDelegate(worker_StepCompleted);
             worker.StepError += new BuildRunner.StepErrorDelegate(worker_StepError);
             worker.StepStarted += new BuildRunner.StepStartedDelegate(worker_StepStarted);
             worker.ThreadFinished += new BuildRunner.ThreadFinishedDelegate(worker_ThreadFinished);
             worker.Run();
        }