Skip to content

HHH-19496 Use Javadoc styles from hibernate-asciidoctor-theme #10245

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions documentation/documentation.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -215,10 +215,10 @@ def aggregateJavadocsTask = tasks.register( "javadoc", Javadoc ) {
? javadocTool.get().metadata.languageVersion
: JavaLanguageVersion.of( JavaVersion.current().name )

if ( javaLanguageVersion.asInt() > 11 ) {
println "Aggregated Javadocs are bing built` using a JDK newer than version 11: \n" +
"\t* `stylesheet.css` will not be compatible\n" +
"\t* generating the User Guide settings fragment will not succeed"
if ( javaLanguageVersion.asInt() != 21 ) {
println "Aggregated Javadocs are bing built` using a JDK different than version 21: \n" +
"\t* `stylesheet.css` might not be compatible\n" +
"\t* generating the User Guide settings fragment might not succeed"
}
}
}
Expand Down
29 changes: 27 additions & 2 deletions local-build-plugins/src/main/groovy/local.javadoc.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,28 @@ plugins {
id "local.module"
}

configurations {
themezip
}

dependencies {
themezip 'org.hibernate.infra:hibernate-asciidoctor-theme:5.1.1.Final@zip'
}

tasks.register('unpackTheme', Copy) {
def unpackDir = rootProject.layout.buildDirectory.dir("unpacked-theme")

onlyIf {
!unpackDir.get().asFile.exists()
}
destinationDir = unpackDir.get().asFile

def zipFile = configurations.themezip.singleFile
from zipTree(zipFile)

dependsOn configurations.themezip
}

tasks.withType(Javadoc).configureEach {
def currentYear = new GregorianCalendar().get( Calendar.YEAR )

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

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

addBooleanOption('Xdoclint:none', true)
}
}
dependsOn tasks.unpackTheme
}