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:
authorLluis Sanchez <llsan@microsoft.com>2018-04-16 11:22:06 +0300
committerGitHub <noreply@github.com>2018-04-16 11:22:06 +0300
commit6dda883bd60ddcb086d94b72f9e2d2ea27e56ec3 (patch)
tree1391fbd341bcfa579250863a8598dc90bcc9fb53 /main/src/core
parent2889effed1956f7ff2608a5a4180d239436e18c9 (diff)
parentdb71cb635cb4d1a82bafaec63c65f1b935b80be8 (diff)
Merge pull request #4563 from mono/msbuild-items-added-for-globs-with-link-metadata
[Core] Fix MSBuild items added for globs with link metadata
Diffstat (limited to 'main/src/core')
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildValueType.cs5
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Project.cs10
2 files changed, 8 insertions, 7 deletions
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildValueType.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildValueType.cs
index 2e548ef0ed..32fa107420 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildValueType.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildValueType.cs
@@ -45,6 +45,7 @@ namespace MonoDevelop.Projects.MSBuild
class PathValueType: MSBuildValueType
{
static readonly char [] pathSep = { '\\' };
+ static string currentDirectoryPrefix = @".\";
public override bool Equals (string ob1, string ob2)
{
@@ -52,6 +53,10 @@ namespace MonoDevelop.Projects.MSBuild
return true;
if (ob1 == null || ob2 == null)
return string.IsNullOrEmpty (ob1) && string.IsNullOrEmpty (ob2);//Empty or null path is same thing
+ if (ob1.StartsWith (currentDirectoryPrefix, StringComparison.OrdinalIgnoreCase))
+ ob1 = ob1.Substring (currentDirectoryPrefix.Length);
+ if (ob2.StartsWith (currentDirectoryPrefix, StringComparison.OrdinalIgnoreCase))
+ ob2 = ob2.Substring (currentDirectoryPrefix.Length);
return ob1.TrimEnd (pathSep) == ob2.TrimEnd (pathSep);
}
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Project.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Project.cs
index a4e245a69a..95689a7e84 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Project.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Project.cs
@@ -3754,7 +3754,6 @@ namespace MonoDevelop.Projects
{
// Compare only metadata, since item name and include can't change
- MSBuildEvaluationContext context = null;
var n = 0;
foreach (var p in item.Metadata.GetProperties ()) {
var p2 = evalItem.Metadata.GetProperty (p.Name);
@@ -3763,12 +3762,7 @@ namespace MonoDevelop.Projects
if (!p.ValueType.Equals (p.Value, p2.UnevaluatedValue)) {
if (p2.UnevaluatedValue != null && p2.UnevaluatedValue.Contains ('%')) {
// Check evaluated value is a match.
- if (context == null) {
- context = new MSBuildEvaluationContext ();
- context.InitEvaluation (MSBuildProject);
- }
- string value = context.Evaluate (p.UnevaluatedValue);
- if (!p.ValueType.Equals (p.Value, value))
+ if (!p.ValueType.Equals (p.Value, p2.Value))
return false;
} else
return false;
@@ -3797,6 +3791,8 @@ namespace MonoDevelop.Projects
if (p2 == null || !p.ValueType.Equals (p.Value, p2.UnevaluatedValue)) {
if (generateNewUpdateItem)
continue;
+ if (p2?.UnevaluatedValue != null && p2.UnevaluatedValue.Contains ('%') && p.ValueType.Equals (p.Value, p2.Value))
+ continue;
if (updateItem == null) {
updateItems = FindUpdateItemsForItem (globItem, item.Include).ToList ();
updateItem = updateItems.LastOrDefault ();