Integrating With Automated Build Systems - restful-api-description-language/RADL GitHub Wiki
Integrating With Automated Build Systems
You could run the RADL extraction or Java generation tools from the command line using the java
command. But you would have to specify the classpath, which doesn't just include the tool class, but also its dependencies, so you probably want to script the code generation.
Better yet, you can make it part of your Continuous Integration build. All build systems have a way of running a Java class and providing arguments and the classpath, so that shouldn't be a problem. Below we give instructions for the most popular build systems for Java in use in today.
If you are just generating HTML documentation, and can run an XSLT processor in your build system, you can simply run the radl2html.xsl
transform. If you are extracting RADL from code or generating code from RADL, then RADL plugins will make your life simpler.
The exact instructions depend on the build system that you use, but all need to download artifacts from Bintray.
Gradle
The easiest is to use the Gradle RADL Plug-in. Alternatively, you can execute the tool class using the JavaExec
task or via ant.java
.
Maven
The Maven RADL plugin is available for automated build with Maven. Alternatively, you can execute the tool class using the exec-maven-plugin
.
Ant
You can execute the tool class using the java task, using the args
and classpath
properties to provide the necessary information. Ant doesn't really help you with getting the radl-core
jar downloaded, but you're probably already using Ivy for that.