Unity-Technologies / ProjectAuditor

Project Auditor is an experimental static analysis tool for Unity Projects.
Other
795 stars 64 forks source link

Unsupported api usage detection #128

Closed mtrive closed 1 year ago

mtrive commented 1 year ago

Problem statement There are APIs that are not supported on specific platforms. Unfortunately, the Unity Editor does not warn about them so the user will likely run into build/runtime issues.

Solution Add support for such diagnostics that inform the user about any unsupported API. Note that with this PR, Project Auditor will only report UnityEngine.Microphone API usage on WebGL, as a first diagnostic of this kind. Other can be added later.

mtrive commented 1 year ago

This looks good.

I assume, just by looking at the tests, that the "CodeAnalysis_PlatformIssue_IsNotReported" test works because on the projects where we run the TestRunner (Windows or Mac possibly) the "WebGL" platform is definitely not set as the current platform (unless the user sets up such a WebGL project).

That's correct. I guess a comment to explain that would not hurt.