HHH-10520 - Update doc publishing

This commit is contained in:
Steve Ebersole 2016-02-11 15:59:13 -06:00
parent b4165d9530
commit 81b1baa8c4
2 changed files with 76 additions and 34 deletions

View File

@ -68,12 +68,24 @@ dependencies {
testRuntime( libraries.h2 )
}
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// grouping tasks - declaration, see below for task dependency definitions
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
task buildDocs {
group 'Documentation'
description 'Grouping task for performing all documentation building tasks'
group 'Documentation'
description 'Grouping task for performing all documentation building tasks'
}
// aggregated JavaDoc ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
task buildDocsForPublishing {
group 'Documentation'
description 'Grouping task for building all documentation for publishing (release)'
}
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// aggregated JavaDoc
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
final File javadocDir = mkdir( new File( (File) project.buildDir, 'javadocs' ) );
@ -158,8 +170,6 @@ task aggregateJavadocs(type: Javadoc) {
}
}
buildDocs.dependsOn aggregateJavadocs
// jDocBook ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -218,29 +228,43 @@ asciidoctor {
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")
outputDir = new File("$buildDir/asciidoc/topical/html_single")
backends "html5"
separateOutputDirs false
options logDocuments: true
attributes icons: 'font', experimental: true, 'source-highlighter': 'prettify'
}
buildDocs.dependsOn renderTopicalGuides
// 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' )
outputDir = new File("$buildDir/asciidoc/quickstart/html")
outputDir = new File("$buildDir/asciidoc/quickstart/html_single")
backends "html5"
separateOutputDirs false
options logDocuments: true
attributes icons: 'font', experimental: true, 'source-highlighter': 'prettify'
}
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",
junit: parent.junitVersion,
h2: parent.h2Version
)
}
renderGettingStartedGuides.dependsOn buildTutorialZip
// Mapping Guides ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
task renderMappingGuide(type: AsciidoctorTask, group: 'Documentation') {
@ -265,7 +289,7 @@ task renderMappingGuide(type: AsciidoctorTask, group: 'Documentation') {
task renderUserGuide(type: AsciidoctorTask, group: 'Documentation') {
description = 'Renders the User Guides in HTML format using Asciidoctor.'
sourceDir = file( 'src/main/asciidoc/userguide' )
outputDir = new File("$buildDir/asciidoc/userguide/html")
outputDir = new File("$buildDir/asciidoc/userguide/html_single")
backends "html5"
separateOutputDirs false
options logDocuments: true
@ -283,19 +307,21 @@ task renderUserGuide(type: AsciidoctorTask, group: 'Documentation') {
}
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// grouping tasks
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
buildDocs.dependsOn aggregateJavadocs
buildDocs.dependsOn renderTopicalGuides
buildDocs.dependsOn renderGettingStartedGuides
buildDocs.dependsOn renderUserGuide
// the jDocBook plugin already adds its main task as a dependency of the buildDocs task
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",
junit: parent.junitVersion,
h2: parent.h2Version
)
}
renderGettingStartedGuides.dependsOn buildTutorialZip
buildDocsForPublishing.dependsOn aggregateJavadocs
buildDocsForPublishing.dependsOn renderTopicalGuides
buildDocsForPublishing.dependsOn renderGettingStartedGuides
buildDocsForPublishing.dependsOn renderUserGuide
// only html-single to match what Asciidoctor currently offers
//buildDocsForPublishing.dependsOn 'renderDocBook_integrationsGuide_en-US_html_single '
buildDocsForPublishing.dependsOn renderDocBook_integrationsGuide

View File

@ -22,32 +22,48 @@ final String[] versionComponents = version.split( '\\.' );
final String majorMinorVersion = versionComponents[0] + '.' + versionComponents[1];
final File documentationDir = mkdir( "${project.buildDir}/documentation" );
final File ormDocumentationDir = mkdir( new File( documentationDir, "orm" ) )
final File versionedDocumentationDir = mkdir( new File( ormDocumentationDir, majorMinorVersion ) );
/**
* Assembles all documentation into the {buildDir}/documentation directory.
*
* Depends on building the docs
*/
task assembleDocumentation(type: Task, dependsOn: [rootProject.project( 'documentation' ).tasks.buildDocs]) {
task assembleDocumentation(type: Task, dependsOn: [rootProject.project( 'documentation' ).tasks.buildDocsForPublishing]) {
description = 'Assembles all documentation into the {buildDir}/documentation directory'
doLast {
// copy documentation outputs into target/documentation.
// * this is used in building the dist bundles
// * it is also used as a base to build a staged directory for documentation upload
// Integrations Guide
copy {
from "${rootProject.project( 'documentation' ).buildDir}/docbook/publish"
into versionedDocumentationDir
from "${rootProject.project( 'documentation' ).buildDir}/docbook/publish/integrationsGuide/en-US"
into "${documentationDir}/integrationsGuide"
}
// Getting-started Guide
copy {
from "${rootProject.project( 'documentation' ).buildDir}/asciidoc"
into versionedDocumentationDir
from "${rootProject.project( 'documentation' ).buildDir}/asciidoc/quickstart"
into "${documentationDir}/quickstart"
}
// Topical Guide
copy {
from "${rootProject.project( 'documentation' ).buildDir}/asciidoc/topical"
into "${documentationDir}/topical"
}
// User Guide
copy {
from "${rootProject.project( 'documentation' ).buildDir}/asciidoc/userguide"
into "${documentationDir}/userguide"
}
// Aggregated JavaDoc
copy {
from "${rootProject.project( 'documentation' ).buildDir}/javadocs"
into "${versionedDocumentationDir}/javadocs"
into "${documentationDir}/javadocs"
}
}
}
@ -58,10 +74,10 @@ task assembleDocumentation(type: Task, dependsOn: [rootProject.project( 'documen
task uploadDocumentation(type:Exec, dependsOn: assembleDocumentation) {
description = "Uploads documentation to the JBoss doc server"
final String url = 'filemgmt.jboss.org:/docs_htdocs/hibernate/';
final String url = "filemgmt.jboss.org:/docs_htdocs/hibernate/orm/${majorMinorVersion}";
executable 'rsync'
args '-avz', '--links', '--protocol=28', "${ormDocumentationDir.absolutePath}/", url
args '-avz', '--links', '--protocol=28', "${documentationDir.absolutePath}/", url
doFirst {
if ( version.endsWith( "SNAPSHOT" ) ) {