Skip to content
Discussions/App Development/Extract Daml source files from a DAR?Forum ↗

Extract Daml source files from a DAR?

App Development4 posts153 views3 likesLast activity 20d ago
WA
WallaceKellyOP
Sep 2024

How can I extract the Daml source files from a DAR?
(assuming they have not been removed)

WA
WallaceKelly
Sep 2024

The following works on macOS:

unzip some.dar '*.daml'
WA
WallaceKelly
Dec 2025

Keep in mind that there is no guarantee that the embedded Daml source files are exactly the same as the source files used to compile the DAR.

DAR files are in in the zip format (similar to Java ecosystem’s JAR files). The Daml source files are included in the DAR files for convenience. However, replacing them does not invalidate the DAR file.

SI
Simon_Letort
20d ago

Bash script to extract all .daml files from .dar archives in the current directory

#!/bin/bash

# Script to extract all .daml files from .dar archives in the current directory

for dar_file in *.dar; do
   if [ -f "$dar_file" ]; then
      echo "Extracting .daml files from: $dar_file"
      unzip -o "$dar_file" '*.daml'
   fi
done

echo "Done extracting .daml files from all .dar archives"
← Back to Discussions