Skip to content

Latest commit

 

History

History
73 lines (52 loc) · 3.88 KB

README.md

File metadata and controls

73 lines (52 loc) · 3.88 KB

CodeGen Maven Plugin

Build Status Coverage Status Javadocs Released Version Snapshot Version

The CodeGen Plugin is used to execute auto-generation tools during the Maven build lifecycle, in a phase such as generate-sources or generate-test-sources.

Goals Overview

The CodeGen Plugin has one goal. The goals are bound to their proper phases within the Maven Lifecycle, and can be automatically executed during their respective phases with the use of <extensions>true</extensions> in the plugin descriptor.

  • codegen:radixtree is bound to the generate-sources phase, and is used to generate RadixTreeEnum source files.

Usage

codegen:radixtree

The codegen:radixtree goal is bound to the generate-sources phase, and is used to generate RadixTreeEnum source files.

Executing the CodeGen Plugin

To execute the plugin from the command line, the following command can be used:

mvn org.openjax.codegen:codegen-maven-plugin:<goal> -DinFile=<inFile> -DclassName=<className> -DdestDir=[destDir] -DinheritsFrom=[inheritsFrom]

Configuring the CodeGen Plugin

To configure the plugin in your POM, the following is an example of the plugin descriptor:

<plugin>
  <groupId>org.openjax.codegen</groupId>
  <artifactId>codegen-maven-plugin</artifactId>
  <version>0.2.6</version>
  <executions>
    <execution>
      <goals>
        <goal>radixtree</goal>
      </goals>
      <phase>generate-sources</phase>
      <configuration>
        <inFile>src/test/resources/keywords.txt</inFile>
        <destDir>${project.build.directory}/generated-sources/radixtree</destDir>
        <className>org.example.Keyword</className>
      </configuration>
    </execution>
  </executions>
</plugin>

Configuration Parameters

Configuration Property Type Use Description
inFile¹ inFile String Required File containing sorted newline-delimited list of keywords.
destDir¹
 
destDir
 
String
 
Optional
 
Destination directory of generated enum.
Default: ${project.basedir}
className¹ className String Required Class name of generated enum.
inheritsFrom¹
 
inheritsFrom
 
String
 
Optional
 
Interface class name the generated enum must inherit from.
Default: null

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

This project is licensed under the MIT License - see the LICENSE.txt file for details.