Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 21 additions & 3 deletions src/XMakeBuildEngine/Definition/ToolsetReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
using Microsoft.Build.Execution;
using Microsoft.Build.Internal;
using Microsoft.Build.Shared;
using Microsoft.Build.Utilities;

using error = Microsoft.Build.Shared.ErrorUtilities;
using InvalidProjectFileException = Microsoft.Build.Exceptions.InvalidProjectFileException;
Expand Down Expand Up @@ -175,8 +176,25 @@ ToolsetDefinitionLocations locations

if (!string.IsNullOrEmpty(libraryPath))
{
var r = new Regex(libraryPath + Path.DirectorySeparatorChar + @"\d+\.\d+");
foreach (var d in Directory.GetDirectories(libraryPath).Where(d => r.IsMatch(d)))
// The 4.0 toolset is installed in the framework directory
var v4dir = ToolLocationHelper.GetPathToDotNetFramework (TargetDotNetFrameworkVersion.Version40);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: space before the method parameters.

if (v4dir != null)
{
toolsets.Add(
"4.0",
new Toolset(
"4.0",
v4dir,
environmentProperties,
globalProperties,
currentDir,
string.Empty));
}

// Other toolsets are installed in the xbuild directory
var xbuildToolsetsDir = Path.Combine(libraryPath, "mono", "xbuild");
var r = new Regex(xbuildToolsetsDir + Path.DirectorySeparatorChar + @"\d+\.\d+");
foreach (var d in Directory.GetDirectories(xbuildToolsetsDir).Where(d => r.IsMatch(d)))
{
var version = Path.GetFileName(d);
if (version != null && !toolsets.ContainsKey(version))
Expand All @@ -185,7 +203,7 @@ ToolsetDefinitionLocations locations
version,
new Toolset(
version,
d,
Path.Combine(d,"bin"),
environmentProperties,
globalProperties,
currentDir,
Expand Down