Skip to content

Commit 96d31d5

Browse files
committed
HHH-19496 Use Javadoc styles from hibernate-asciidoctor-theme
1 parent 12118ee commit 96d31d5

File tree

2 files changed

+31
-6
lines changed

2 files changed

+31
-6
lines changed

documentation/documentation.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,10 +215,10 @@ def aggregateJavadocsTask = tasks.register( "javadoc", Javadoc ) {
215215
? javadocTool.get().metadata.languageVersion
216216
: JavaLanguageVersion.of( JavaVersion.current().name )
217217

218-
if ( javaLanguageVersion.asInt() > 11 ) {
219-
println "Aggregated Javadocs are bing built` using a JDK newer than version 11: \n" +
220-
"\t* `stylesheet.css` will not be compatible\n" +
221-
"\t* generating the User Guide settings fragment will not succeed"
218+
if ( javaLanguageVersion.asInt() != 21 ) {
219+
println "Aggregated Javadocs are bing built` using a JDK different than version 21: \n" +
220+
"\t* `stylesheet.css` might not be compatible\n" +
221+
"\t* generating the User Guide settings fragment might not succeed"
222222
}
223223
}
224224
}

local-build-plugins/src/main/groovy/local.javadoc.gradle

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,28 @@ plugins {
66
id "local.module"
77
}
88

9+
configurations {
10+
themezip
11+
}
12+
13+
dependencies {
14+
themezip 'org.hibernate.infra:hibernate-asciidoctor-theme:5.1.1.Final@zip'
15+
}
16+
17+
tasks.register('unpackTheme', Copy) {
18+
def unpackDir = rootProject.layout.buildDirectory.dir("unpacked-theme")
19+
20+
onlyIf {
21+
!unpackDir.get().asFile.exists()
22+
}
23+
destinationDir = unpackDir.get().asFile
24+
25+
def zipFile = configurations.themezip.singleFile
26+
from zipTree(zipFile)
27+
28+
dependsOn configurations.themezip
29+
}
30+
931
tasks.withType(Javadoc).configureEach {
1032
def currentYear = new GregorianCalendar().get( Calendar.YEAR )
1133

@@ -21,7 +43,9 @@ tasks.withType(Javadoc).configureEach {
2143
configure( options ) {
2244
windowTitle = "Hibernate Javadocs ($project.name)"
2345
docTitle = "Hibernate Javadocs ($project.name : $project.version)"
24-
stylesheetFile = rootProject.file( "shared/javadoc/stylesheet.css" )
46+
// Pick the styles for the JDK that is used to "build" the Javadocs:
47+
stylesheetFile = rootProject.layout.buildDirectory.dir("unpacked-theme").get()
48+
.dir("hibernate-asciidoctor-theme").dir("javadoc").dir("jdk21").file("stylesheet.css").asFile
2549
bottom = "Copyright &copy; 2001-$currentYear <a href=\"https://redhat.com\">Red Hat, Inc.</a> All Rights Reserved."
2650

2751
// The javadoc folder contains cached versions of the respective element-list files to avoid release issues when servers are down
@@ -47,4 +71,5 @@ tasks.withType(Javadoc).configureEach {
4771

4872
addBooleanOption('Xdoclint:none', true)
4973
}
50-
}
74+
dependsOn tasks.unpackTheme
75+
}

0 commit comments

Comments
 (0)