smilucky / context-mapper-standalone-example

Standalone Example Project using the Context Mapper DSL as Library

Home Page:https://contextmapper.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Context Mapper

Context Mapping DSL (CML) Standalone Example Project Build License

This is an example project illustrating how the Context Mapper DSL (CML) language can be used as standalone library outside the Eclipse IDE.

Build

The Context Mapper DSL library releases are available via the Maven central repository and can therefore be integrated within your Maven or Gradle builds.

Gradle:

implementation 'org.contextmapper:context-mapper-dsl:6.8.0'

Maven:

<dependency>
  <groupId>org.contextmapper</groupId>
  <artifactId>context-mapper-dsl</artifactId>
  <version>6.8.0</version>
</dependency>

If you want to use our SNAPSHOT's built from the master branch (context-mapper-dsl) you have to use the following repository: https://oss.sonatype.org/content/repositories/snapshots

Gradle Xtext Builder Plugin

This example project is built with Gradle. Have a look at build.gradle how it is configured. With the Xtext builder plugin you ensure that your CML files are compiled at build time.

Example Model

The CML models are configured to be in the source folder src/main/cml (see build.gradle). This example project contains the insurance example model (./src/main/cml/Insurance-Example-Model.cml) which can also be found in our examples repository.

Examples how to use CML models in your code

This example project contains the following example classes written in Java which illustrate how to use CML models and our generators:

For details about the generators and the CML language please consult our online documentation (currently we have no further documentation how to use the tools on code level in standalone applications). If you have questions how to use specific features within your standalone Java application don't hesitate to create an issue or contact us.

CLI

This example project also contains a jar that can be used from a CLI. To use it, you can build the project using any IDE, and use the generated jar. The available arguments are:

 -f,--file <arg>       CML file
 -o,--output <arg>     output folder
 -p,--template <arg>   freemarker template
 -t,--type <arg>       type of generator

The file and type arguments are mandatory. If you don't specify an output it uses src-gen folder.

The type of generators available are:

  • contextmap
  • generic
  • mdsl
  • plantuml

As example, to run from a command line:

java -jar context-mapper-standalone-example-1.0.0-SNAPSHOT.jar -f Insurance-Example-Model.cml -t contextmap

Contributing

Contribution is always welcome! Here are some ways how you can contribute:

Licence

ContextMapper is released under the Apache License, Version 2.0.

About

Standalone Example Project using the Context Mapper DSL as Library

https://contextmapper.org/

License:Apache License 2.0


Languages

Language:Java 98.3%Language:FreeMarker 1.7%