b3079db44e
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. |
||
---|---|---|
.. | ||
ConfigureLocalWorkload.targets | ||
Directory.Build.props | ||
Directory.Build.targets | ||
Icon.png | ||
License.targets | ||
Microsoft.Android.Ref.proj | ||
Microsoft.Android.Runtime.proj | ||
Microsoft.Android.Sdk.proj | ||
Microsoft.NET.Sdk.Android.proj | ||
SignList.xml | ||
SignVerifyIgnore.txt | ||
linux-README.md | ||
vs-workload.in.props |