xamarin-android/build-tools
Dean Ellis b3079db44e
Add `DiagnosticSuppressor` to suppress the IDE0002 Style Hint in the IDE (#9310)
Context: https://github.com/dotnet/android/issues/8381

Add a `DiagnosticSuppressor` to "turn off" the `IDE0002` style
diagnostic message which incorrectly tells users to use the
`_Microsoft.Android.Resource.Designer.ResourceConstant` type directly.
This can cause allot of annoyance with our users because it appears on
EVERY single usage of `Resource.*`. So you end up with what looks like
code spagetti. 

So we need to start shipping an `Analyzer` assembly along with the
`Ref` framework pack. This is the place these things need to go.
Unfortunately it means that the older frameworks will not get this
analyzer. Only the current one. 

On the packaging side, the Analyzer assembly has to go in a
`analyzers/dotnet/<language>` folder in the .Ref Nuget Package. There
also needs to be an entry in the `FrameworkList.xml` file which has a
`Type="Analyzer" ` and a `Language="cs"`. This allows the IDE's to
pickup the code. We can ship both regular Analyzers and the
DiagnosticSuppressors in the same assembly. So we can extend this with
more if needed.

How this works is we use Rosyln to look for the IDE0002 diagnsotic
message, we then check the code and see if it is refering to a
`_Microsoft.Android.Resource.Designer.*` derived class. If it is , we
add a suppression. This will stop the hint appearing in the IDE. I
have tested this on VS in devbox and it appears to work . 

Also we generate a Resource Designer assembly and an Intermediate
source file at build time. Both of these contain classes which should
have the `GeneratedCode` Attribute. So lets add it. The version will
be the same as the build assembly used to generate it.
2024-09-30 16:09:12 -05:00
..
Xamarin.Android.Tools.BootstrapTasks
api-merge
api-xml-adjuster
automation
banned-apis
check-boot-times
create-android-api
create-packs Add `DiagnosticSuppressor` to suppress the IDE0002 Style Hint in the IDE (#9310) 2024-09-30 16:09:12 -05:00
create-pkg
create-vsix
debian-metadata
enumification-helpers
gradle [Xamarin.Android.Build.Tasks] Add @(AndroidGradleProject) action (#9270) 2024-09-25 11:16:51 -04:00
installers [Xamarin.Android.Build.Tasks] Add @(AndroidGradleProject) action (#9270) 2024-09-25 11:16:51 -04:00
jnienv-gen
license-data
manifest-attribute-codegen
plots-to-appinsights
scripts [build] add feeds to fix `MAUI Integration` (#9344) 2024-09-30 10:36:01 -05:00
trim-analyzers
wrap.sh
xa-prep-tasks
xaprepare