Skip to content

Commit 12ff2e6

Browse files
committed
HHH-19496 Use Javadoc styles from hibernate-asciidoctor-theme
1 parent b0fe695 commit 12ff2e6

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

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

Lines changed: 26 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,8 @@ 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/hibernate-asciidoctor-theme/javadoc/jdk17").get().file("stylesheet.css").asFile
2548
bottom = "Copyright &copy; 2001-$currentYear <a href=\"https://redhat.com\">Red Hat, Inc.</a> All Rights Reserved."
2649

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

4871
addBooleanOption('Xdoclint:none', true)
4972
}
50-
}
73+
dependsOn tasks.unpackTheme
74+
}

0 commit comments

Comments
 (0)