Conan is a lightweight fork of the .NET Compiler Platform ("Roslyn") by adding a compiler plugin infrastructure. These plugins can be deployed and installed as regular Diagnostic Analyzers.
This repository is under construction, a documentation will follow in the coming weeks
netstandard1.3
libraryConan.CodeAnalysis
package (alpha5+
)Create a new class an inherit from CompilationRewriter
. See HelloWorld
plugin example
[DiagnosticAnalyzer(LanguageNames.CSharp)]
public class MyCompilationRewriter : CompilationRewriter
{
public override Compilation Rewrite(CompilationRewriterContext context)
{
var compilation = context.Compilation;
// Transform compilation
...
return compilation;
}
}
Conan.Net.Compilers
to your project: This will make the Conan compiler as the default CSharp/VB compiler and replace the default Roslyn compiler (This package works for both Full framework and Core framework unlike the Roslyn packages)<ItemGroup>
<Analyzer Include="..\Conan.Plugin.HelloWorld\bin\$(Configuration)\netstandard1.3\Conan.Plugin.HelloWorld.dll" />
</ItemGroup>
AnalyzerPack
)Their are 2 fundamental root packages in Conan:
Roslyn | Conan | NuGet |
---|---|---|
Microsoft.Net.Compilers Microsoft.NETCore.Compilers |
Conan.Net.Compilers | |
Microsoft.CodeAnalysis | Conan.CodeAnalysis | |
• Microsoft.CodeAnalysis.Common | • Conan.CodeAnalysis.Common | |
• Microsoft.CodeAnalysis.CSharp | • Conan.CodeAnalysis.CSharp | |
• Microsoft.CodeAnalysis.CSharp.Workspaces | • Conan.CodeAnalysis.CSharp.Workspaces | |
• Microsoft.CodeAnalysis.VisualBasic | • Conan.CodeAnalysis.VisualBasic | |
• Microsoft.CodeAnalysis.VisualBasic.Workspaces | • Conan.CodeAnalysis.VisualBasic.Workspaces | |
• Microsoft.CodeAnalysis.Workspaces.Common | • Conan.CodeAnalysis.Workspaces.Common |
All the people involved behind the .NET Compiler Platform ("Roslyn"). Conan is a very little addition to the huge work already done there.
The logo is called Lion created by Jennifer Keana from the Noun Project
Same license than Roslyn: Apache-2.0
Alexandre MUTEL aka xoofx