-
Notifications
You must be signed in to change notification settings - Fork 5
Gradle RADL Plugin
The RADL Gradle plugin is available from Bintray's jCenter:
buildSrc {
repositories {
jcenter {
url 'https://dl.bintray.com/radl/RADL/'
}
}
dependencies {
classpath "radl:radl-gradle:$radlGradleVersion"
}
}
You can either hard-code the version of the plugin, or follow the above example an add a property to gradle.properties
:
radlGradleVersion = 1.0.10
With that in place, you can add the plugin to your build file:
apply plugin: 'radl-gradle'
The plugin adds the following tasks to your build:
-
validateRadl
validates RADL files against the schema and against additional guidelines -
generateDocumentationFromRadl
transform RADL files into HTML-based documentation -
radl2spring
generates Spring server code from RADL files -
extractRadlFromCode
generates or updates a RADL file from Java code
See the following sections for more detail.
See Validating RADL Descriptions for an overview of the process. The validateRadl
task is automatically added as a dependency of the check
task.
See Generating Documentation for an overview of the process. The generateDocumentationFromRadl
task is automatically added as a dependency of the assemble
task. This task depends on the validateRadl
task.
See Generating Java Code From RADL for an overview of the process. This task is available for use, but not added to any dependency by default.
See Extracting RADL from Java code for an overview of the process. This task is available for use, but not added to any dependency by default.
The plugin adds the radl
project extension to your Gradle project with the following properties:
-
docsDir
The sub-directory of the project build directory into which documentation is generated. Defaults todocs/rest
. -
cssURL
One optional css URL to customize the documentation. Defaults to RADL's default css. -
extraClasspath
Additional classpath added to theclasspath
property (see Extracting RADL from Java code). -
extraProcessors
See theextra.processors
property in Extracting RADL from Java code -
extraSourceDir
See theextra.source
property in Extracting RADL from Java code -
header
The header to use for generated files. Defaults toGenerated by RADL.
. -
keepArgumentsFile
Whether to keep the arguments file generated when Extracting RADL from Java code. Defaults tofalse
. -
packagePrefix
The prefix to use when generating Java packages. Defaults to the service name. -
preExtract
A closure to execute before Extracting RADL from Java code. -
radlCoreVersion
The version of the core library to use. -
radlDirName
Location of RADL files. Defaults tosrc/main/radl
. -
scm
The source code management system to use. Defaults todefault
. The only other valid value isp4
for Perforce. -
serviceName
The name of the service that the RADL files describe. Defaults to the project's name. -
skipClasspath
Whether to skip adding a classpath at all (see Extracting RADL from Java code). Defaults tofalse
.