Multiple Java Applications Dar Dependecies

Hello everybody!

I need some advice. I have a situation where a daml repository and several Java applications are part of one project. And now I’m afraid to change daml code because Java apps depend on java code gen. What is the best way to manage this?
In the beginning, I had single repo: daml + java. So when I changed daml and java tests fail I could manage it in a single effort. Now when the application grows I’m confused.

I use GitHub actions to test apps and push artifacts to the cloud. I have 3 repositories now: daml, java1, and java3. I know I can trigger workflows across the repositories and share artifacts. But since the picture itself should be standard maybe there are better ways.

Thanks a lot!

If you key your artifacts by a Daml package ID, and reference them by package ID in your downstream Java repos, then changes to the Daml repo won’t directly alter the build of your Java projects. Instead, you can update the Java repos after ensuring that they build against the new Daml artifacts.

This is how canton is organized, for example; the canton repo refers to exact published artifact versions from the daml repo, and this version string can be automated as you like (e.g. you could have a daily or weekly automated PR that only merges if changing the version reference does not break the build, or you could just write a script to make the edit “manually”).

You need an explicit version reference if you want to separate the development lifecycle of the Daml and the Java code at all, and there’s no hope of future build reproducibility without such a reference.

1 Like