Beispiel #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);
                }
            }
        }
Beispiel #2
0
        /// <summary>
        /// Make sure this log is registered.
        /// </summary>
        internal static void EnsureLoaded(IIde ide)
        {
            if (log != null)
            {
                return;
            }
            var outputPane = ide.CreateDebugOutputPane();
            var add        = false;

            lock (logLock)
            {
                if (log == null)
                {
                    log = new OutputPaneLog(outputPane);
                    add = true;
                }
            }
            if (add)
            {
                DLog.AddAdditionalLogger(log);
            }
        }