Repository navigation
Daml bindings generated at dotnet build, no JDK required #126
monsieurleberre
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
The Canton .NET SDK used to need a separate
dpm codegen-csstep (and a JDK) to turn a DAR into C#. Since 0.7.1,Daml.Codegen.CSharp.MSBuilddoes it insidedotnet build.Add the packages:
Point a
<DamlArchive>item at a DAR in your project file:Or point a
<DamlProject>item at the directory that holds a Daml project'sdaml.yaml, and the build runsdpm buildfirst:The bindings land under
obj/and compile into the project. This is how the mini-demo's contracts project is set up: a<DamlProject Include="../../daml" />item plus aPackageReferencetoDaml.Codegen.CSharp.MSBuildwithPrivateAssets="all".Two modes
DamlCodegenModeStandalone(default)Dpmdpm codegen-cs, pinned to the package's version and bundle digestPATHStandalone reads Daml-LF 2.1 to 2.4 and 2.5-rc1. A DAR built for Daml-LF 1.x (Daml Finance, for example) or for another 2.x minor fails the build with a message pointing you to Dpm mode, which decodes them:
A
<DamlProject>item needs dpm in both modes, because dpm builds the DAR; without it the build fails withDAML0001, and a faileddpm buildwithDAML0002. A project takes one<DamlArchive>or<DamlProject>item, so put each DAR in its own .NET project. The package README lists the other properties.Regenerating also deletes the files an earlier run wrote and the new run no longer emits, so a renamed template does not leave its old bindings behind.
Tell us how it went and anything you'd improve. Bugs are easiest to track as issues.
All reactions