Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

C# Compiler Using Roslyn Analyzers with Incremental Compiler

Discussion in 'Experimental Scripting Previews' started by strich, Sep 5, 2018.

  1. strich

    strich

    Joined:
    Aug 14, 2012
    Posts:
    375
    Hi,

    Is anyone aware of whether Unity + Incremental Compiler currently supports Roslyn Analyzers via Nuget such as Sonar and ErrorProne.NET? We've had a brief try but things break and we're unsure how it would interact with the fact that the VS solution files get recreated all the time.

    Thoughts?
     
    Arkade likes this.
  2. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,053
  3. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    3,761
    So I'm bumping a bit of an old thread, but I wrote a library to add support for Roslyn Analyzers.

    https://github.com/tertle/com.bovinelabs.analyzers

    It comes bundled optionally with StyleCop because that is what I use, but you should be able to add any analyzer, just download the package from nuget and drop the dll in the directory and it'll be referred as an analyzers every time the project is generated. Also supports custom rulesets.

    (Incremental Compiler is not required as depreciated, just modern version of unity with .net 4.6 backend etc.)
     
    bddckr likes this.