1
- import java.time.Year
2
-
3
1
import org.asciidoctor.gradle.jvm.AsciidoctorTask
4
2
3
+ import java.time.Year
4
+
5
5
apply plugin : ' org.asciidoctor.jvm.convert'
6
6
7
7
ext {
@@ -22,21 +22,21 @@ rootProject.subprojects { subproject ->
22
22
// Aggregated JavaDoc
23
23
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
24
24
25
- final File javadocDir = mkdir( new File ( ( File ) project. buildDir, ' javadocs' ) )
25
+ final File javadocDir = mkdir( project. layout . buildDirectory . dir( " javadocs" ) )
26
26
27
27
/**
28
28
* Builds the JavaDocs aggregated (unified) across all the sub-projects
29
29
*/
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'
32
32
33
33
final int inceptionYear = 2020
34
- final int currentYear = Year . now(). getValue()
34
+ final int currentYear = Year . now(). getValue()
35
35
36
- // exclude any generated sources and internal packages
37
- exclude( ' **/generated-src/**' )
36
+ // exclude any generated sources and internal packages
37
+ exclude( ' **/generated-src/**' )
38
38
exclude( ' **/src/main/generated/**' )
39
- exclude( ' **/internal/**' )
39
+ exclude( ' **/internal/**' )
40
40
exclude( ' **/impl/**' )
41
41
42
42
// apply standard config
@@ -75,18 +75,18 @@ task aggregateJavadocs(type: Javadoc, group: 'Documentation') {
75
75
}
76
76
}
77
77
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 ) ) {
84
84
// we only care about the main SourceSet...
85
85
source subProject. sourceSets. main. java
86
86
87
87
classpath + = subProject. sourceSets. main. output + subProject. sourceSets. main. compileClasspath
88
88
}
89
- }
89
+ }
90
90
}
91
91
92
92
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -98,41 +98,44 @@ asciidoctor {
98
98
enabled = false
99
99
}
100
100
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
+ }
107
107
108
108
resources {
109
- from(sourceDir) {
109
+ from( sourceDir ) {
110
110
include ' images/**'
111
111
include ' css/**'
112
112
}
113
113
}
114
114
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
+
117
120
attributes icons : ' font' ,
118
121
' source-highlighter' : ' rouge' ,
119
122
experimental : true ,
120
123
linkcss : true ,
121
124
majorMinorVersion : project. version. family,
122
125
fullVersion : project. version. toString(),
123
126
docinfo : ' private'
124
-
125
127
}
126
128
127
129
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
128
130
// All
129
131
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
130
132
131
- task assembleDocumentation (dependsOn : [aggregateJavadocs, renderReferenceDocumentation]) {
133
+ def assembleDocumentationTask = tasks. register( ' assembleDocumentation' ) {
134
+ dependsOn aggregateJavadocsTask, renderReferenceDocumentationTask
132
135
group ' Documentation'
133
136
description ' Grouping task for performing all documentation building tasks'
134
137
135
138
logger. lifecycle " Documentation groupId: '" + project. group + " ', version: '" + project. version + " '"
136
139
}
137
140
138
- assemble. dependsOn assembleDocumentation
141
+ assemble. dependsOn assembleDocumentationTask
0 commit comments