Пример #1
0
        public virtual void Initialize(BuildContext context)
        {
            if (_isInitialized)
            {
                return;
            }

            BuildExceptions.NotNull(context, "context");

            _context  = context;
            _settings = context.Settings;
            _logger   = context.Logger;

            if (_logger.IsInitialized == false)
            {
                _logger.Initialize(_context.BaseDirectory, _settings.HelpTitle);
            }

            //string workingDir = _settings.WorkingDirectory;
            //if (String.IsNullOrEmpty(workingDir))
            //{
            //    workingDir = Environment.CurrentDirectory;
            //}
            //else
            //{
            //    workingDir = Environment.ExpandEnvironmentVariables(workingDir);
            //    workingDir = Path.GetFullPath(workingDir);
            //}
            //if (String.IsNullOrEmpty(workingDir))
            //{
            //    return _isInitialized;
            //}
            //if (!Directory.Exists(workingDir))
            //{
            //    Directory.CreateDirectory(workingDir);
            //}
            //_settings.WorkingDirectory = workingDir;

            BuildEngineSettings engineSettings =
                _settings.EngineSettings[this.EngineType];

            Debug.Assert(engineSettings != null);
            if (engineSettings == null)
            {
                return;
            }
            _includeContent = engineSettings.IncludeContent;

            _isInitialized = true;
        }
Пример #2
0
        public override void Initialize(string logWorkingDir, string logTitle)
        {
            base.Initialize(logWorkingDir, logTitle);

            _totalWarnings = 0;
            _totalErrors   = 0;

            if (_listLoggers != null)
            {
                int itemCount = _listLoggers.Count;
                for (int i = 0; i < itemCount; i++)
                {
                    BuildLogger logger = _listLoggers[i];
                    logger.Initialize(logWorkingDir, logTitle);
                }
            }
        }