2016-03-22 09:16:21 -04:00
|
|
|
import org.apache.tools.ant.filters.ReplaceTokens
|
2015-07-14 15:46:02 -04:00
|
|
|
import org.asciidoctor.gradle.AsciidoctorTask
|
2017-12-13 10:15:22 -05:00
|
|
|
|
2015-05-19 00:23:35 -04: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>.
|
|
|
|
*/
|
2018-01-10 16:06:58 -05:00
|
|
|
|
|
|
|
ext {
|
|
|
|
projectsToSkipWhenAggregatingJavadocs = [
|
|
|
|
'documentation',
|
|
|
|
'hibernate-entitymanager',
|
|
|
|
'hibernate-infinispan',
|
2018-03-21 15:57:57 -04:00
|
|
|
'hibernate-ehcache',
|
2018-01-10 16:06:58 -05:00
|
|
|
'hibernate-java8',
|
|
|
|
'hibernate-orm-modules',
|
|
|
|
'release'
|
|
|
|
]
|
2011-03-22 11:39:53 -04:00
|
|
|
}
|
2018-01-10 17:52:28 -05:00
|
|
|
|
2018-01-10 16:06:58 -05:00
|
|
|
rootProject.subprojects { subproject ->
|
|
|
|
if ( !this.projectsToSkipWhenAggregatingJavadocs.contains( subproject.name ) ) {
|
|
|
|
this.evaluationDependsOn( subproject.path )
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
apply from: rootProject.file( 'gradle/java-module.gradle' )
|
2011-03-29 16:14:09 -04:00
|
|
|
|
2015-07-14 15:46:02 -04:00
|
|
|
apply plugin: 'org.asciidoctor.convert'
|
|
|
|
|
2016-02-18 04:16:46 -05:00
|
|
|
apply plugin: 'hibernate-matrix-testing'
|
|
|
|
|
2013-11-22 15:51:56 -05:00
|
|
|
defaultTasks 'buildDocs'
|
|
|
|
|
2015-03-24 21:38:39 -04:00
|
|
|
|
2011-03-22 11:39:53 -04:00
|
|
|
dependencies {
|
2016-02-08 10:33:09 -05:00
|
|
|
ext.pressgangVersion = '3.0.0'
|
2013-11-22 15:51:56 -05:00
|
|
|
|
2016-02-08 10:33:09 -05:00
|
|
|
compile( libraries.jpa )
|
2017-06-19 10:16:26 -04:00
|
|
|
compile( project( ':hibernate-core' ) )
|
2016-02-08 10:33:09 -05:00
|
|
|
compile( project( ':hibernate-jpamodelgen' ) )
|
|
|
|
|
|
|
|
testCompile( 'org.apache.commons:commons-lang3:3.4' )
|
2011-03-29 16:14:09 -04:00
|
|
|
|
2017-07-24 10:29:12 -04:00
|
|
|
testCompile( project(':hibernate-envers') )
|
2016-02-25 03:48:45 -05:00
|
|
|
testCompile( project(':hibernate-spatial') )
|
2016-05-06 14:38:48 -04:00
|
|
|
testCompile( project(path: ':hibernate-core', configuration: 'tests') )
|
2016-01-13 01:28:20 -05:00
|
|
|
|
|
|
|
testCompile( project(':hibernate-testing') )
|
2016-02-08 10:33:09 -05:00
|
|
|
|
2018-03-21 15:57:57 -04:00
|
|
|
testCompile "org.osgi:org.osgi.core:4.3.1"
|
|
|
|
|
2016-09-15 07:17:09 -04:00
|
|
|
testCompile( libraries.mockito )
|
2017-02-08 06:08:02 -05:00
|
|
|
testCompile( libraries.mockito_inline )
|
2018-03-21 15:57:57 -04:00
|
|
|
|
2016-01-13 01:28:20 -05:00
|
|
|
testRuntime( libraries.h2 )
|
2016-03-22 09:16:21 -04:00
|
|
|
testRuntime( libraries.hsqldb )
|
|
|
|
testRuntime( libraries.postgresql )
|
|
|
|
testRuntime( libraries.mysql )
|
2016-04-26 05:55:05 -04:00
|
|
|
testRuntime( libraries.mariadb )
|
2016-11-28 05:19:21 -05:00
|
|
|
testRuntime( libraries.mssql )
|
2018-04-04 04:57:25 -04:00
|
|
|
testRuntime( libraries.hana )
|
2016-04-26 05:55:05 -04:00
|
|
|
|
2018-03-21 15:57:57 -04:00
|
|
|
testCompile( project( ':hibernate-jcache' ) )
|
|
|
|
testRuntime( libraries.ehcache3 )
|
2016-01-13 01:28:20 -05:00
|
|
|
}
|
2013-11-22 15:51:56 -05:00
|
|
|
|
2016-03-22 09:16:21 -04:00
|
|
|
|
2018-04-30 11:38:09 -04:00
|
|
|
if ( project.ormVersion.isSnapshot ) {
|
2018-01-22 12:28:24 -05:00
|
|
|
// 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
|
|
|
|
|
|
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
// aggregated JavaDoc
|
|
|
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
2013-11-22 15:51:56 -05:00
|
|
|
|
|
|
|
final File javadocDir = mkdir( new File( (File) project.buildDir, 'javadocs' ) );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Builds the JavaDocs aggregated (unified) across all the sub-projects
|
|
|
|
*/
|
|
|
|
task aggregateJavadocs(type: Javadoc) {
|
|
|
|
description = 'Builds the aggregated (unified) JavaDocs across all sub-projects'
|
|
|
|
|
2017-12-26 12:27:58 -05:00
|
|
|
final int currentYear = new GregorianCalendar().get( Calendar.YEAR )
|
|
|
|
|
|
|
|
// exclude any generated sources and internal packages
|
|
|
|
exclude( '**/generated-src/**' )
|
|
|
|
exclude( '**/internal/**' )
|
|
|
|
|
2013-11-22 15:51:56 -05:00
|
|
|
|
2017-12-26 12:27:58 -05:00
|
|
|
// apply standard config
|
|
|
|
maxMemory = '512m'
|
|
|
|
destinationDir = javadocDir
|
|
|
|
configure( options ) {
|
|
|
|
overview = project.file( 'src/main/javadoc/overview.html' )
|
|
|
|
windowTitle = 'Hibernate JavaDocs'
|
|
|
|
docTitle = "Hibernate JavaDoc ($project.version)"
|
|
|
|
bottom = "Copyright © 2001-$currentYear <a href=\"http://redhat.com\">Red Hat, Inc.</a> All Rights Reserved."
|
|
|
|
use = true
|
|
|
|
options.encoding = 'UTF-8'
|
|
|
|
|
|
|
|
links = [
|
|
|
|
'https://docs.oracle.com/javase/8/docs/api/',
|
|
|
|
'https://docs.jboss.org/hibernate/beanvalidation/spec/2.0/api/',
|
|
|
|
'http://docs.jboss.org/cdi/api/2.0/',
|
|
|
|
'https://docs.oracle.com/javaee/7/api/'
|
|
|
|
]
|
|
|
|
|
|
|
|
if ( JavaVersion.current().isJava8Compatible() ) {
|
|
|
|
options.addStringOption( 'Xdoclint:none', '-quiet' )
|
|
|
|
}
|
|
|
|
}
|
2013-11-22 15:51:56 -05:00
|
|
|
|
|
|
|
// process each project, building up:
|
|
|
|
// 1) appropriate sources
|
|
|
|
// 2) classpath
|
2017-12-26 12:27:58 -05:00
|
|
|
parent.subprojects.each { Project subProject->
|
2013-11-22 15:51:56 -05:00
|
|
|
// skip certain sub-projects
|
2018-01-10 16:06:58 -05:00
|
|
|
if ( ! projectsToSkipWhenAggregatingJavadocs.contains( subProject.name ) ) {
|
|
|
|
// we only care about the main SourceSet...
|
|
|
|
source subProject.sourceSets.main.java
|
2013-12-02 21:53:19 -05:00
|
|
|
|
2018-01-10 16:06:58 -05:00
|
|
|
classpath += subProject.sourceSets.main.output + subProject.sourceSets.main.compileClasspath + subProject.configurations.provided
|
|
|
|
}
|
2013-11-22 15:51:56 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-07-14 15:46:02 -04:00
|
|
|
asciidoctor {
|
|
|
|
// we do not want it creating its "default task"
|
|
|
|
enabled = false
|
2011-03-29 16:14:09 -04:00
|
|
|
}
|
|
|
|
|
2015-07-14 15:46:02 -04:00
|
|
|
// Topical Guides ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
2011-03-29 16:14:09 -04:00
|
|
|
|
2015-07-14 15:46:02 -04:00
|
|
|
task renderTopicalGuides(type: AsciidoctorTask, group: 'Documentation') {
|
|
|
|
description = 'Renders the Topical Guides in HTML format using Asciidoctor.'
|
|
|
|
sourceDir = file( 'src/main/asciidoc/topical' )
|
2016-02-11 16:59:13 -05:00
|
|
|
outputDir = new File("$buildDir/asciidoc/topical/html_single")
|
2015-07-14 15:46:02 -04:00
|
|
|
backends "html5"
|
|
|
|
separateOutputDirs false
|
|
|
|
options logDocuments: true
|
2018-04-30 11:38:09 -04:00
|
|
|
attributes icons: 'font',
|
|
|
|
experimental: true,
|
|
|
|
'source-highlighter': 'prettify',
|
|
|
|
majorMinorVersion: rootProject.ormVersion.family,
|
|
|
|
fullVersion: rootProject.ormVersion.fullName
|
2018-04-16 16:28:08 -04:00
|
|
|
resources {
|
|
|
|
from('src/main/asciidoc/topical/') {
|
|
|
|
include '**/images/**'
|
|
|
|
}
|
|
|
|
}
|
2011-03-29 16:14:09 -04:00
|
|
|
}
|
|
|
|
|
2013-10-14 21:12:47 -04:00
|
|
|
|
2015-07-14 15:46:02 -04:00
|
|
|
// Getting Started Guides (quick starts) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
2013-11-22 15:51:56 -05:00
|
|
|
|
2015-07-14 15:46:02 -04:00
|
|
|
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' )
|
2016-02-11 16:59:13 -05:00
|
|
|
outputDir = new File("$buildDir/asciidoc/quickstart/html_single")
|
2015-07-14 15:46:02 -04:00
|
|
|
backends "html5"
|
|
|
|
separateOutputDirs false
|
|
|
|
options logDocuments: true
|
|
|
|
attributes icons: 'font', experimental: true, 'source-highlighter': 'prettify'
|
2013-10-31 07:08:36 -04:00
|
|
|
}
|
|
|
|
|
2016-02-11 16:59:13 -05:00
|
|
|
|
|
|
|
task buildTutorialZip(type: Zip) {
|
|
|
|
from 'src/main/asciidoc/quickstart/tutorials'
|
|
|
|
destinationDir = tasks.renderGettingStartedGuides.outputDir
|
|
|
|
archiveName = 'hibernate-tutorials.zip'
|
|
|
|
expand(
|
|
|
|
version: project.version,
|
|
|
|
slf4j: "1.7.5",
|
2018-01-10 16:06:58 -05:00
|
|
|
junit: project.junitVersion,
|
|
|
|
h2: project.h2Version
|
2016-02-11 16:59:13 -05:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
renderGettingStartedGuides.dependsOn buildTutorialZip
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-01-11 10:25:13 -05:00
|
|
|
// Mapping Guides ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
task renderMappingGuide(type: AsciidoctorTask, group: 'Documentation') {
|
|
|
|
description = 'Renders the Mapping Guides in HTML format using Asciidoctor.'
|
|
|
|
sourceDir = file( 'src/main/asciidoc/mapping' )
|
|
|
|
outputDir = new File("$buildDir/asciidoc/mapping/html")
|
|
|
|
backends "html5"
|
|
|
|
separateOutputDirs false
|
|
|
|
options logDocuments: true
|
|
|
|
//attributes icons: 'font', experimental: true, 'source-highlighter': 'prettify', linkcss: true, stylesheet: "css/hibernate.css"
|
|
|
|
attributes icons: 'font', experimental: true, 'source-highlighter': 'prettify', linkcss: true
|
|
|
|
resources {
|
|
|
|
from('src/main/asciidoc/') {
|
|
|
|
include 'images/**'
|
|
|
|
include 'css/**'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-08-02 09:45:36 -04:00
|
|
|
// User Guide ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
2016-01-11 10:25:13 -05:00
|
|
|
task renderUserGuide(type: AsciidoctorTask, group: 'Documentation') {
|
|
|
|
description = 'Renders the User Guides in HTML format using Asciidoctor.'
|
|
|
|
sourceDir = file( 'src/main/asciidoc/userguide' )
|
2016-02-11 16:59:13 -05:00
|
|
|
outputDir = new File("$buildDir/asciidoc/userguide/html_single")
|
2016-01-11 10:25:13 -05:00
|
|
|
backends "html5"
|
|
|
|
separateOutputDirs false
|
|
|
|
options logDocuments: true
|
2017-09-12 08:40:34 -04:00
|
|
|
attributes icons: 'font', experimental: true,
|
|
|
|
'source-highlighter': 'prettify',
|
|
|
|
linkcss: true,
|
|
|
|
stylesheet: "css/hibernate.css",
|
2018-04-30 11:38:09 -04:00
|
|
|
majorMinorVersion: rootProject.ormVersion.family,
|
|
|
|
fullVersion: rootProject.ormVersion.fullName,
|
2017-09-12 08:40:34 -04:00
|
|
|
docinfo: true
|
|
|
|
|
|
|
|
resources {
|
2016-01-11 10:25:13 -05:00
|
|
|
from('src/main/asciidoc/userguide/') {
|
|
|
|
include 'images/**'
|
|
|
|
}
|
2016-03-02 08:16:13 -05:00
|
|
|
from('src/main/style/asciidoctor') {
|
|
|
|
include 'images/**'
|
|
|
|
}
|
2016-02-29 08:06:03 -05:00
|
|
|
from('src/main/style/asciidoctor') {
|
|
|
|
include 'css/**'
|
|
|
|
}
|
2017-09-12 08:40:34 -04:00
|
|
|
from('src/main/style/asciidoctor') {
|
|
|
|
include 'js/**'
|
|
|
|
}
|
2016-01-11 10:25:13 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-08-02 09:45:36 -04:00
|
|
|
// Integration Guide ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
task renderIntegrationGuide(type: AsciidoctorTask, group: 'Documentation') {
|
|
|
|
description = 'Renders the User Guides in HTML format using Asciidoctor.'
|
|
|
|
sourceDir = file( 'src/main/asciidoc/integrationguide' )
|
|
|
|
outputDir = new File("$buildDir/asciidoc/integrationguide/html_single")
|
|
|
|
backends "html5"
|
|
|
|
separateOutputDirs false
|
|
|
|
options logDocuments: true
|
2018-04-30 11:38:09 -04:00
|
|
|
attributes icons: 'font',
|
|
|
|
experimental: true,
|
|
|
|
'source-highlighter': 'prettify',
|
|
|
|
linkcss: true,
|
|
|
|
stylesheet: "css/hibernate.css",
|
|
|
|
majorMinorVersion: rootProject.ormVersion.family
|
2016-08-02 09:45:36 -04:00
|
|
|
resources {
|
|
|
|
from('src/main/asciidoc/integrationguide/') {
|
|
|
|
include 'images/**'
|
|
|
|
}
|
|
|
|
from('src/main/style/asciidoctor') {
|
|
|
|
include 'images/**'
|
|
|
|
}
|
|
|
|
from('src/main/style/asciidoctor') {
|
|
|
|
include 'css/**'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2016-01-11 10:25:13 -05:00
|
|
|
|
2018-03-21 15:57:57 -04:00
|
|
|
// Testing
|
|
|
|
|
|
|
|
// resources inherently exclude sources
|
|
|
|
sourceSets.test.resources {
|
|
|
|
setSrcDirs( ['src/test/java','src/test/resources'] )
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-02-11 16:59:13 -05:00
|
|
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
// grouping tasks
|
|
|
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
2015-07-14 15:46:02 -04:00
|
|
|
|
2016-02-11 16:59:13 -05:00
|
|
|
buildDocs.dependsOn aggregateJavadocs
|
|
|
|
buildDocs.dependsOn renderTopicalGuides
|
|
|
|
buildDocs.dependsOn renderGettingStartedGuides
|
|
|
|
buildDocs.dependsOn renderUserGuide
|
2016-08-02 09:45:36 -04:00
|
|
|
buildDocs.dependsOn renderIntegrationGuide
|
2015-07-14 15:46:02 -04:00
|
|
|
|
2016-02-11 16:59:13 -05:00
|
|
|
buildDocsForPublishing.dependsOn aggregateJavadocs
|
|
|
|
buildDocsForPublishing.dependsOn renderTopicalGuides
|
|
|
|
buildDocsForPublishing.dependsOn renderGettingStartedGuides
|
|
|
|
buildDocsForPublishing.dependsOn renderUserGuide
|
2016-08-02 09:45:36 -04:00
|
|
|
buildDocsForPublishing.dependsOn renderIntegrationGuide
|
2017-12-13 12:38:25 -05:00
|
|
|
|
|
|
|
checkstyleMain.exclude '**/org/hibernate/userguide/model/*'
|
2018-01-10 16:06:58 -05:00
|
|
|
|