Setting project-root for daml codegen java
- FrankieOP
Is there anyway to specify the
--project-rootpath fordaml codegen java? I put codegen configuration in daml.yam file and use maven to invoke thedaml codegen. However it only searches the current folder for daml.yaml file and I cannot pass the--project-root. It will be handy to have--project-rootoption likedaml build. - cocreature
The
--project-rootoption is specific to the DAML Compiler and even for that it suffers from some issues, see Why does --project-root not pick up the SDK version of the project?.What you can use with every tool is to set the
DAML_PROJECTenvironment variable, e.g.,DAML_PROJECT=foobar daml codegen javaHowever, there is currently a bug where this doesn’t work for the Java codegen, I’ve opened daml codegen java should resolve DAR relative to project root · Issue #8406 · digital-asset/daml · GitHub to track this.
So for now, you are unfortunately stuck changing the working directory before calling
daml codegen java. - cocreature 2
We just merged a fix for this so starting from next week’s snapshot release,
DAML_PROJECTwill do the job.