Skip to content

Commit

Permalink
[Xamarin.ProjectTools] check for /msbuild/ in $(FrameworkSdkRoot) (do…
Browse files Browse the repository at this point in the history
…tnet#2731)

Downstream in monodroid, we are still seeing a failure in
`NetStandardReferenceTest`:

    Using $(FrameworkSDKRoot): /Library/Frameworks/Mono.framework/Versions/5.18.0/lib/mono/
    [TESTLOG] Test NetStandardReferenceTest Complete
    ...
    Microsoft.NET.Sdk not found:

But if I test on my machine `$(FrameworkSDKRoot)` is:

    /Library/Frameworks/Mono.framework/Versions/5.18.0/lib/mono/msbuild/

Both the build machine and mine have the same version of Mono.

I think we should just make sure the path we are using includes
`/msbuild/` and append the directory if needed.

Other change:

* On Windows, it was always logging `Using $(FrameworkSDKRoot): `. So
  let's not log that if it is blank.
  • Loading branch information
jonathanpeppers authored and dellis1972 committed Feb 13, 2019
1 parent 7b9df1f commit 23c3005
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,18 @@ public Builder ()
process.WaitForExit ();
frameworkSDKRoot = process.StandardOutput.ReadToEnd ().Trim ();
}

//NOTE: some machines aren't returning /msbuild/ on the end
// macOS should be /Library/Frameworks/Mono.framework/Versions/5.18.0/lib/mono/msbuild/
var dir = Path.GetFileName (frameworkSDKRoot.TrimEnd (Path.DirectorySeparatorChar));
if (dir != "msbuild") {
var path = Path.Combine (frameworkSDKRoot, "msbuild");
if (Directory.Exists (path))
frameworkSDKRoot = path;
}
}
Console.WriteLine ($"Using $(FrameworkSDKRoot): {frameworkSDKRoot}");
if (!string.IsNullOrEmpty (frameworkSDKRoot))
Console.WriteLine ($"Using $(FrameworkSDKRoot): {frameworkSDKRoot}");
}

public void Dispose ()
Expand Down

0 comments on commit 23c3005

Please sign in to comment.