Skip to content

Commit 58f52cf

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

File tree

1 file changed

+27
-2
lines changed

1 file changed

+27
-2
lines changed

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("jdk17").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)