Skip to content

Commit

Permalink
minor asciidoctor task improvements + update plugin to 3.1 version
Browse files Browse the repository at this point in the history
  • Loading branch information
sebersole committed Aug 2, 2021
1 parent 3b78f30 commit be8be18
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 37 deletions.
73 changes: 37 additions & 36 deletions documentation/documentation.gradle
@@ -1,5 +1,8 @@
import org.apache.tools.ant.filters.ReplaceTokens
import org.asciidoctor.gradle.AsciidoctorTask
import org.asciidoctor.gradle.jvm.AsciidoctorTask

plugins {
id 'org.asciidoctor.jvm.convert' version '3.1.0'
}

/*
* Hibernate, Relational Persistence for Idiomatic Java
Expand Down Expand Up @@ -30,7 +33,6 @@ projectsToIncludeInAggregatedJavadoc.each {projectPath ->
}

apply from: rootProject.file( 'gradle/java-module.gradle' )
apply plugin: 'org.asciidoctor.convert'
apply plugin: 'org.hibernate.matrix-test'

tasks.build.dependsOn 'buildDocs'
Expand Down Expand Up @@ -163,46 +165,49 @@ task aggregateJavadocs(type: Javadoc) {
}
}

tasks.asciidoctor {
// we do not want it creating its "default task"
enabled = false

asciidoctorj {
attributes icons: 'font',
experimental: true,
'source-highlighter': 'prettify',
majorMinorVersion: rootProject.ormVersion.family,
fullVersion: rootProject.ormVersion.fullName

options logDocuments: true
}


// Topical Guides ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

task renderTopicalGuides(type: AsciidoctorTask, group: 'Documentation') {
description = 'Renders the Topical Guides in HTML format using Asciidoctor.'

sourceDir = file( 'src/main/asciidoc/topical' )
outputDir = new File("$buildDir/asciidoc/topical/html_single")
backends "html5"
separateOutputDirs false
options logDocuments: true
attributes icons: 'font',
experimental: true,
'source-highlighter': 'prettify',
majorMinorVersion: rootProject.ormVersion.family,
fullVersion: rootProject.ormVersion.fullName
outputDir = new File("$buildDir/asciidoc/topical/html_single")

baseDirFollowsSourceDir()

resources {
from('src/main/asciidoc/topical/') {
include '**/images/**'
}
}

}


// Getting Started Guides (quick starts) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

task renderGettingStartedGuides(type: AsciidoctorTask, group: 'Documentation') {
description = 'Renders the Getting Started Guides (quick starts) in HTML format using Asciidoctor.'

sourceDir = file( 'src/main/asciidoc/quickstart/guides' )
sources {
include 'index.adoc'
}
outputDir = new File("$buildDir/asciidoc/quickstart/html_single")
backends "html5"
separateOutputDirs false
options logDocuments: true
attributes icons: 'font', experimental: true, 'source-highlighter': 'prettify'

baseDirFollowsSourceDir()
}


Expand All @@ -224,20 +229,17 @@ renderGettingStartedGuides.dependsOn buildTutorialZip

task renderUserGuide(type: AsciidoctorTask, group: 'Documentation') {
description = 'Renders the User Guides in HTML format using Asciidoctor.'

sourceDir = file( 'src/main/asciidoc/userguide' )
sources {
include 'Hibernate_User_Guide.adoc'
}
outputDir = new File("$buildDir/asciidoc/userguide/html_single")
backends "html5"
separateOutputDirs false
options logDocuments: true
attributes icons: 'font', experimental: true,
'source-highlighter': 'prettify',
linkcss: true,

baseDirFollowsSourceDir()

attributes linkcss: true,
stylesheet: "css/hibernate.css",
majorMinorVersion: rootProject.ormVersion.family,
fullVersion: rootProject.ormVersion.fullName,
docinfo: 'private',
jpaJavadocUrlPrefix: "https://javaee.github.io/javaee-spec/javadocs/javax/persistence/"

Expand All @@ -261,20 +263,19 @@ task renderUserGuide(type: AsciidoctorTask, group: 'Documentation') {

task renderIntegrationGuide(type: AsciidoctorTask, group: 'Documentation') {
description = 'Renders the User Guides in HTML format using Asciidoctor.'

sourceDir = file( 'src/main/asciidoc/integrationguide' )
sources {
include 'Hibernate_Integration_Guide.adoc'
}

outputDir = new File("$buildDir/asciidoc/integrationguide/html_single")
backends "html5"
separateOutputDirs false
options logDocuments: true
attributes icons: 'font',
experimental: true,
'source-highlighter': 'prettify',
linkcss: true,
stylesheet: "css/hibernate.css",
majorMinorVersion: rootProject.ormVersion.family

baseDirFollowsSourceDir()

attributes linkcss: true,
stylesheet: "css/hibernate.css"

resources {
from('src/main/asciidoc/integrationguide/') {
include 'images/**'
Expand Down
@@ -1,7 +1,7 @@
[[bootstrap]]
== Bootstrap
:sourcedir: ../../../../../test/java/org/hibernate/userguide/bootstrap
:boot-spi-sourcedir: ../../../../../../../hibernate-core/src/test/java/org/hibernate/boot/spi
:boot-spi-sourcedir: ../../../../../../../hibernate-core/src/test/java/org/hibernate/orm/test/bootstrap/spi
:extrasdir: extras

The term bootstrapping refers to initializing and starting a software component.
Expand Down Expand Up @@ -328,6 +328,7 @@ https://docs.jboss.org/hibernate/orm/{majorMinorVersion}/javadocs/org/hibernate/
include::{boot-spi-sourcedir}/metadatabuildercontributor/SqlFunctionMetadataBuilderContributor.java[tags=bootstrap-jpa-compliant-MetadataBuilderContributor-example]
----
====
org.hibernate.orm.test.bootstrap.spi.metadatabuildercontributor

The above `MetadataBuilderContributor` is used to register a `SqlFuction` which is not defined by the currently running Hibernate `Dialect`, but which we need to reference in our JPQL queries.

Expand Down

0 comments on commit be8be18

Please sign in to comment.