Skip to content

Conversation

@jonathanpeppers
Copy link
Member

@jonathanpeppers jonathanpeppers commented Jan 28, 2025

Two files cause some confusion by existing in the repo:

  • Xamarin.Android.Sdk.props
  • Xamarin.Android.Sdk.targets

Neither are shipped in C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\, for example. They are effectively dead code.

If we remove them, this means more stuff can be removed:

  • @(XATargetsSrcFiles) item group

  • <SetVsMonoAndroidRegistryKey/> MSBuild task

  • create-vsix and create-pkg projects

  • Xamarin.Android.Bindings.Before.targets and Xamarin.Android.Bindings.After.targets

  • Xamarin.Android.Common.Before.targets and Xamarin.Android.Common.After.targets

Removing these files may improve MSBuild project evaluation time, as they are currently running several Exists() checks that always return false.

In the Xamarin.Android days, the XamarinVS Visual Studio extension layed down custom MSBuild targets files inside the Xamarin.Android installation to augment the build. This doesn't happen any more in .NET 6+, as they do not lay down files inside a .NET workload in C:\Program Files\dotnet\packs.

It wouldn't make sense to do so as Android workload updates would change the directory:

  • C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\35.0.7
  • C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\35.0.39

Note that I moved runtime-entitlements.plist to build-tools/installers/ as it is still used.

Two files cause some confusion by *existing* in the repo:

* `Xamarin.Android.Sdk.props`
* `Xamarin.Android.Sdk.targets`

Neither are shipped in `C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\`,
for example. They are effectively dead code.

If we remove them, this means more stuff can be removed:

* `@(XATargetsSrcFiles)` item group

* `<SetVsMonoAndroidRegistryKey/>` MSBuild task

* `create-vsix` and `create-pkg` projects

* `Xamarin.Android.Bindings.Before.targets` and `Xamarin.Android.Bindings.After.targets`

* `Xamarin.Android.Common.Before.targets` and `Xamarin.Android.Common.After.targets`

Removing these files may improve MSBuild project evaluation time, as
they are currently running several `Exists()` checks that always
return `false`.

In the Xamarin.Android days, the XamarinVS Visual Studio extension
layed down custom MSBuild targets files *inside* the Xamarin.Android
installation to augment the build. This doesn't happen any more in
.NET 6+, as they do not lay down files inside a .NET workload in
`C:\Program Files\dotnet\packs`. It wouldn't make sense to do so.

Note that I moved `runtime-entitlements.plist` to
`build-tools/installers/` as it is still used.
@jonathanpeppers jonathanpeppers marked this pull request as ready for review January 29, 2025 19:07
@jonathanpeppers jonathanpeppers merged commit cc35a26 into main Jan 29, 2025
58 checks passed
@jonathanpeppers jonathanpeppers deleted the dev/peppers/remove/old/stuff branch January 29, 2025 21:27
grendello added a commit that referenced this pull request Jan 29, 2025
* main:
  [build] remove unused Xamarin.Android files (#9719)
  [illink] Set default for `$(UseSizeOptimizedLinq) (#9718)
@github-actions github-actions bot locked and limited conversation to collaborators Mar 1, 2025
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.

4 participants