1- import java.time.Year
2-
31import org.asciidoctor.gradle.jvm.AsciidoctorTask
42
3+ import java.time.Year
4+
55apply plugin : ' org.asciidoctor.jvm.convert'
66
77ext {
@@ -22,21 +22,21 @@ rootProject.subprojects { subproject ->
2222// Aggregated JavaDoc
2323// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2424
25- final File javadocDir = mkdir( new File ( ( File ) project. buildDir, ' javadocs' ) )
25+ final File javadocDir = mkdir( project. layout . buildDirectory . dir( " javadocs" ) )
2626
2727/**
2828 * Builds the JavaDocs aggregated (unified) across all the sub-projects
2929 */
30- task aggregateJavadocs ( type : Javadoc , group : ' Documentation ' ) {
31- description = ' Builds the aggregated (unified) JavaDocs across all sub-projects'
30+ def aggregateJavadocsTask = tasks . register( ' aggregateJavadocs ' , Javadoc ) {
31+ description = ' Builds the aggregated (unified) JavaDocs across all sub-projects'
3232
3333 final int inceptionYear = 2020
34- final int currentYear = Year . now(). getValue()
34+ final int currentYear = Year . now(). getValue()
3535
36- // exclude any generated sources and internal packages
37- exclude( ' **/generated-src/**' )
36+ // exclude any generated sources and internal packages
37+ exclude( ' **/generated-src/**' )
3838 exclude( ' **/src/main/generated/**' )
39- exclude( ' **/internal/**' )
39+ exclude( ' **/internal/**' )
4040 exclude( ' **/impl/**' )
4141
4242 // apply standard config
@@ -75,18 +75,18 @@ task aggregateJavadocs(type: Javadoc, group: 'Documentation') {
7575 }
7676 }
7777
78- // process each project, building up:
79- // 1) appropriate sources
80- // 2) classpath
81- parent. subprojects. each { Project subProject ->
82- // skip certain sub-projects
83- if ( ! project. projectsToSkipWhenAggregatingJavadocs. contains( subProject. name ) ) {
78+ // process each project, building up:
79+ // 1) appropriate sources
80+ // 2) classpath
81+ parent. subprojects. each { Project subProject ->
82+ // skip certain sub-projects
83+ if ( ! project. projectsToSkipWhenAggregatingJavadocs. contains( subProject. name ) ) {
8484 // we only care about the main SourceSet...
8585 source subProject. sourceSets. main. java
8686
8787 classpath + = subProject. sourceSets. main. output + subProject. sourceSets. main. compileClasspath
8888 }
89- }
89+ }
9090}
9191
9292// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -98,41 +98,44 @@ asciidoctor {
9898 enabled = false
9999}
100100
101- task renderReferenceDocumentation ( type : AsciidoctorTask , group : ' Documentation ' ) {
102- description = ' Renders the Reference Documentation in HTML format using Asciidoctor.'
103- sourceDir = file( ' src/main/asciidoc/reference' )
104- sources {
105- include ' index.adoc'
106- }
101+ def renderReferenceDocumentationTask = tasks . register( ' renderReferenceDocumentation ' , AsciidoctorTask ) {
102+ description = ' Renders the Reference Documentation in HTML format using Asciidoctor.'
103+ sourceDir = file( ' src/main/asciidoc/reference' )
104+ sources {
105+ include ' index.adoc'
106+ }
107107
108108 resources {
109- from(sourceDir) {
109+ from( sourceDir ) {
110110 include ' images/**'
111111 include ' css/**'
112112 }
113113 }
114114
115- outputDir = new File (" $buildDir /asciidoc/reference/html_single" )
116- options logDocuments : true
115+ outputDir = project. layout. buildDirectory. dir( " asciidoc/reference/html_single" ). get(). asFile
116+ options logDocuments : true
117+
118+ logger. lifecycle " ---- Rendering docs with version $project . version "
119+
117120 attributes icons : ' font' ,
118121 ' source-highlighter' : ' rouge' ,
119122 experimental : true ,
120123 linkcss : true ,
121124 majorMinorVersion : project. version. family,
122125 fullVersion : project. version. toString(),
123126 docinfo : ' private'
124-
125127}
126128
127129// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
128130// All
129131// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
130132
131- task assembleDocumentation (dependsOn : [aggregateJavadocs, renderReferenceDocumentation]) {
133+ def assembleDocumentationTask = tasks. register( ' assembleDocumentation' ) {
134+ dependsOn aggregateJavadocsTask, renderReferenceDocumentationTask
132135 group ' Documentation'
133136 description ' Grouping task for performing all documentation building tasks'
134137
135138 logger. lifecycle " Documentation groupId: '" + project. group + " ', version: '" + project. version + " '"
136139}
137140
138- assemble. dependsOn assembleDocumentation
141+ assemble. dependsOn assembleDocumentationTask
0 commit comments