-
Notifications
You must be signed in to change notification settings - Fork 554
[msbuild] Build the MSBuild task assemblies for netstandard2.0. #7706
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[msbuild] Build the MSBuild task assemblies for netstandard2.0. #7706
Conversation
New commits in xamarin/Xamarin.MacDev: * dotnet/macios-devtools@210c664 Adds net451 to Xamarin.MacDev.csproj * dotnet/macios-devtools@64db365 [winios] Changes provisioning profiles default path * dotnet/macios-devtools@d34430a Switch to short-form projects and build for both net461 and netstandard2.0. (dotnet#68) Diff: https://github.com/xamarin/Xamarin.MacDev/compare/0f578f51e63b6ff93014782dbc9378e6b6bc6d75..210c664e56117d3a1a7f6dd002109eb444dbdc17
The older version doesn't support netstandard2.0. No code changes were required.
Also unify/deduplicate the ILMerge logic between Xamarin.iOS and Xamarin.Mac.
…sts for both netstandard2.0 and net461. Use custom project configurations to support running the tests for when the tasks assembly is built for netstandard2.0 and net461.
…oth netstandard2.0 and net461.
…er netstandard2.0 or net461.
|
Build failure Test results52 tests failed, 38 tests passed.Failed tests
|
Ask MSBuild to copy lib assemblies to the output folder when building for netstandard2.0, this way we can easily find the actual implementation libraries to pass to ILRepack.
|
Build failure Test results29 tests failed, 61 tests passed.Failed tests
|
|
Build success |
VincentDondain
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
|
Test failures are unrelated
|
| <NetstandardDirectory>@(NetstandardPath)</NetstandardDirectory> | ||
| </PropertyGroup> | ||
| <!-- The assemblies are in a very different place when building for netstandard2.0, which means we need different logic to find them too --> | ||
| <ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be $(TargetFramework.StartsWith('netstandard')) instead to make it more future-proof?
| <MergedAssemblies Include="@(ReferencePath)" Condition="'%(FileName)' == 'Mono.Posix.NETStandard'" /> | ||
| <MergedAssemblies Include="@(ReferencePath)" Condition="'%(Extension)' == '.dll' And $([System.String]::new('%(FileName)').StartsWith('Mono.Cecil', StringComparison.OrdinalIgnoreCase))" /> | ||
| </ItemGroup> | ||
| <ItemGroup Condition="'$(TargetFramework)' == 'net461'"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto here, $(TargetFramework.StartsWith('net4'))? (since VSM and most other libs are already starting to target net472 instead?)
| </ItemGroup> | ||
| <ItemGroup Condition="'$(TargetFramework)' == 'net461'"> | ||
| <MergedAssemblies Include="@(ReferenceCopyLocalPaths)" Condition="'%(Extension)' == '.dll' | ||
| And !$([System.String]::new('%(FileName)').EndsWith('.resources', StringComparison.OrdinalIgnoreCase)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I usually prefer [MSBuild]::ValueOrDefault which doesn't incur a string allocation. In this case, it would be: !$([MSBuild]::ValueOrDefault('%(FileName)', '').EndsWith('.resources', StringComparison.OrdinalIgnoreCase)).
See dotnet/msbuild#4615 for more context too.
|
Sorry for the late review @rolfbjarne, but they are minor improvements anyway. 👍 |
According to review of dotnet#7706.
|
@kzu,
Thanks! Suggested edits: Fixed in #7790. |
According to review of #7706.
This is a necessary step towards making the task assemblies work with .NET 5.
The old code (to build for net461) is still present, and it's easy to switch
back if need be. Eventually the old code should be removed.
Best reviewed commit-by-commit.