2011-03-22 11:39:53 -04:00
|
|
|
buildscript {
|
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
2011-03-29 16:14:09 -04:00
|
|
|
mavenLocal()
|
2012-08-08 05:53:17 -04:00
|
|
|
mavenRepo name: 'jboss-nexus', url: "http://repository.jboss.org/nexus/content/groups/public/"
|
2011-03-22 11:39:53 -04:00
|
|
|
}
|
|
|
|
dependencies {
|
2013-11-25 13:53:52 -05:00
|
|
|
classpath "org.jboss.jdocbook:gradle-jdocbook:1.2.2"
|
2011-03-22 11:39:53 -04:00
|
|
|
}
|
|
|
|
}
|
2011-03-29 16:14:09 -04:00
|
|
|
|
|
|
|
apply plugin: "java"
|
2011-03-22 11:39:53 -04:00
|
|
|
apply plugin: "jdocbook"
|
2012-08-08 05:53:17 -04:00
|
|
|
ext.pressgangVersion = '3.0.0'
|
2011-03-22 11:39:53 -04:00
|
|
|
dependencies {
|
2012-08-08 05:53:17 -04:00
|
|
|
|
2012-03-07 21:38:55 -05:00
|
|
|
jdocbookXsl "org.jboss.pressgang:pressgang-xslt-ns:${pressgangVersion}"
|
|
|
|
jdocbookXsl "org.jboss.pressgang:pressgang-fonts:${pressgangVersion}"
|
|
|
|
jdocbookStyles "org.jboss.pressgang:pressgang-jdocbook-style:${pressgangVersion}"
|
2011-03-22 11:39:53 -04:00
|
|
|
}
|
2011-03-29 16:14:09 -04:00
|
|
|
|
2011-03-22 11:39:53 -04:00
|
|
|
defaultTasks 'buildDocs'
|
2011-03-29 16:14:09 -04:00
|
|
|
|
2011-03-22 11:39:53 -04:00
|
|
|
jdocbook {
|
2011-03-29 16:14:09 -04:00
|
|
|
// apply shared formatting config ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
format('html_single') {
|
2011-03-22 11:39:53 -04:00
|
|
|
finalName = "index.html"
|
|
|
|
stylesheet = "classpath:/xslt/org/hibernate/jdocbook/xslt/xhtml-single.xsl"
|
|
|
|
}
|
|
|
|
format('html') {
|
|
|
|
finalName = "index.html"
|
|
|
|
stylesheet = "classpath:/xslt/org/hibernate/jdocbook/xslt/xhtml.xsl"
|
|
|
|
}
|
2011-03-29 16:14:09 -04:00
|
|
|
|
|
|
|
// book-specific config ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
quickstart {
|
|
|
|
masterSourceDocumentName = 'Hibernate_Getting_Started_Guide.xml'
|
|
|
|
// only html supported due to tutorials.zip
|
|
|
|
// formats.pdf.enable = false
|
|
|
|
}
|
2011-03-22 11:39:53 -04:00
|
|
|
devguide {
|
|
|
|
masterSourceDocumentName = 'Hibernate_Development_Guide.xml'
|
2012-02-01 13:22:06 -05:00
|
|
|
useRelativeImageUris = false
|
2011-03-22 11:39:53 -04:00
|
|
|
}
|
2011-03-29 16:14:09 -04:00
|
|
|
// todo : need to remove this once all content moved to devguide
|
2011-12-16 10:12:45 -05:00
|
|
|
manual {
|
|
|
|
masterSourceDocumentName = 'HIBERNATE_-_Relational_Persistence_for_Idiomatic_Java.xml'
|
2011-03-29 16:14:09 -04:00
|
|
|
// translation = ['de-DE','es-ES','fr-FR','ja-JP','pt-BR','zh-CN']
|
2011-12-16 10:12:45 -05:00
|
|
|
}
|
2011-03-29 16:14:09 -04:00
|
|
|
}
|
|
|
|
|
2012-02-01 13:22:06 -05:00
|
|
|
// todo : make this part of gradle-jdocbook.
|
|
|
|
// specifically the ability to supply ant-style resource for images (dir + include/exclude patterns)
|
|
|
|
stageStyles_devguide.doLast {
|
2012-02-15 17:31:29 -05:00
|
|
|
logger.lifecycle( "Staging devguide-specific style resources")
|
2012-02-01 13:22:06 -05:00
|
|
|
copy {
|
|
|
|
into project.file( 'target/docbook/stage/devguide/images' )
|
|
|
|
from project.file( 'src/main/docbook/devguide/en-US' )
|
|
|
|
include '**/images/*.png'
|
|
|
|
include '**/images/*.svg'
|
|
|
|
includeEmptyDirs = false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-02-15 17:31:29 -05:00
|
|
|
[ 'devguide', 'manual', 'quickstart' ].each { bookName ->
|
|
|
|
tasks[ "stageStyles_$bookName" ].doLast {
|
|
|
|
logger.lifecycle( "Staging local style resources")
|
|
|
|
copy {
|
|
|
|
into project.file( "target/docbook/stage/$bookName" )
|
|
|
|
from project.file( 'src/main/style' )
|
|
|
|
includeEmptyDirs = false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-03-29 16:14:09 -04:00
|
|
|
task buildTutorialZip(type: Zip) {
|
|
|
|
destinationDir = file( "target/work/tutorials" )
|
|
|
|
archiveName = 'hibernate-tutorials.zip'
|
|
|
|
from 'src/main/docbook/quickstart/tutorials'
|
2011-12-30 13:15:23 -05:00
|
|
|
expand(
|
|
|
|
version: project.version,
|
|
|
|
slf4j: parent.slf4jVersion,
|
|
|
|
junit: parent.junitVersion,
|
|
|
|
h2: parent.h2Version
|
2011-03-29 16:14:09 -04:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
buildDocs.dependsOn buildTutorialZip
|
|
|
|
|
|
|
|
buildDocs.doLast {
|
|
|
|
for ( File languageDir : dirList( "target/docbook/publish/quickstart" ) ) {
|
|
|
|
for ( File formatDir : dirList( languageDir ) ) {
|
|
|
|
final File copyDir = new File( formatDir, "files" );
|
|
|
|
copyDir.mkdirs();
|
|
|
|
ant.copy( file: buildTutorialZip.archivePath.getAbsolutePath(), todir: copyDir.getAbsolutePath() )
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
File[] dirList(String dirName) {
|
|
|
|
return dirList( (File) file(dirName) );
|
|
|
|
}
|
|
|
|
|
|
|
|
File[] dirList(File dir) {
|
|
|
|
return dir.listFiles({file -> file.isDirectory() } as FileFilter).sort();
|
2011-03-22 11:39:53 -04:00
|
|
|
}
|