rules_dotnet
rules_dotnet copied to clipboard
How to run DotNetCliTools as part of build?
We have a csproj file that contains this section. The result is that dotnet generates a MyProject.XmlSerializers.dll as well as a MyProject.dll. Is this possible in rules_dotnet?
<PropertyGroup>
<SGenTypes>Utils.XmlBindingUtils</SGenTypes>
<SGenProxyTypes>false</SGenProxyTypes>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Memory" Version="4.5.5" />
<PackageReference Include="Microsoft.XmlSerializer.Generator" Version="7.0.0" />
<DotNetCliToolReference Include="Microsoft.XmlSerializer.Generator" Version="7.0.0" />
</ItemGroup>
Thank you, Chris
This is not possible. You would have to create a custom genrule/rule for this. At some point I want add something similar to what rules_js has with js_run_binary where all tools in nuget packages are auto discovered.
That would be great. What I'm finding as I try to create my own genrule calling dotnet.exe is that it's difficult to pass /r parameters for the reference assemblies that have been built or provided by paket/rules_dotnet, and I'm a bit lost on how to do this. Without these assmblies the dotnet command fails. Do you have any pointers?
Resolved by https://github.com/bazel-contrib/rules_dotnet/pull/516 ?