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 NuGet dependencies #8000

Merged

Conversation

jonathanpeppers
Copy link
Member

In classic Xamarin.Android, we used some NuGet libraries in the <ResolveAssemblies/> MSBuild task. We don't use this task at all in .NET 6+, so we can remove these going forward.

I removed:

  • NuGet dependencies

  • Remaining usage of <ResolveAssemblies/> MSBuild task.

  • Some tests for <ResolveAssemblies/> that used packages.config and did not run for .NET 6+.

  • The PackagesConfig NUnit category, as it is no longer used at all.

There is a decent file size saving from this change, just comparing a local debug build vs .NET 7:

(ls "C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\33.0.46\tools\Xamarin.Android.Build.Tasks.dll").Length
4493192
(ls "C:\src\xamarin-android\bin\Debug\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-ci.RemoveNuGetDependencies.273\tools\Xamarin.Android.Build.Tasks.dll").Length
2829824

Saves ~1.6MB from this assembly.

In classic Xamarin.Android, we used some NuGet libraries in the
`<ResolveAssemblies/>` MSBuild task. We don't use this task at all in
.NET 6+, so we can remove these going forward.

I removed:

* NuGet dependencies

* Remaining usage of `<ResolveAssemblies/>` MSBuild task.

* Some tests for `<ResolveAssemblies/>` that used `packages.config`
  and did not run for .NET 6+.

* The `PackagesConfig` NUnit category, as it is no longer used at all.

There is a decent file size saving from this change, just comparing
a local debug build vs .NET 7:

    (ls "C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\33.0.46\tools\Xamarin.Android.Build.Tasks.dll").Length
    4493192
    (ls "C:\src\xamarin-android\bin\Debug\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-ci.RemoveNuGetDependencies.273\tools\Xamarin.Android.Build.Tasks.dll").Length
    2829824

Saves ~1.6MB from this assembly.
@jonathanpeppers jonathanpeppers marked this pull request as ready for review April 28, 2023 19:19
@jonathanpeppers jonathanpeppers merged commit b18a26a into dotnet:main May 1, 2023
@jonathanpeppers jonathanpeppers deleted the RemoveNuGetDependencies branch May 1, 2023 13:33
grendello added a commit to grendello/xamarin-android that referenced this pull request May 4, 2023
* main:
  Bump to dotnet/installer@0ce891843a 8.0.100-preview.5.23228.7 (dotnet#7994)
  [ci] Automatically retry failed emulator tests. (dotnet#7997)
  [xaprepare] Combine 'AndroidTestDependencies' and 'EmulatorTestDependencies' scenarios. (dotnet#8006)
  [xaprepare] Provision 'platform-33_r02' (dotnet#8004)
  [Xamarin.Android.Build.Tasks] Add AndroidEnableRestrictToAttributes (dotnet#7990)
  [ci] Remove plots-to-appinsights. (dotnet#8002)
  [Xamarin.Android.Build.Tasks] remove NuGet dependencies (dotnet#8000)
  Bump to 33.0.56 $(AndroidNet7Version) (dotnet#7998)
  $(AndroidPackVersionSuffix)=preview.5; net8 is 34.0.0-preview.5 (dotnet#7996)
@github-actions github-actions bot locked and limited conversation to collaborators Jan 22, 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