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

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGustavo Guerra <gustavo@codebeside.org>2013-10-02 00:43:17 +0400
committerGustavo Guerra <gustavo@codebeside.org>2013-10-02 00:45:54 +0400
commit92eda1e2a6e5b4cbaecdfe1aa739b12bd328e9f1 (patch)
tree0021dc0f380a7b86152294549ba4feab163080d1 /mcs/class/Microsoft.Build.Engine
parent80dea22861a05291ead474944f27ab92f54cbdf2 (diff)
[xBuild] Fix use of properties in project references when those properties use MSBuildExtensionPath after expanded
Diffstat (limited to 'mcs/class/Microsoft.Build.Engine')
-rw-r--r--mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Import.cs19
1 files changed, 15 insertions, 4 deletions
diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Import.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Import.cs
index 653f4a80b23..351aea02087 100644
--- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Import.cs
+++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Import.cs
@@ -159,12 +159,23 @@ namespace Microsoft.Build.BuildEngine {
else
base_dir_info = new DirectoryInfo (Directory.GetCurrentDirectory ());
- IEnumerable<string> extn_paths = has_extn_ref ? GetExtensionPaths (project) : new string [] {null};
+ var importPaths = GetImportPathsFromString (project_attribute, project, base_dir_info);
+ var extensionPaths = GetExtensionPaths (project);
+
+ if (!has_extn_ref) {
+ foreach (var importPath in importPaths) {
+ foreach (var extensionPath in extensionPaths) {
+ has_extn_ref = has_extn_ref || importPath.IndexOf (extensionPath) >= 0;
+ }
+ }
+ }
+
+ IEnumerable<string> extn_paths = has_extn_ref ? extensionPaths : new string [] { null };
bool import_needed = false;
var currentLoadSettings = project.ProjectLoadSettings;
-
+
try {
- foreach (var settings in new ProjectLoadSettings [] { ProjectLoadSettings.None, currentLoadSettings}) {
+ foreach (var settings in new ProjectLoadSettings [] { ProjectLoadSettings.None, currentLoadSettings }) {
foreach (string path in extn_paths) {
string extn_msg = null;
if (has_extn_ref) {
@@ -183,7 +194,7 @@ namespace Microsoft.Build.BuildEngine {
// We stop if atleast one file got imported.
// Remaining extension paths are *not* tried
bool atleast_one = false;
- foreach (string importPath in GetImportPathsFromString (project_attribute, project, base_dir_info)) {
+ foreach (string importPath in importPaths) {
try {
if (func (importPath, extn_msg))
atleast_one = true;