public ProjectFinder(TargetBuilder targetBuilder)
 {
     _namedValues = targetBuilder.NamedValues;
 }
예제 #2
0
		private void Build()
		{
			BuildDomain domain = null;
			BuildTarget[] targets = Check.NotEmpty(_config.Targets);

			try
            {
				foreach (BuildTarget target in targets)
				{
					if (!String.IsNullOrEmpty(_groups))
					{
						if (_groups.IndexOf(target.GroupName, StringComparison.OrdinalIgnoreCase) < 0 &&
							target.GroupName.IndexOf(_groups, StringComparison.OrdinalIgnoreCase) < 0)
							continue;
					}

					using (Log.Start("Target {0}, {1}, {2}", target.Toolset, target.Configuration, target.Platform))
					{
						if (domain == null || domain.ToolsVersion != target.Toolset)
						{
							if (domain != null) domain.Dispose();
                            domain = BuildDomain.CreateInstance(target.Toolset, _propertySets);
						}

						_errors += domain.Perform(new BuildTasks.SetContinue(_config.Options.ContinueOnError));
						if (_verbosity.HasValue)
							_errors += domain.Perform(new BuildTasks.ConsoleOutput(_verbosity.Value));

						TargetBuilder build = new TargetBuilder(_config, target, _propertySets, _targetNames);
						_errors += domain.Perform(build);
						_errors += domain.Perform(new UnloadAll());
					}

					if (_errors > 0 && !_config.Options.ContinueOnError)
						break;
				}
			}
			finally
			{
				if (domain != null)
					domain.Dispose();
			}
		}