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 ) testRuntime( libraries.h2 )
} }
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// grouping tasks - declaration, see below for task dependency definitions
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
task buildDocs { task buildDocs {
group 'Documentation' group 'Documentation'
description 'Grouping task for performing all documentation building tasks' 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' ) ); final File javadocDir = mkdir( new File( (File) project.buildDir, 'javadocs' ) );
@ -158,8 +170,6 @@ task aggregateJavadocs(type: Javadoc) {
} }
} }
buildDocs.dependsOn aggregateJavadocs
// jDocBook ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // jDocBook ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -218,29 +228,43 @@ asciidoctor {
task renderTopicalGuides(type: AsciidoctorTask, group: 'Documentation') { task renderTopicalGuides(type: AsciidoctorTask, group: 'Documentation') {
description = 'Renders the Topical Guides in HTML format using Asciidoctor.' description = 'Renders the Topical Guides in HTML format using Asciidoctor.'
sourceDir = file( 'src/main/asciidoc/topical' ) sourceDir = file( 'src/main/asciidoc/topical' )
outputDir = new File("$buildDir/asciidoc/topical/html") outputDir = new File("$buildDir/asciidoc/topical/html_single")
backends "html5" backends "html5"
separateOutputDirs false separateOutputDirs false
options logDocuments: true options logDocuments: true
attributes icons: 'font', experimental: true, 'source-highlighter': 'prettify' attributes icons: 'font', experimental: true, 'source-highlighter': 'prettify'
} }
buildDocs.dependsOn renderTopicalGuides
// Getting Started Guides (quick starts) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Getting Started Guides (quick starts) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
task renderGettingStartedGuides(type: AsciidoctorTask, group: 'Documentation') { task renderGettingStartedGuides(type: AsciidoctorTask, group: 'Documentation') {
description = 'Renders the Getting Started Guides (quick starts) in HTML format using Asciidoctor.' description = 'Renders the Getting Started Guides (quick starts) in HTML format using Asciidoctor.'
sourceDir = file( 'src/main/asciidoc/quickstart/guides' ) sourceDir = file( 'src/main/asciidoc/quickstart/guides' )
outputDir = new File("$buildDir/asciidoc/quickstart/html") outputDir = new File("$buildDir/asciidoc/quickstart/html_single")
backends "html5" backends "html5"
separateOutputDirs false separateOutputDirs false
options logDocuments: true options logDocuments: true
attributes icons: 'font', experimental: true, 'source-highlighter': 'prettify' 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 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Mapping Guides ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
task renderMappingGuide(type: AsciidoctorTask, group: 'Documentation') { task renderMappingGuide(type: AsciidoctorTask, group: 'Documentation') {
@ -265,7 +289,7 @@ task renderMappingGuide(type: AsciidoctorTask, group: 'Documentation') {
task renderUserGuide(type: AsciidoctorTask, group: 'Documentation') { task renderUserGuide(type: AsciidoctorTask, group: 'Documentation') {
description = 'Renders the User Guides in HTML format using Asciidoctor.' description = 'Renders the User Guides in HTML format using Asciidoctor.'
sourceDir = file( 'src/main/asciidoc/userguide' ) sourceDir = file( 'src/main/asciidoc/userguide' )
outputDir = new File("$buildDir/asciidoc/userguide/html") outputDir = new File("$buildDir/asciidoc/userguide/html_single")
backends "html5" backends "html5"
separateOutputDirs false separateOutputDirs false
options logDocuments: true 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 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 String majorMinorVersion = versionComponents[0] + '.' + versionComponents[1];
final File documentationDir = mkdir( "${project.buildDir}/documentation" ); 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. * Assembles all documentation into the {buildDir}/documentation directory.
* *
* Depends on building the docs * 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' description = 'Assembles all documentation into the {buildDir}/documentation directory'
doLast { doLast {
// copy documentation outputs into target/documentation. // copy documentation outputs into target/documentation.
// * this is used in building the dist bundles // * this is used in building the dist bundles
// * it is also used as a base to build a staged directory for documentation upload // * it is also used as a base to build a staged directory for documentation upload
// Integrations Guide
copy { copy {
from "${rootProject.project( 'documentation' ).buildDir}/docbook/publish" from "${rootProject.project( 'documentation' ).buildDir}/docbook/publish/integrationsGuide/en-US"
into versionedDocumentationDir into "${documentationDir}/integrationsGuide"
} }
// Getting-started Guide
copy { copy {
from "${rootProject.project( 'documentation' ).buildDir}/asciidoc" from "${rootProject.project( 'documentation' ).buildDir}/asciidoc/quickstart"
into versionedDocumentationDir 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 { copy {
from "${rootProject.project( 'documentation' ).buildDir}/javadocs" 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) { task uploadDocumentation(type:Exec, dependsOn: assembleDocumentation) {
description = "Uploads documentation to the JBoss doc server" 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' executable 'rsync'
args '-avz', '--links', '--protocol=28', "${ormDocumentationDir.absolutePath}/", url args '-avz', '--links', '--protocol=28', "${documentationDir.absolutePath}/", url
doFirst { doFirst {
if ( version.endsWith( "SNAPSHOT" ) ) { if ( version.endsWith( "SNAPSHOT" ) ) {