App Javadoc Builder Gradle Plugin

The App Javadoc Builder Gradle plugin lets you generate API documentation as a single, combined HTML document for an application that spans different subprojects, each one representing a different component of the same application.

The plugin has been successfully tested with Gradle 4.10.2.

Usage

To use the plugin, include it in the build script of the root project:

buildscript {
    dependencies {
        classpath group: "com.liferay", name: "com.liferay.gradle.plugins.app.javadoc.builder", version: "1.2.2"
    }

    repositories {
        maven {
            url "https://repository-cdn.liferay.com/nexus/content/groups/public"
        }
    }
}

apply plugin: "com.liferay.app.javadoc.builder"

The App Javadoc Builder plugin automatically applies the base and reporting-base plugins.

Project Extension

The App Javadoc Builder plugin exposes the following properties through the extension named appJavadocBuilder:

Property NameTypeDefault ValueDescription
copyTagsbooleantrueWhether to copy the custom block tags configuration from the subprojects. It sets the Javadoc -tag argument for the appJavadoc task.
doclintDisabledbooleantrue on JDK8+, false otherwise.Whether to ignore Javadoc errors. It sets the Javadoc -Xdoclint and -quiet arguments for the appJavadoc task.
groupNameClosureClosure<String>The subproject’s description, or the subproject’s name if the description is empty.The closure invoked in order to get the group heading for a subproject. The given closure is passed a Project as its parameter. If groupPackages is false, this property is not used.
groupPackagesbooleantrueWhether to separate packages on the overview page based on the subprojects they belong to. It sets the -group argument for the appJavadoc task.
subprojectsSet<Project>project.subprojectsThe subprojects to include in the API documentation of the app.

The same extension exposes the following methods:

MethodDescription
AppJavadocBuilderExtension onlyIf(Closure<Boolean> onlyIfClosure)Includes a subproject in the API documentation if the given closure returns true. The closure is evaluated at the end of the subproject configuration phase and is passed a single parameter: the subproject. If the closure returns false, the subproject is not included in the API documentation.
AppJavadocBuilderExtension onlyIf(Spec<Project> onlyIfSpec)Includes a subproject in the API documentation if the given spec is satisfied. The spec is evaluated at the end of the subproject configuration phase. If the spec is not satisfied, the subproject is not included in the API documentation.
AppJavadocBuilderExtension subprojects(Iterable<Project> subprojects)Include additional projects in the API documentation of the app.
AppJavadocBuilderExtension subprojects(Project... subprojects)Include additional projects in the API documentation of the app.

Tasks

The plugin adds two tasks to your project:

NameDepends OnTypeDescription
appJavadocThe javadoc tasks of the subprojects.JavadocGenerates Javadoc API documentation for the app.
jarAppJavadocappJavadocJarAssembles a JAR archive containing the Javadoc files for this app.

The appJavadoc task is automatically configured with sensible defaults:

Property NameDefault Value
classpathThe javadoc.classpath of all the subprojects.
destinationDir${project.buildDir}/docs/javadoc
options.encoding"UTF-8"
sourceThe javadoc.source of all the subprojects.
titleproject.reporting.apiDocTitle
この記事は役に立ちましたか?
0人中0人がこの記事が役に立ったと言っています