# Building multiple dar variants from a single daml project source code

**URL:** <https://forum.canton.network/t/building-multiple-dar-variants-from-a-single-daml-project-source-code/7907>\
**Category:** Outreach\
**Tags:** damlyaml, daml, multi-package\
**Created:** [April 22, 2025, 8:17am UTC](https://forum.canton.network/t/building-multiple-dar-variants-from-a-single-daml-project-source-code/7907 "2025-04-22T08:17:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Julius\_William](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/julius_william/32/2966_2.png) [@Julius\_William](https://forum.canton.network/u/Julius_William)\
**Post date:** [April 22, 2025, 8:17am UTC](https://forum.canton.network/t/building-multiple-dar-variants-from-a-single-daml-project-source-code/7907/1 "2025-04-22T08:17:10Z")

</div>

I was attempting to build several variants dars from a single daml project source code during a script run without manual intervention and @Richard_Kapolnai provided a good suggestion for accomplishing this detailed below in:

In my scenario, I am attempting to build 2 dars with incremental dar versions built using Daml SDKs 2.3.7 and 2.9.7 respectively.

To accomplish this, 2 daml.yaml files with differing project versions and SDK versions, but referring to the same daml source code can be set up in their individual folders. These daml.yaml-containing folders can be anywhere in the system, as long as the `source` path variable defined in the daml.yaml files correctly point to the daml folder in which the daml source code is contained.

My set up example directory structure along with the accompanying daml.yaml files is shown below:

```haskell
--------project-root
| |------src
| |---daml (contains daml source code)
|
|---------dar-2.3.7
| |-----daml.yaml
|
|---------dar-2.9.7
      |-----daml.yaml

```

daml.yaml (in dar-2.3.7 folder)

```haskell
sdk-version: 2.3.7
name: daml-project
source: ../src/daml
version: 1.0.0

```

daml.yaml (in dar-2.9.7 folder)

```haskell
sdk-version: 2.9.7
name: daml-project
source: ../src/daml
version: 1.0.1

```

Running daml build within the `dar-2.3.7` and `dar-2.9.7` folders will produce a dar with the properties defined by each folder’s daml.yaml file within each folder.  
The dars will be generated in each folder’s `.daml/dist/` folder as is the case when normally building a daml project.

Additionally, these folders can also be specified as packages to be built in a `multi-package.yaml` in the `project-root` folder to automatically build the dars defined by each daml.yaml when executing `daml build --all` from the `project-root` folder.

multi-package.yaml (in project-root folder)

```haskell
packages:
- ./dar-2.3.7
- ./dar-2.9.7

```

---

<div class="post-metadata">

**Author:** ![WallaceKelly](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/wallacekelly/32/5046_2.png) [@WallaceKelly](https://forum.canton.network/u/WallaceKelly)\
**Post date:** [April 22, 2025, 11:32am UTC](https://forum.canton.network/t/building-multiple-dar-variants-from-a-single-daml-project-source-code/7907/2 "2025-04-22T11:32:54Z")

</div>

Daml Assistant’s [Environment Variable Interpolation](https://docs.daml.com/tools/assistant.html#environment-variable-interpolation) is another useful technique:

```haskell
sdk-version: ${SDK_VERSION}
name: ${DAR_NAME}
source: daml
version: ${DAR_VERSION}
       :

```
