Skip to content
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

[Xamarin.Android.Build.Tasks] remove checks for $(UsingAndroidNETSdk) #8647

Merged
merged 1 commit into from
Jan 19, 2024

Conversation

jonathanpeppers
Copy link
Member

In .NET 6+, $(UsingAndroidNETSdk) is always true as the general identifier that this project is .NET and not Xamarin.Android. We used this flag as a way to share code between .NET Android and Xamarin.Android.

  • Remove checks for $(UsingAndroidNETSdk)

  • No longer need to pass in this value to MSBuilds tasks or other C# classes

  • Checks if true leave in place, and remove the condition

  • Checks if false can just be completely removed now

In a future PR, we may also be able to remove $(_AndroidIsBindingProject), which is slightly related. We removed the "binding project" as a concept in .NET 6+.

I left the $(UsingAndroidNETSdk) property in place, even though it is not used in these targets. Other general MSBuild targets may continue to use it in perpetuity.

In .NET 6+, `$(UsingAndroidNETSdk)` is always `true` as the general
identifier that this project is .NET and not Xamarin.Android. We used
this flag as a way to share code between .NET Android and
Xamarin.Android.

* Remove checks for `$(UsingAndroidNETSdk)`

* No longer need to pass in this value to MSBuilds tasks or other C#
  classes

* Checks if `true` leave in place, and remove the condition

* Checks if `false` can just be completely removed now

In a future PR, we may also be able to remove
`$(_AndroidIsBindingProject)`, which is slightly related. We removed the
"binding project" as a concept in .NET 6+.

I left the `$(UsingAndroidNETSdk)` property in place, even though it is
not used in these targets. Other general MSBuild targets may continue to
use it in perpetuity.
@jonathanpeppers
Copy link
Member Author

Ignore the MAUI lane for now, I think their build is broken:

C:\a\_work\3\s\maui\src\Core\src\Platform\Tizen\StackNavigationManager.cs(73,25): error CA1859: Change type of variable 'newPageStack' from 'System.Collections.Generic.IReadOnlyList<Microsoft.Maui.IView>' to 'System.Collections.Generic.List<Microsoft.Maui.IView>' for improved performance (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1859) [C:\a\_work\3\s\maui\src\Core\src\Core.csproj::TargetFramework=net9.0-tizen]
C:\a\_work\3\s\maui\src\Core\src\Platform\Windows\StackNavigationManager.cs(65,25): error CA1859: Change type of variable 'newPageStack' from 'System.Collections.Generic.IReadOnlyList<Microsoft.Maui.IView>' to 'System.Collections.Generic.List<Microsoft.Maui.IView>' for improved performance (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1859) [C:\a\_work\3\s\maui\src\Core\src\Core.csproj::TargetFramework=net9.0-windows10.0.20348]
C:\a\_work\3\s\maui\src\Core\src\Platform\Windows\StackNavigationManager.cs(65,25): error CA1859: Change type of variable 'newPageStack' from 'System.Collections.Generic.IReadOnlyList<Microsoft.Maui.IView>' to 'System.Collections.Generic.List<Microsoft.Maui.IView>' for improved performance (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1859) [C:\a\_work\3\s\maui\src\Core\src\Core.csproj::TargetFramework=net9.0-windows10.0.19041]

@jonathanpeppers jonathanpeppers merged commit c008eb5 into dotnet:main Jan 19, 2024
45 of 47 checks passed
@jonathanpeppers jonathanpeppers deleted the UsingAndroidNETSdk branch January 19, 2024 13:59
grendello added a commit that referenced this pull request Jan 19, 2024
* main:
  Localized file check-in by OneLocBuild Task (#8652)
  Bump to xamarin/xamarin-android-tools/main@b175674 (#8644)
  [Xamarin.Android.Build.Tasks] remove checks for `$(UsingAndroidNETSdk)` (#8647)
grendello added a commit that referenced this pull request Jan 25, 2024
* main:
  Localized file check-in by OneLocBuild Task (#8668)
  [Xamarin.Android.build.Tasks] `<CheckDuplicateJavaLibraries/>` ignores `repackaged.jar` (#8664)
  LEGO: Merge pull request 8665
  [Xamarin.Android.Build.Tasks] parse JDK `release` file directly (#8663)
  Bump to dotnet/installer@f91d4ca399 9.0.100-alpha.1.24070.3 (#8635)
  [.github] Re-enable locking issues after 30 days of inactivity (#8655)
  Localized file check-in by OneLocBuild Task (#8657)
  LEGO: Merge pull request 8656
  Localized file check-in by OneLocBuild Task (#8652)
  Bump to xamarin/xamarin-android-tools/main@b175674 (#8644)
  [Xamarin.Android.Build.Tasks] remove checks for `$(UsingAndroidNETSdk)` (#8647)
  [Xamarin.Android.Build.Tasks] XA1039 error for Android.Support (#8629)
@github-actions github-actions bot locked and limited conversation to collaborators Feb 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants