Browse Source

Prevent MSBuild from checking referenced projects for changes multiple times.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@2052 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 19 years ago
parent
commit
0958cffbba
  1. 10
      src/Main/Base/Project/Src/Project/MSBuildEngine.cs

10
src/Main/Base/Project/Src/Project/MSBuildEngine.cs

@ -381,6 +381,8 @@ namespace ICSharpCode.SharpDevelop.Project @@ -381,6 +381,8 @@ namespace ICSharpCode.SharpDevelop.Project
engine.GlobalProperties.SetProperty("SolutionFileName", Path.GetFileName(solution.FileName));
engine.GlobalProperties.SetProperty("SolutionPath", solution.FileName);
engine.GlobalProperties.SetProperty("BuildingInsideVisualStudio", "true");
return engine;
}
@ -397,6 +399,14 @@ namespace ICSharpCode.SharpDevelop.Project @@ -397,6 +399,14 @@ namespace ICSharpCode.SharpDevelop.Project
Project project = engine.CreateNewProject();
try {
project.Load(fileName);
// When we set BuildingInsideVisualStudio, MSBuild tries to build all projects
// every time because in Visual Studio, the host compiler does the change detection
// We override the property '_ComputeNonExistentFileProperty' which is responsible
// for recompiling each time - our _ComputeNonExistentFileProperty does nothing,
// which re-enables the MSBuild's usual change detection
project.Targets.AddNewTarget("_ComputeNonExistentFileProperty");
return project;
} catch (ArgumentException ex) {
currentResults.Result = BuildResultCode.BuildFileError;

Loading…
Cancel
Save