Skip to content

Commit 4434902

Browse files
committed
fix
1 parent 80e4ed9 commit 4434902

File tree

3 files changed

+139
-89
lines changed

3 files changed

+139
-89
lines changed

documentation/build.gradle

Lines changed: 32 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import java.time.Year
2-
31
import org.asciidoctor.gradle.jvm.AsciidoctorTask
42

3+
import java.time.Year
4+
55
apply plugin: 'org.asciidoctor.jvm.convert'
66

77
ext {
@@ -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
@@ -63,8 +63,10 @@ task aggregateJavadocs(type: Javadoc, group: 'Documentation') {
6363
options.addStringOption( 'Xdoclint:none', '-quiet' )
6464

6565
if ( gradle.ext.javaToolchainEnabled ) {
66-
options.setJFlags( getProperty( 'toolchain.javadoc.jvmargs' ).toString().
67-
split( ' ' ).toList().findAll( { !it.isEmpty() } ) )
66+
options.setJFlags(
67+
getProperty( 'toolchain.javadoc.jvmargs' ).toString().
68+
split( ' ' ).toList().findAll( { !it.isEmpty() } )
69+
)
6870
}
6971
}
7072

@@ -75,18 +77,18 @@ task aggregateJavadocs(type: Javadoc, group: 'Documentation') {
7577
}
7678
}
7779

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 ) ) {
80+
// process each project, building up:
81+
// 1) appropriate sources
82+
// 2) classpath
83+
parent.subprojects.each { Project subProject ->
84+
// skip certain sub-projects
85+
if ( !project.projectsToSkipWhenAggregatingJavadocs.contains( subProject.name ) ) {
8486
// we only care about the main SourceSet...
8587
source subProject.sourceSets.main.java
8688

8789
classpath += subProject.sourceSets.main.output + subProject.sourceSets.main.compileClasspath
8890
}
89-
}
91+
}
9092
}
9193

9294
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -98,22 +100,22 @@ asciidoctor {
98100
enabled = false
99101
}
100102

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-
}
103+
def renderReferenceDocumentationTask = tasks.register( 'renderReferenceDocumentation', AsciidoctorTask ) {
104+
description = 'Renders the Reference Documentation in HTML format using Asciidoctor.'
105+
sourceDir = file( 'src/main/asciidoc/reference' )
106+
sources {
107+
include 'index.adoc'
108+
}
107109

108110
resources {
109-
from(sourceDir) {
111+
from( sourceDir ) {
110112
include 'images/**'
111113
include 'css/**'
112114
}
113115
}
114116

115-
outputDir = new File("$buildDir/asciidoc/reference/html_single")
116-
options logDocuments: true
117+
outputDir = project.layout.buildDirectory.dir( "asciidoc/reference/html_single" ).get().asFile
118+
options logDocuments: true
117119
attributes icons: 'font',
118120
'source-highlighter': 'rouge',
119121
experimental: true,
@@ -128,11 +130,12 @@ task renderReferenceDocumentation(type: AsciidoctorTask, group: 'Documentation')
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

documentation/src/main/asciidoc/reference/introduction.adoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ simplistic example program in the {example}[`session-example`] directory,
1717
which shows off all the "bits" you'll need to get your own program up and
1818
running.
1919

20+
21+
Testing
22+
2023
== Information about Hibernate ORM
2124

2225
This document assumes some passing familiarity with Hibernate ORM or another

0 commit comments

Comments
 (0)