Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add ObsoletedInOSPlatform Attribute support in Platform Compat Analyzer #6081

Closed
buyaa-n opened this issue Jul 22, 2022 · 0 comments · Fixed by #6082
Closed

Add ObsoletedInOSPlatform Attribute support in Platform Compat Analyzer #6081

buyaa-n opened this issue Jul 22, 2022 · 0 comments · Fixed by #6082

Comments

@buyaa-n
Copy link
Contributor

buyaa-n commented Jul 22, 2022

Platform Compatibility Analyzer

Diagnostic ID: CA1416

Describe the improvement

We have added ObsoletedInOSPlatform Attribute in 7.0 recently, now need to add the analyzer support for this in PlatformCompatibilityAnalyzer. By the approved API the warnings for obsoleted should have different diagnostic ID, optional message and url properties that should be appended to the existing message. Plus optional message property is added to the UnsupportedOSPlatform attribute which also needs update in the analyzer

Other scenarios/expectations not mentioned in the API Review:

  1. Call sites having ObsoletedInOSPlatform or UnsupportedOSPlatform attributes with greater than or equal version could suppress obsoleted warnings
  2. Same as unsupported attribute diagnostic the obsoleted diagnostics could be guarded with negated OperatingSystem APIs (for example: if (!OperatingSystem.IsLinux())
  3. Also could be guarded with an API that annotated with UnsupportedOSPlatformGuard attribute having matching platform/version, same for negated SupportedOSPlatformGuard
  4. No warning if the obsoleted platform and version is not in the call site supported range. Same as UnsupportedOSPlatform no warning for cross platform build in case the platform is not included in MSBuild SupportedPlatforms list
  5. Warning message structure is same as the existing warnings, user message and/or Url will be appended at the end of each platform/version
  6. MacOS == OSX and iOS is MacCatalyst relations would work same as how it does for unsupported scenarios

CC @jeffhandley @terrajobst @rolfbjarne

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant