KirillOsenkov / RoslynQuoter

Roslyn tool that for a given C# program shows syntax tree API calls to construct its syntax tree
http://roslynquoter.azurewebsites.net
Apache License 2.0
918 stars 118 forks source link

PackAsTool / ToolCommandName #53

Open jzabroski opened 4 years ago

jzabroski commented 4 years ago

@KirillOsenkov Given the inputs to Program.cs are hardcoded (#52), once this is fixed, it makes sense to package RoslynQuoter as a .NET Core CLI Tool. Doing would also therefore require packaging it as a netcoreapp3.1 TargetFramework in additional to legacy .NET Framework.

https://github.com/KirillOsenkov/RoslynQuoter/blob/f21851342cf0467b7fb75b8258c842ffadcdc37b/src/Quoter/Quoter.csproj#L3-L7

Suggested XML:

<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.1' ">
  <PackAsTool>true</PackAsTool>
  <ToolCommandName>dotnet-quote</ToolCommandName>
</PropertyGroup>
GrahamTheCoder commented 4 years ago

In case someone works on this, if you want to support loading files from .NET Framework projects, you can copy what I did in the ICSharpCode CodeConverter: https://github.com/icsharpcode/CodeConverter/pull/556/files#diff-f0ba4035427169d7318d6227b74de3e8R25 Basically check if there's a Visual Studio MSBuild version, and if so, start a framework process and redirect the output back to the core app. Thanks for the great tool Kirill!