DAML Maven plugin

Plugin for DAML compilation and codegen

License

License

Categories

Categories

Maven Build Tools
GroupId

GroupId

com.daml.extensions
ArtifactId

ArtifactId

daml-maven-plugin
Last Version

Last Version

0.1.5
Release Date

Release Date

Type

Type

maven-plugin
Description

Description

DAML Maven plugin
Plugin for DAML compilation and codegen
Project URL

Project URL

https://daml.com
Source Code Management

Source Code Management

https://github.com/digital-asset/daml-maven-plugin

Download daml-maven-plugin

How to add to project

<plugin>
    <groupId>com.daml.extensions</groupId>
    <artifactId>daml-maven-plugin</artifactId>
    <version>0.1.5</version>
</plugin>

Dependencies

compile (3)

Group / Artifact Type Version
org.apache.maven : maven-plugin-api jar 3.0
org.apache.maven : maven-project jar 2.2.1
org.apache.maven.shared : maven-artifact-transfer jar 0.11.0

provided (1)

Group / Artifact Type Version
org.apache.maven.plugin-tools : maven-plugin-annotations jar 3.5

test (1)

Group / Artifact Type Version
junit : junit jar 4.13.1

Project Modules

There are no modules declared in this project.

Maven plugin for DAML compilation and codegen

Usage

In your DAML project define the usual daml.yaml and import the Java bindings in your pom.xml:

<dependency>
    <groupId>com.daml.ledger</groupId>
    <artifactId>bindings-rxjava</artifactId>
    <version>${daml-sdk.version}</version>
</dependency>

Then add this plugin:

<plugin>
    <groupId>com.daml.extensions</groupId>
    <artifactId>daml-maven-plugin</artifactId>
    <version>${daml-plugin.version}</version>
    <executions>
        <execution>
            <id>daml-compile-codegen</id>
            <goals>
                <goal>damlcompile</goal>
                <goal>codegen</goal>
            </goals>
        </execution>
    </executions>
</plugin>

When using the codegen goal it will fetch the codegen version corresponding to the Java binding version and use it to generate the java sources.

The project also fails to build if the SDK version in your daml.yaml doesn't match the version of Java bindings in pom.xml.

Optional configuration elements:

  • darName: the generated dar file. Default: ${project.build.directory}/${project.artifactId}.dar.
  • decoderClass: defines the -d option of the codegen. Default: daml.Decorder.
  • output: the target directory where the classes are generated to. Default: ${project.build.directory}/generated-sources/main/java.

By default these goals are bound to generate-sources phase.

DAML doc gen

To generate damldocs at verify phase include this execution:

<execution>
    <id>daml-docs</id>
    <goals>
        <goal>docsgen</goal>
    </goals>
    <configuration>
        <docsOutput>damldocs.md</docsOutput>
        <combined>true</combined>
        <damlFiles>
            <param>src/main/daml/your_main_daml.daml</param>
        </damlFiles>
    </configuration>
</execution>

Configuration:

  • docsOutput: the output parameter of the generator. Default: damldocs.
  • combined: if true a single file is generated (--combine option of the generator). Default is false.
  • format: the --format option of the generator. Default: markdown.

By default this goal is bound to verify phase.

CONFIDENTIAL © 2019 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. Any unauthorized use, duplication or distribution is strictly prohibited.

com.daml.extensions

Digital Asset

Versions

Version
0.1.5