hibernate-orm/documentation/documentation.gradle

597 lines
18 KiB
Groovy
Raw Normal View History

import org.asciidoctor.gradle.jvm.AsciidoctorTask
2023-05-11 10:54:58 -04:00
import org.asciidoctor.gradle.jvm.pdf.AsciidoctorPdfTask
plugins {
id 'org.asciidoctor.jvm.convert' version '3.3.2'
2023-05-11 10:54:58 -04:00
id 'org.asciidoctor.jvm.pdf' version '3.3.2'
id "org.asciidoctor.jvm.gems" version "3.3.2"
}
repositories {
mavenCentral()
ruby.gems()
}
2017-12-13 10:15:22 -05:00
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
apply from: rootProject.file( 'gradle/module.gradle' )
apply from: rootProject.file( 'gradle/releasable.gradle' )
2022-03-09 13:28:13 -05:00
apply plugin: 'org.hibernate.orm.build.reports'
2013-11-22 15:51:56 -05:00
defaultTasks 'buildDocs'
dependencies {
ext.pressgangVersion = '3.0.0'
2013-11-22 15:51:56 -05:00
2022-03-09 13:28:13 -05:00
reportAggregation project( ':hibernate-agroal' )
reportAggregation project( ':hibernate-c3p0' )
reportAggregation project( ':hibernate-core' )
reportAggregation project(':hibernate-envers')
reportAggregation project(':hibernate-graalvm')
reportAggregation project(':hibernate-hikaricp')
reportAggregation project(':hibernate-jcache')
reportAggregation project(':hibernate-micrometer')
reportAggregation project(':hibernate-proxool')
reportAggregation project(':hibernate-spatial')
reportAggregation project(':hibernate-vibur')
reportAggregation project(':hibernate-ant')
reportAggregation project(':hibernate-enhance-maven-plugin')
reportAggregation project(':hibernate-jpamodelgen')
asciidoctorGems 'rubygems:rouge:4.1.1'
}
2013-11-22 15:51:56 -05:00
if ( project.ormVersion.isSnapshot ) {
// only run the ci build tasks for SNAPSHOT versions
2023-04-01 10:33:34 -04:00
tasks.register('ciBuild') { dependsOn clean }
tasks.release.enabled false
}
else {
tasks.release.dependsOn clean
}
asciidoctorj {
requires 'rouge'
2023-05-11 10:54:58 -04:00
modules {
pdf {
version '2.3.7'
}
}
attributes icons: 'font',
experimental: true,
'source-highlighter': 'rouge',
majorMinorVersion: rootProject.ormVersion.family,
fullVersion: rootProject.ormVersion.fullName
options logDocuments: true
}
// Topical Guides ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def renderTopicalGuideHtmlTask = tasks.register( 'renderTopicalGuideHtml', AsciidoctorTask ) { task ->
2023-05-11 10:54:58 -04:00
group = "Documentation"
2023-04-01 10:33:34 -04:00
description = 'Renders the Topical Guides in HTML format using Asciidoctor.'
inputs.property "hibernate-version", project.ormVersion
sourceDir = file( 'src/main/asciidoc/topical' )
outputDir = new File( "$buildDir/asciidoc/topical/html_single" )
resources {
from( 'src/main/asciidoc/topical/' ) {
include '**/images/**'
}
}
}
def renderTopicalGuidesTask = tasks.register( 'renderTopicalGuides', AsciidoctorTask ) { task ->
task.group = "Documentation"
task.description = 'Renders the Topical Guides in all formats.'
task.dependsOn renderTopicalGuideHtmlTask
}
// Getting Started Guides (quick starts) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2013-11-22 15:51:56 -05:00
def gettingStartedGuideHtmlDir = layout.buildDirectory.dir( "asciidoc/quickstart/html_single" )
def renderGettingStartedGuideHtmlTask = tasks.register( 'renderGettingStartedGuideHtmlTask', AsciidoctorTask ) { task ->
2023-05-11 10:54:58 -04:00
group = "Documentation"
description = 'Renders the Getting Started Guides (quickstarts) in HTML format using Asciidoctor.'
2023-04-01 10:33:34 -04:00
inputs.property "hibernate-version", project.ormVersion
sourceDir = file( 'src/main/asciidoc/quickstart/guides' )
sources 'index.adoc'
outputDir = gettingStartedGuideHtmlDir
attributes linkcss: true,
stylesheet: "css/hibernate.css",
docinfo: 'private',
jpaJavadocUrlPrefix: "https://javaee.github.io/javaee-spec/javadocs/javax/persistence/"
resources {
from( 'src/main/style/asciidoctor' ) {
include 'images/**'
}
from( 'src/main/style/asciidoctor' ) {
include 'css/**'
}
from( 'src/main/style/asciidoctor' ) {
include 'js/**'
}
}
}
def renderGettingStartedGuidePdfTask = tasks.register( 'renderGettingStartedGuidePdf', AsciidoctorPdfTask ) { task ->
group = "Documentation"
description = 'Renders the Getting Started Guides in PDF format using Asciidoctor.'
inputs.property "hibernate-version", project.ormVersion
baseDir = file( 'src/main/asciidoc/quickstart/guides' )
sourceDir = file( 'src/main/asciidoc/quickstart/guides' )
sources 'index.adoc'
outputDir = layout.buildDirectory.dir( "asciidoc/quickstart/pdf" )
attributes jpaJavadocUrlPrefix: "https://javaee.github.io/javaee-spec/javadocs/javax/persistence/"
}
2016-02-11 16:59:13 -05:00
def buildTutorialZipTask = tasks.register( 'buildTutorialZip', Zip ) { task ->
2016-02-11 16:59:13 -05:00
from 'src/main/asciidoc/quickstart/tutorials'
destinationDirectory.set( gettingStartedGuideHtmlDir )
archiveFileName = 'hibernate-tutorials.zip'
2016-02-11 16:59:13 -05:00
expand(
version: project.version,
slf4j: "2.0.7",
junit: testLibs.versions.junit4.get(),
h2: dbLibs.versions.h2.get()
2016-02-11 16:59:13 -05:00
)
}
def renderGettingStartedGuidesTask = tasks.register( 'renderGettingStartedGuides' ) { task ->
task.group = "Documentation"
task.description = 'Renders the Getting Started Guide in all formats, as well as the acccompanying tutorial zip.'
task.dependsOn renderGettingStartedGuideHtmlTask, renderGettingStartedGuidePdfTask, buildTutorialZipTask
}
// Introduction ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def renderIntroductionHtmlTask = tasks.register( 'renderIntroductionHtml', AsciidoctorTask ) { task ->
group = "Documentation"
description = 'Renders the Introduction in HTML format using Asciidoctor.'
inputs.property "hibernate-version", project.ormVersion
sourceDir = file( 'src/main/asciidoc/introduction' )
sources 'Hibernate_Introduction.adoc'
outputDir = "$buildDir/asciidoc/introduction/html_single"
attributes linkcss: true,
stylesheet: "css/hibernate.css",
docinfo: 'private',
jpaJavadocUrlPrefix: "https://javaee.github.io/javaee-spec/javadocs/javax/persistence/"
resources {
from( 'src/main/asciidoc/introduction/' ) {
include 'images/**'
}
from( 'src/main/style/asciidoctor' ) {
include 'images/**'
}
from( 'src/main/style/asciidoctor' ) {
include 'css/**'
}
from( 'src/main/style/asciidoctor' ) {
include 'js/**'
}
}
}
def renderIntroductionPdfTask = tasks.register( 'renderIntroductionPdf', AsciidoctorPdfTask ) { task ->
group = "Documentation"
description = 'Renders the Introduction in PDF format using Asciidoctor.'
inputs.property "hibernate-version", project.ormVersion
baseDir = file( 'src/main/asciidoc/introduction' )
sourceDir = file( 'src/main/asciidoc/introduction' )
sources 'Hibernate_Introduction.adoc'
outputDir = "$buildDir/asciidoc/introduction/pdf"
attributes jpaJavadocUrlPrefix: "https://javaee.github.io/javaee-spec/javadocs/javax/persistence/"
}
//noinspection GroovyUnusedAssignment
def renderIntroductionGuidesTask = tasks.register( "renderIntroductionGuides" ) { task ->
group = "Documentation"
description = 'Renders the Introduction Guide in all formats.'
task.dependsOn renderIntroductionHtmlTask, renderIntroductionPdfTask
tasks.buildDocs.dependsOn task
}
// HQL Guide ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def renderQueryLanguageGuideHtmlTask = tasks.register( 'renderQueryLanguageGuideHtml', AsciidoctorTask ) { task ->
task.group = "Documentation"
task.description = 'Renders the Query Language document in HTML format using Asciidoctor.'
task.inputs.property "hibernate-version", project.ormVersion
task.sourceDir = file( 'src/main/asciidoc/querylanguage' )
task.sources 'Hibernate_Query_Language.adoc'
task.outputDir = layout.buildDirectory.dir( "asciidoc/querylanguage/html_single" )
task.attributes linkcss: true,
stylesheet: "css/hibernate.css",
docinfo: 'private',
jpaJavadocUrlPrefix: "https://javaee.github.io/javaee-spec/javadocs/javax/persistence/"
task.resources {
from( 'src/main/asciidoc/querylanguage/' ) {
include 'images/**'
}
from( 'src/main/style/asciidoctor' ) {
include 'images/**'
}
from( 'src/main/style/asciidoctor' ) {
include 'css/**'
}
from( 'src/main/style/asciidoctor' ) {
include 'js/**'
}
}
}
def renderQueryLanguageGuidePdfTask = tasks.register( 'renderQueryLanguageGuidePdf', AsciidoctorPdfTask ) { task ->
group = "Documentation"
description = 'Renders the Query Language document in PDF format using Asciidoctor.'
inputs.property "hibernate-version", project.ormVersion
sourceDir = file( 'src/main/asciidoc/querylanguage' )
baseDir = file( 'src/main/asciidoc/querylanguage' )
sources {
include 'Hibernate_Query_Language.adoc'
}
outputDir = layout.buildDirectory.dir( "asciidoc/querylanguage/pdf" )
attributes jpaJavadocUrlPrefix: "https://javaee.github.io/javaee-spec/javadocs/javax/persistence/"
}
//noinspection GroovyUnusedAssignment
def renderQueryLanguageGuidesTask = tasks.register( 'renderQueryLanguageGuides' ) { task ->
group = "Documentation"
description = 'Renders Query Language Guide in all formats.'
task.dependsOn renderQueryLanguageGuideHtmlTask
task.dependsOn renderQueryLanguageGuidePdfTask
tasks.buildDocs.dependsOn task
2016-02-11 16:59:13 -05:00
}
// Introduction ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2023-05-11 10:54:58 -04:00
tasks.register('renderIntroductionPdf', AsciidoctorPdfTask) {task->
group = "Documentation"
description = 'Renders the Introduction in PDF format using Asciidoctor.'
tasks.buildDocs.dependsOn task
tasks.buildDocsForPublishing.dependsOn task
inputs.property "hibernate-version", project.ormVersion
sourceDir = file( 'src/main/asciidoc/introduction' )
baseDir = file( 'src/main/asciidoc/introduction' )
sources {
include 'Hibernate_Introduction.adoc'
}
outputDir = "$buildDir/asciidoc/introduction/pdf"
attributes jpaJavadocUrlPrefix: "https://javaee.github.io/javaee-spec/javadocs/javax/persistence/"
}
tasks.register('renderIntroduction', AsciidoctorTask) {task->
group = "Documentation"
description = 'Renders the Introduction in HTML format using Asciidoctor.'
tasks.buildDocs.dependsOn task
tasks.buildDocsForPublishing.dependsOn task
2023-05-11 10:54:58 -04:00
inputs.property "hibernate-version", project.ormVersion
sourceDir = file( 'src/main/asciidoc/introduction' )
sources {
include 'Hibernate_Introduction.adoc'
}
outputDir = "$buildDir/asciidoc/introduction/html_single"
attributes linkcss: true,
stylesheet: "css/hibernate.css",
docinfo: 'private',
jpaJavadocUrlPrefix: "https://javaee.github.io/javaee-spec/javadocs/javax/persistence/"
resources {
from('src/main/asciidoc/introduction/') {
include 'images/**'
}
from('src/main/style/asciidoctor') {
include 'images/**'
}
from('src/main/style/asciidoctor') {
include 'css/**'
}
from('src/main/style/asciidoctor') {
include 'js/**'
}
}
}
2023-05-27 15:01:52 -04:00
// HQL Guide ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tasks.register('renderQLPdf', AsciidoctorPdfTask) {task->
group = "Documentation"
description = 'Renders the Query Language document in PDF format using Asciidoctor.'
tasks.buildDocs.dependsOn task
tasks.buildDocsForPublishing.dependsOn task
inputs.property "hibernate-version", project.ormVersion
sourceDir = file( 'src/main/asciidoc/querylanguage' )
baseDir = file( 'src/main/asciidoc/querylanguage' )
sources {
include 'Hibernate_Query_Language.adoc'
}
outputDir = "$buildDir/asciidoc/querylanguage/pdf"
attributes jpaJavadocUrlPrefix: "https://javaee.github.io/javaee-spec/javadocs/javax/persistence/"
}
tasks.register('renderQL', AsciidoctorTask) {task->
group = "Documentation"
description = 'Renders the Query Language document in HTML format using Asciidoctor.'
tasks.buildDocs.dependsOn task
tasks.buildDocsForPublishing.dependsOn task
inputs.property "hibernate-version", project.ormVersion
sourceDir = file( 'src/main/asciidoc/querylanguage' )
sources {
include 'Hibernate_Query_Language.adoc'
}
outputDir = "$buildDir/asciidoc/querylanguage/html_single"
attributes linkcss: true,
stylesheet: "css/hibernate.css",
docinfo: 'private',
jpaJavadocUrlPrefix: "https://javaee.github.io/javaee-spec/javadocs/javax/persistence/"
resources {
from('src/main/asciidoc/querylanguage/') {
include 'images/**'
}
from('src/main/style/asciidoctor') {
include 'images/**'
}
from('src/main/style/asciidoctor') {
include 'css/**'
}
from('src/main/style/asciidoctor') {
include 'js/**'
}
}
}
// User Guide ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def renderUserGuideHtmlTask = tasks.register( 'renderUserGuideHtml', AsciidoctorTask ) { task ->
2023-05-11 10:54:58 -04:00
group = "Documentation"
2023-04-01 10:33:34 -04:00
description = 'Renders the User Guides in HTML format using Asciidoctor.'
inputs.property "hibernate-version", project.ormVersion
dependsOn ':hibernate-core:collectConfigProperties'
dependsOn ':hibernate-envers:collectConfigProperties'
dependsOn ':hibernate-jcache:collectConfigProperties'
sourceDir = file( 'src/main/asciidoc/userguide' )
sources {
include 'Hibernate_User_Guide.adoc'
}
outputDir = "$buildDir/asciidoc/userguide/html_single"
attributes linkcss: true,
stylesheet: "css/hibernate.css",
docinfo: 'private',
jpaJavadocUrlPrefix: "https://javaee.github.io/javaee-spec/javadocs/javax/persistence/"
resources {
from( 'src/main/asciidoc/userguide/' ) {
2023-04-01 10:33:34 -04:00
include 'images/**'
}
from( 'src/main/style/asciidoctor' ) {
include 'images/**'
}
from( 'src/main/style/asciidoctor' ) {
include 'css/**'
}
from( 'src/main/style/asciidoctor' ) {
include 'js/**'
}
2023-04-01 10:33:34 -04:00
}
}
def renderUserGuidesTask = tasks.register( 'renderUserGuides' ) { task ->
task.group = "Documentation"
task.description = 'Renders the User Guides in all formats.'
task.dependsOn( renderUserGuideHtmlTask )
}
// Integration Guide ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def renderIntegrationGuideHtmlTask = tasks.register( "renderIntegrationGuideHtml", AsciidoctorTask ) { task->
2023-04-01 10:33:34 -04:00
group = "Documentation"
description = 'Renders the User Guides in HTML format using Asciidoctor.'
2023-04-01 10:33:34 -04:00
inputs.property "hibernate-version", project.ormVersion
sourceDir = file( 'src/main/asciidoc/integrationguide' )
sources {
include 'Hibernate_Integration_Guide.adoc'
}
2022-03-31 12:01:06 -04:00
outputDir = project.layout.buildDirectory.dir( 'asciidoc/integrationguide/html_single' )
attributes linkcss: true,
stylesheet: "css/hibernate.css"
resources {
from( 'src/main/asciidoc/integrationguide/' ) {
include 'images/**'
}
from( 'src/main/style/asciidoctor' ) {
include 'images/**'
}
from( 'src/main/style/asciidoctor' ) {
include 'css/**'
}
}
}
def renderIntegrationGuidesTask = tasks.register( "renderIntegrationGuides" ) { task ->
group = "Documentation"
description = 'Renders all formats of the User Guide.'
task.dependsOn renderIntegrationGuideHtmlTask
tasks.buildDocs.dependsOn task
}
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Migration Guide
def renderMigrationGuideTask = tasks.register( "renderMigrationGuide", AsciidoctorTask ) { task ->
2023-04-01 10:33:34 -04:00
group = "Documentation"
description = 'Renders the Migration Guide in HTML format using Asciidoctor.'
2023-04-01 10:33:34 -04:00
inputs.property "hibernate-version", project.ormVersion
sources {
include rootProject.layout.projectDirectory.file( 'migration-guide.adoc' ).asFile.canonicalPath
}
attributes linkcss: true,
stylesheet: "css/hibernate.css"
resources {
from( 'src/main/style/asciidoctor' ) {
include 'images/**'
}
from( 'src/main/style/asciidoctor' ) {
include 'css/**'
}
}
}
2022-03-31 12:01:06 -04:00
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// ORM Reports
def renderLoggingReportTask = tasks.register( 'renderLoggingReport', AsciidoctorTask ) { task ->
task.group = "hibernate-reports"
task.description = 'Renders the logging report (generated LoggingReportTask) by in HTML format using Asciidoctor.'
task.dependsOn "generateLoggingReport"
2022-03-31 12:01:06 -04:00
task.inputs.property "version", project.ormVersion
2022-03-31 12:01:06 -04:00
task.sourceDir = layout.buildDirectory.dir( 'orm/generated/logging' )
task.sources 'logging.adoc'
2022-03-31 12:01:06 -04:00
task.outputDir = project.layout.buildDirectory.dir( 'asciidoc/logging' )
2022-03-31 12:01:06 -04:00
task.attributes linkcss: true,
stylesheet: "css/hibernate.css"
2022-03-31 12:01:06 -04:00
task.resources {
from( 'src/main/style/asciidoctor' ) {
2022-03-31 12:01:06 -04:00
include 'images/**'
}
from( 'src/main/style/asciidoctor' ) {
2022-03-31 12:01:06 -04:00
include 'css/**'
}
}
}
def renderDialectReportTask = tasks.register( 'renderDialectReport', AsciidoctorTask ) { task ->
task.group = "hibernate-reports"
task.description = 'Renders the supported Dialect report in HTML format using Asciidoctor.'
task.dependsOn "generateDialectReport"
task.inputs.property "version", project.ormVersion
task.sourceDir = layout.buildDirectory.dir( 'orm/generated/dialect' )
task.sources 'dialect.adoc'
task.outputDir = project.layout.buildDirectory.dir( 'asciidoc/dialect' )
task.attributes linkcss: true,
stylesheet: "css/hibernate.css"
task.resources {
from( 'src/main/style/asciidoctor' ) {
include 'images/**'
}
from( 'src/main/style/asciidoctor' ) {
include 'css/**'
}
}
}
def generateReportsTask = tasks.named( "generateReports" ) {
dependsOn renderLoggingReportTask, renderDialectReportTask
}
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Overall grouping tasks
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def buildDocsTask = tasks.register( 'buildDocs' ) { task ->
task.group = 'Documentation'
task.description = 'Grouping task for performing all documentation building tasks'
task.dependsOn renderGettingStartedGuidesTask
task.dependsOn renderIntroductionGuidesTask
task.dependsOn renderUserGuidesTask
task.dependsOn renderQueryLanguageGuidesTask
task.dependsOn renderIntegrationGuidesTask
task.dependsOn renderTopicalGuidesTask
task.dependsOn generateReportsTask
task.dependsOn renderMigrationGuideTask
}
//noinspection GroovyUnusedAssignment
def buildDocsForPublishingTask = tasks.register( 'buildDocsForPublishing' ) { task ->
task.group = 'Documentation'
task.description = 'Grouping task for building all documentation for publishing (release)'
task.dependsOn buildDocsTask
}
2022-03-31 12:01:06 -04:00
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2022-03-11 15:45:43 -05:00
tasks.withType(AsciidoctorTask).configureEach {
2021-08-05 11:04:54 -04:00
baseDirFollowsSourceDir()
outputOptions {
separateOutputDirs = false
backends 'html5'
}
}