Exemplo n.º 1
0
        /// <summary>
        /// Execute the compiler.
        /// </summary>
        public static bool Execute(string[] args, TaskLoggingHelper msbuildLog)
        {
            var log = (msbuildLog != null) ? new MSBuildLog(msbuildLog) : null;

            if (log != null)
            {
                DLog.AddAdditionalLogger(log);
            }
            try
            {
                var options = new CommandLineOptions(args);
                if (options.ShowHelp)
                {
                    throw new ArgumentOutOfRangeException(options.GetUsage());
                }
#if DEBUG
                //Debugger.Launch();
#endif
                return(Program.MainCode(options));
            }
            finally
            {
                if (log != null)
                {
                    DLog.RemoveAdditionalLogger(log);
                }
            }
        }