Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Project.cs')
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Project.cs38
1 files changed, 6 insertions, 32 deletions
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Project.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Project.cs
index 81781f78c8..a4e245a69a 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Project.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Project.cs
@@ -228,7 +228,7 @@ namespace MonoDevelop.Projects
if (creationContext != null && creationContext.Project != null)
FileName = creationContext.Project.FileName;
- MSBuildEngineSupport = MSBuildProjectService.GetMSBuildSupportForProject (this);
+ sourceProject.UseMSBuildEngine = MSBuildProjectService.UseMSBuildEngineForProject (this);
InitFormatProperties ();
}
@@ -397,6 +397,7 @@ namespace MonoDevelop.Projects
}
}
+ [Obsolete]
public MSBuildSupport MSBuildEngineSupport { get; private set; }
protected override void OnModified (SolutionItemModifiedEventArgs args)
@@ -419,8 +420,7 @@ namespace MonoDevelop.Projects
{
if (sourceProject == null || sourceProject.IsNewProject) {
sourceProject = await MSBuildProject.LoadAsync (FileName).ConfigureAwait (false);
- if (MSBuildEngineSupport == MSBuildSupport.NotSupported)
- sourceProject.UseMSBuildEngine = false;
+ sourceProject.UseMSBuildEngine = MSBuildProjectService.UseMSBuildEngineForProject (this);
sourceProject.Evaluate ();
}
@@ -1242,7 +1242,7 @@ namespace MonoDevelop.Projects
async Task<TargetEvaluationResult> RunMSBuildTarget (ProgressMonitor monitor, string target, ConfigurationSelector configuration, TargetEvaluationContext context)
{
- if (CheckUseMSBuildEngine (configuration)) {
+ if (MSBuildProject.UseMSBuildEngine) {
var includeReferencedProjects = context != null ? context.LoadReferencedProjects : false;
var configs = GetConfigurations (configuration, includeReferencedProjects);
@@ -1577,25 +1577,6 @@ namespace MonoDevelop.Projects
#endregion
- /// <summary>Whether to use the MSBuild engine for the specified item.</summary>
- internal bool CheckUseMSBuildEngine (ConfigurationSelector sel, bool checkReferences = true)
- {
- // if the item mandates MSBuild, always use it
- if (MSBuildEngineSupport.HasFlag (MSBuildSupport.Required))
- return true;
- // if the user has set the option, use the setting
- if (UseMSBuildEngine.HasValue)
- return UseMSBuildEngine.Value;
-
- // If the item type defaults to using MSBuild, only use MSBuild if its direct references also use MSBuild.
- // This prevents a not-uncommon common error referencing non-MSBuild projects from MSBuild projects
- // NOTE: This adds about 11ms to the load/build/etc times of the MonoDevelop solution. Doing it recursively
- // adds well over a second.
- return MSBuildEngineSupport.HasFlag (MSBuildSupport.Supported) && (
- !checkReferences || GetReferencedItems (sel).OfType<Project>().All (i => i.CheckUseMSBuildEngine (sel, false))
- );
- }
-
bool requiresMicrosoftBuild;
internal protected bool RequiresMicrosoftBuild {
@@ -1751,13 +1732,6 @@ namespace MonoDevelop.Projects
AddFile (newDir);
return newDir;
}
-
- //HACK: the build code is structured such that support file copying is in here instead of the item handler
- //so in order to avoid doing them twice when using the msbuild engine, we special-case them
- bool UsingMSBuildEngine (ConfigurationSelector sel)
- {
- return CheckUseMSBuildEngine (sel);
- }
protected override async Task<BuildResult> OnBuild (ProgressMonitor monitor, ConfigurationSelector configuration, OperationContext operationContext)
{
@@ -1776,7 +1750,7 @@ namespace MonoDevelop.Projects
StringParserService.Properties["Project"] = Name;
- if (UsingMSBuildEngine (configuration)) {
+ if (MSBuildProject.UseMSBuildEngine) {
// Build is always a long operation. Make sure we build the project in the right builder.
context.BuilderQueue = BuilderQueue.LongOperations;
var result = await RunMSBuildTarget (monitor, "Build", configuration, context);
@@ -2142,7 +2116,7 @@ namespace MonoDevelop.Projects
return new TargetEvaluationResult (BuildResult.CreateSuccess ());
}
- if (UsingMSBuildEngine (configuration)) {
+ if (MSBuildProject.UseMSBuildEngine) {
// Clean is considered a long operation. Make sure we build the project in the right builder.
context.BuilderQueue = BuilderQueue.LongOperations;
return await RunMSBuildTarget (monitor, "Clean", configuration, context);