[release/6.0.4xx] [dotnet] Condition default inclusion on the target framework version. - #15197
Merged
rolfbjarne merged 2 commits intoJun 3, 2022
Conversation
One problem we hit when trying to build `net6.0-ios` projects from
a .NET 7 SDK & iOS workload, was that we ended up importing *two*
`AutoImport.props` files.
These are imported for any pack in `WorkloadManifest.json` declared as
an SDK:
"packs": {
"Microsoft.iOS.Sdk": {
"kind": "sdk",
So the way this has to work is that ny `<ItemGroup>` must be conditioned so
that `$(TargetFrameworkVersion)` matches the expected .NET SDK version.
I used `[MSBuild]::VersionEquals()` for all checks, because the value
is `v6.0` and the helper method properly handles this case for us.
When this change ships in a .NET 6 servicing release, we can then
update our .NET 7 packages to rely on this change.
This is equivalent to Android's change here:
dotnet/android@38b3fa6
Member
|
/azp run |
|
Azure Pipelines could not run because the pipeline triggers exclude this branch/path. |
dalexsoto
approved these changes
Jun 2, 2022
Collaborator
Author
Collaborator
Author
📋 [PR Build] API Diff 📋API Current PR diff✅ API Diff (from PR only) (no change) View dotnet API diffView dotnet legacy API diffAPI diff✅ API Diff from stable View dotnet API diffView dotnet legacy API diffGenerator diff✅ Generator Diff (no change) Pipeline on Agent XAMBOT-1096.Monterey' |
Collaborator
Author
💻 [PR Build] Tests on macOS Mac Catalina (10.15) passed 💻✅ All tests on macOS Mac Catalina (10.15) passed. Pipeline on Agent |
Collaborator
Author
💻 [PR Build] Tests on macOS M1 - Mac Big Sur (11.5) passed 💻✅ All tests on macOS M1 - Mac Big Sur (11.5) passed. Pipeline on Agent |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
One problem we hit when trying to build
net6.0-iosprojects froma .NET 7 SDK & iOS workload, was that we ended up importing two
AutoImport.propsfiles.These are imported for any pack in
WorkloadManifest.jsondeclared asan SDK:
So the way this has to work is that ny
<ItemGroup>must be conditioned sothat
$(TargetFrameworkVersion)matches the expected .NET SDK version.I used
[MSBuild]::VersionEquals()for all checks, because the valueis
v6.0and the helper method properly handles this case for us.When this change ships in a .NET 6 servicing release, we can then
update our .NET 7 packages to rely on this change.
This is equivalent to Android's change here:
dotnet/android@38b3fa6
Backport of #15196