hibernate-orm/documentation/documentation.gradle

231 lines
6.6 KiB
Groovy
Raw Normal View History

import org.asciidoctor.gradle.jvm.AsciidoctorTask
plugins {
id 'org.asciidoctor.jvm.convert' version '3.3.2'
}
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/java-module.gradle' )
apply plugin: 'org.hibernate.matrix-test'
tasks.build.dependsOn 'buildDocs'
2013-11-22 15:51:56 -05:00
defaultTasks 'buildDocs'
2015-03-24 21:38:39 -04:00
dependencies {
ext.pressgangVersion = '3.0.0'
2013-11-22 15:51:56 -05:00
implementation project( ':hibernate-core' )
annotationProcessor project( ':hibernate-jpamodelgen' )
testImplementation project(':hibernate-testing')
testImplementation project(':hibernate-envers')
testImplementation project(':hibernate-spatial')
testImplementation project(':hibernate-jcache')
testImplementation project( path: ':hibernate-core', configuration: 'tests' )
testImplementation 'org.apache.commons:commons-lang3:3.4'
testImplementation 'org.osgi:org.osgi.core:4.3.1'
testImplementation libraries.mockito
testImplementation libraries.mockito_inline
testRuntimeOnly libraries.wildfly_transaction_client
testRuntimeOnly(libraries.ehcache3) {
capabilities {
requireCapability 'org.ehcache.modules:ehcache-xml-jakarta'
}
}
}
2013-11-22 15:51:56 -05:00
if ( project.ormVersion.isSnapshot ) {
// only run the ci build tasks for SNAPSHOT versions
task ciBuild( dependsOn: [clean, test] )
}
else {
task release( dependsOn: [clean, test] )
}
2016-02-11 16:59:13 -05:00
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// grouping tasks - declaration, see below for task dependency definitions
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2013-11-22 15:51:56 -05:00
task buildDocs {
2016-02-11 16:59:13 -05:00
group 'Documentation'
description 'Grouping task for performing all documentation building tasks'
}
task buildDocsForPublishing {
group 'Documentation'
description 'Grouping task for building all documentation for publishing (release)'
2013-11-22 15:51:56 -05:00
}
2016-02-11 16:59:13 -05:00
asciidoctorj {
attributes icons: 'font',
experimental: true,
'source-highlighter': 'prettify',
majorMinorVersion: rootProject.ormVersion.family,
fullVersion: rootProject.ormVersion.fullName
options logDocuments: true
}
// Topical Guides ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2021-09-27 08:09:29 -04:00
task renderTopicalGuides(type: AsciidoctorTask, group: 'Documentation') {task->
description = 'Renders the Topical Guides in HTML format using Asciidoctor.'
2021-09-27 08:09:29 -04:00
tasks.buildDocs.dependsOn task
tasks.buildDocsForPublishing.dependsOn task
sourceDir = file( 'src/main/asciidoc/topical' )
outputDir = new File("$buildDir/asciidoc/topical/html_single")
resources {
from('src/main/asciidoc/topical/') {
include '**/images/**'
}
}
}
// Getting Started Guides (quick starts) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2013-11-22 15:51:56 -05:00
2021-09-27 08:09:29 -04:00
task renderGettingStartedGuides(type: AsciidoctorTask, group: 'Documentation') {task->
description = 'Renders the Getting Started Guides (quick starts) in HTML format using Asciidoctor.'
2021-09-27 08:09:29 -04:00
tasks.buildDocs.dependsOn task
tasks.buildDocsForPublishing.dependsOn task
sourceDir = file( 'src/main/asciidoc/quickstart/guides' )
sources {
include 'index.adoc'
}
2016-02-11 16:59:13 -05:00
outputDir = new File("$buildDir/asciidoc/quickstart/html_single")
}
2016-02-11 16:59:13 -05:00
2021-09-27 08:09:29 -04:00
task buildTutorialZip(type: Zip) {task->
2016-02-11 16:59:13 -05:00
from 'src/main/asciidoc/quickstart/tutorials'
destinationDirectory = tasks.renderGettingStartedGuides.outputDir
archiveBaseName = 'hibernate-tutorials.zip'
2016-02-11 16:59:13 -05:00
expand(
version: project.version,
slf4j: "1.7.5",
junit: project.junitVersion,
h2: project.h2Version
2016-02-11 16:59:13 -05:00
)
2021-09-27 08:09:29 -04:00
tasks.renderGettingStartedGuides.dependsOn task
2016-02-11 16:59:13 -05:00
}
// User Guide ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2021-09-27 08:09:29 -04:00
task renderUserGuide(type: AsciidoctorTask, group: 'Documentation') {task->
description = 'Renders the User Guides in HTML format using Asciidoctor.'
2021-09-27 08:09:29 -04:00
tasks.buildDocs.dependsOn task
tasks.buildDocsForPublishing.dependsOn task
sourceDir = file( 'src/main/asciidoc/userguide' )
sources {
include 'Hibernate_User_Guide.adoc'
}
2016-02-11 16:59:13 -05:00
outputDir = new File("$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/') {
include 'images/**'
}
from('src/main/style/asciidoctor') {
include 'images/**'
}
from('src/main/style/asciidoctor') {
include 'css/**'
}
from('src/main/style/asciidoctor') {
include 'js/**'
}
}
}
// Integration Guide ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2021-09-27 08:09:29 -04:00
task renderIntegrationGuide(type: AsciidoctorTask, group: 'Documentation') {task->
description = 'Renders the User Guides in HTML format using Asciidoctor.'
2021-09-27 08:09:29 -04:00
tasks.buildDocs.dependsOn task
tasks.buildDocsForPublishing.dependsOn task
sourceDir = file( 'src/main/asciidoc/integrationguide' )
sources {
include 'Hibernate_Integration_Guide.adoc'
}
outputDir = new File("$buildDir/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/**'
}
}
}
2021-08-05 11:04:54 -04:00
tasks.withType(AsciidoctorTask).all {
baseDirFollowsSourceDir()
outputOptions {
separateOutputDirs = false
backends 'html5'
}
}
// Testing
test {
include '**/**'
}
// resources inherently exclude sources
sourceSets.test.resources {
setSrcDirs( ['src/test/java','src/test/resources'] )
}
2016-02-11 16:59:13 -05:00
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// grouping tasks
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2016-02-11 16:59:13 -05:00
buildDocs.dependsOn renderTopicalGuides
buildDocs.dependsOn renderGettingStartedGuides
buildDocs.dependsOn renderUserGuide
buildDocs.dependsOn renderIntegrationGuide
2016-02-11 16:59:13 -05:00
buildDocsForPublishing.dependsOn renderTopicalGuides
buildDocsForPublishing.dependsOn renderGettingStartedGuides
buildDocsForPublishing.dependsOn renderUserGuide
buildDocsForPublishing.dependsOn renderIntegrationGuide
checkstyleMain.exclude '**/org/hibernate/userguide/model/*'