示例#1
0
        public StepResults Compile(string revision, string configFile)
        {
            this.revision = revision;

            Stopwatch sw = new Stopwatch();

            sw.Start();

            StepResults sr = new StepResults();

            sr.Command = "monocompiler";

            // Create a log file


            try {
                // Load the configuration file
                XmlDocument doc = new XmlDocument();
                doc.Load(configFile);

                queue = new SerialWorkQueue(doc);

                List <Thread> threads = new List <Thread> ();

                for (int i = 0; i < 1; i++)
                {
                    Thread t = new Thread(new ThreadStart(WorkerThread));
                    threads.Add(t);
                    t.Start();
                }

                foreach (Thread t in threads)
                {
                    t.Join();
                }

                // Report results
                sr.ExitCode = 0;
                sb.AppendLine("Done");
            } catch (Exception ex) {
                //Console.WriteLine (ex.ToString ());
                sr.ExitCode = 1;
                sb.AppendFormat("MonoCompiler Error:\n{0}\n", ex.ToString());
            }

            sw.Stop();
            //Console.WriteLine (sw.Elapsed);
            sr.ExecutionTime = sw.Elapsed;
            sr.Log           = sb.ToString();

            return(sr);
        }
示例#2
0
        public StepResults Compile(string revision, string configFile)
        {
            this.revision = revision;

            Stopwatch sw = new Stopwatch ();
            sw.Start ();

            StepResults sr = new StepResults ();
            sr.Command = "monocompiler";

            // Create a log file

            try {
                // Load the configuration file
                XmlDocument doc = new XmlDocument ();
                doc.Load (configFile);

                queue = new SerialWorkQueue (doc);

                List<Thread> threads = new List<Thread> ();

                for (int i = 0; i < 1; i++) {
                    Thread t = new Thread (new ThreadStart (WorkerThread));
                    threads.Add (t);
                    t.Start ();
                }

                foreach (Thread t in threads)
                    t.Join ();

                // Report results
                sr.ExitCode = 0;
                sb.AppendLine ("Done");
            } catch (Exception ex) {
                //Console.WriteLine (ex.ToString ());
                sr.ExitCode = 1;
                sb.AppendFormat ("MonoCompiler Error:\n{0}\n", ex.ToString ());
            }

            sw.Stop ();
            //Console.WriteLine (sw.Elapsed);
            sr.ExecutionTime = sw.Elapsed;
            sr.Log = sb.ToString ();

            return sr;
        }