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] introduce BannedApiAnalyzers for Mono.Cecil #8715

Merged
merged 1 commit into from
Feb 13, 2024

Conversation

jonathanpeppers
Copy link
Member

Context: https://github.com/dotnet/roslyn-analyzers/blob/68c643b4667c6808bd21910ef32f7e2f7bd776c5/src/Microsoft.CodeAnalysis.BannedApiAnalyzers/BannedApiAnalyzers.Help.md

In 526172b, we had some reasonable performance wins just by using TypeDefinitionCache. Let's take this a step further by "banning" usage of:

Mono.Cecil.FieldReference.Resolve()
Mono.Cecil.MethodReference.Resolve()
Mono.Cecil.TypeReference.Resolve()

I applied this change to Xamarin.Android.Build.Tasks.csproj for now.

In various places, I had to pass TypeDefinitionCache around or use an existing one.

In a future PR, I'll make a small change in xamarin/java.interop so we can apply the same treatment to Microsoft.Android.Sdk.ILLink.csproj.

…ecil

Context: https://github.com/dotnet/roslyn-analyzers/blob/68c643b4667c6808bd21910ef32f7e2f7bd776c5/src/Microsoft.CodeAnalysis.BannedApiAnalyzers/BannedApiAnalyzers.Help.md

In 526172b, we had some reasonable performance wins just by using
`TypeDefinitionCache`. Let's take this a step further by "banning"
usage of:

    Mono.Cecil.FieldReference.Resolve()
    Mono.Cecil.MethodReference.Resolve()
    Mono.Cecil.TypeReference.Resolve()

I applied this change to `Xamarin.Android.Build.Tasks.csproj` for now.

In various places, I had to pass `TypeDefinitionCache` around or use
an existing one.

In a future PR, I'll make a small change in xamarin/java.interop so we
can apply the same treatment to `Microsoft.Android.Sdk.ILLink.csproj`.
@jonpryor jonpryor merged commit 55b47f1 into dotnet:main Feb 13, 2024
47 checks passed
@jonathanpeppers jonathanpeppers deleted the BannedApiAnalyzers branch February 13, 2024 14:15
grendello added a commit that referenced this pull request Feb 13, 2024
* main:
  [Xamarin.Android.Build.Tasks] remove `$(AndroidSupportedAbis)` from `build.props` (#8717)
  [Xamarin.Android.Build.Tasks] BannedApiAnalyzers for Resolve() (#8715)
grendello added a commit that referenced this pull request Feb 13, 2024
* main:
  [Xamarin.Android.Build.Tasks] remove `$(AndroidSupportedAbis)` from `build.props` (#8717)
  [Xamarin.Android.Build.Tasks] BannedApiAnalyzers for Resolve() (#8715)
  Bump to xamarin/Java.Interop/main@dfcbd670 (#8714)
  [monodroid] C++ tweaks and legacy code cleanup (#8638)
  Bump to xamarin/xamarin-android-tools/main@a698a33 (#8710)
  [readme] Add `d17-8` download links. (#8709)
  Bump external/Java.Interop from `07c7300` to `7f08b77` (#8702)
  Bump to xamarin/monodroid@848d1277b7 (#8691)
  [Xamarin.Android.Build.Tasks] `FixAbstractMethodsStep` performance (#8650)
  Bump to dotnet/installer@fb7b9a4b9e 9.0.100-preview.2.24106.6 (#8700)
grendello added a commit that referenced this pull request Feb 14, 2024
* main: (116 commits)
  [tmt] Update to work with current `libxamarin-app.so` (#8694)
  [Xamarin.Android.Build.Tasks] remove `$(AndroidSupportedAbis)` from `build.props` (#8717)
  [Xamarin.Android.Build.Tasks] BannedApiAnalyzers for Resolve() (#8715)
  Bump to xamarin/Java.Interop/main@dfcbd670 (#8714)
  [monodroid] C++ tweaks and legacy code cleanup (#8638)
  Bump to xamarin/xamarin-android-tools/main@a698a33 (#8710)
  [readme] Add `d17-8` download links. (#8709)
  Bump external/Java.Interop from `07c7300` to `7f08b77` (#8702)
  Bump to xamarin/monodroid@848d1277b7 (#8691)
  [Xamarin.Android.Build.Tasks] `FixAbstractMethodsStep` performance (#8650)
  Bump to dotnet/installer@fb7b9a4b9e 9.0.100-preview.2.24106.6 (#8700)
  [Mono.Android] Cache `Profiles/api-34.xml` contents (#8679)
  [monodroid] typemaps may need to load assemblies (#8625)
  Bump $(AndroidNetPreviousVersion) to 34.0.79 (#8693)
  Bump to xamarin/java.interop/main@07c73009 (#8681)
  Bump to dotnet/installer@1c496970b7 9.0.100-preview.2.24078.1 (#8685)
  [GetAndroidDependencies] Add Jdk dependency info (#8651)
  [xaprepare] Add support for newer SparkyLinux (#8684)
  Bump to dotnet/installer@5680e93cb2 9.0.100-preview.2.24073.12 (#8666)
  $(AndroidPackVersionSuffix)=preview.2; net9 is 34.99.0.preview.2 (#8678)
  ...
@github-actions github-actions bot locked and limited conversation to collaborators Mar 15, 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