-
Notifications
You must be signed in to change notification settings - Fork 564
[One .NET] Fix targeting API 33, build API 31 ref pack #6896
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
Merged
Conversation
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
1a1c110 to
6f2c4a0
Compare
Member
Author
|
Related: https://discord.com/channels/732297728826277939/732297837953679412/962024444342173727 This has an added benefit of making sure we don't miss bug fixes, without having to track all of them. |
17dd51e to
a5d51a7
Compare
...oid.Build.Tasks/Microsoft.Android.Sdk/input/Microsoft.Android.Sdk.BundledVersions.in.targets
Outdated
Show resolved
Hide resolved
...oid.Build.Tasks/Microsoft.Android.Sdk/input/Microsoft.Android.Sdk.BundledVersions.in.targets
Show resolved
Hide resolved
The Microsoft.Android `@(KnownFrameworkReference)` will now delcare
targeting and runtime pack metadata that is based on the
`$(TargetPlatformVersion)` of the project file. The only exception to
this rule is when '$(TargetPlatformVersion)' == '31.0'; in this case the
project will use an API 31 ref pack with API 32 runtime packs. The
inline `Microsoft.Android.Sdk.BundledVersions.targets` file content
has been moved into a separate file to improve the readability of the
`@(KnownFrameworkReference)` element.
Breakdown of supported `$(TargetFramework)` -> ref/runtime pack used:
| `$(TargetFramework)` | Targeting Pack | Runtime Pack |
| -------------------- | -------------- | ------------ |
| net6.0-android | Microsoft.Android.Ref.31 | Microsoft.Android.Runtime.32 |
| net6.0-android31.0 | Microsoft.Android.Ref.31 | Microsoft.Android.Runtime.32 |
| net6.0-android32.0 | Microsoft.Android.Ref.32 | Microsoft.Android.Runtime.32 |
| net6.0-android33.0 | Microsoft.Android.Ref.33 | Microsoft.Android.Runtime.33 |
Tests have been updated accordingly, and they will now use a dynamic
test case source that should make sure we don't miss any coverage when
making future updates to `$(AndroidDefaultTargetDotnetApiLevel)`,
`$(AndroidLatestStableApiLevel)`, and `$(AndroidLatestUnstableApiLevel)`.
If an unsupported `$(TargetFramework)` is used in a project file the
following errors will now be displayed:
"test.csproj" (_GenerateRestoreGraphProjectEntry target) (1:5) ->
(ProcessFrameworkReferences target) ->
C:\Program Files\dotnet\sdk\6.0.300-preview.22211.2\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(90,5): error : NETSDKZZZZ: Error getting pack version: Pack 'Microsoft.Android.Ref.25' was not present in workload manifests.
C:\Program Files\dotnet\sdk\6.0.300-preview.22211.2\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(90,5): error : NETSDKZZZZ: Error getting pack version: Pack 'Microsoft.Android.Runtime.25.android-arm' was not present in workload manifests.
C:\Program Files\dotnet\sdk\6.0.300-preview.22211.2\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(90,5): error : NETSDKZZZZ: Error getting pack version: Pack 'Microsoft.Android.Runtime.25.android-arm64' was not present in workload manifests.
C:\Program Files\dotnet\sdk\6.0.300-preview.22211.2\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(90,5): error : NETSDKZZZZ: Error getting pack version: Pack 'Microsoft.Android.Runtime.25.android-x86' was not present in workload manifests.
C:\Program Files\dotnet\sdk\6.0.300-preview.22211.2\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(90,5): error : NETSDKZZZZ: Error getting pack version: Pack 'Microsoft.Android.Runtime.25.android-x64' was not present in workload manifests.
Additionally, the build has been updated to produce a reference pack for
the API level declared in `$(AndroidDefaultTargetDotnetApiLevel)`, if it
is not the same as `$(AndroidLatestStableApiLevel)`. This will allow
the default `net6.0-android` target framework to use an up to date
Mono.Android.dll, instead of an older preview version from NuGet.org.
a5d51a7 to
7ebd498
Compare
jonathanpeppers
approved these changes
Apr 12, 2022
Member
jonathanpeppers
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 👍, assuming that CI ends up green.
grendello
approved these changes
Apr 12, 2022
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Fixes: #6914
The Microsoft.Android
@(KnownFrameworkReference)will now declaretargeting and runtime pack metadata that is based on the
$(TargetPlatformVersion)of the project file. The only exception tothis rule is when '$(TargetPlatformVersion)' == '31.0'; in this case the
project will use an API 31 ref pack with API 32 runtime packs. The
inline
Microsoft.Android.Sdk.BundledVersions.targetsfile contenthas been moved into a separate file to improve the readability of the
@(KnownFrameworkReference)element.Breakdown of supported
$(TargetFramework)-> ref/runtime pack used:$(TargetFramework)Tests have been updated accordingly, and they will now use a dynamic
test case source that should make sure we don't miss any coverage when
making future updates to
$(AndroidDefaultTargetDotnetApiLevel),$(AndroidLatestStableApiLevel), and$(AndroidLatestUnstableApiLevel).If an unsupported
$(TargetFramework)is used in a project file thefollowing errors will now be displayed:
Additionally, the build has been updated to produce a reference pack for
the API level declared in
$(AndroidDefaultTargetDotnetApiLevel), if itis not the same as
$(AndroidLatestStableApiLevel). This will allowthe default
net6.0-androidtarget framework to use an up to dateMono.Android.dll, instead of an older preview version from NuGet.org.