Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 107 lines (94 sloc) 3.376 kb
8c56875 @stliu HHH-6036 integration documentation generation
stliu authored
1 buildscript {
2 repositories {
3 mavenCentral()
ba71fe0 @sebersole HHH-6036 - integration documentation generation
sebersole authored
4 mavenLocal()
7a82349 @stliu HHH-7385 change to use gradle 1.1
stliu authored
5 mavenRepo name: 'jboss-nexus', url: "http://repository.jboss.org/nexus/content/groups/public/"
8c56875 @stliu HHH-6036 integration documentation generation
stliu authored
6 }
7 dependencies {
7a82349 @stliu HHH-7385 change to use gradle 1.1
stliu authored
8 classpath "org.jboss.jdocbook:gradle-jdocbook:1.2.1"
8c56875 @stliu HHH-6036 integration documentation generation
stliu authored
9 }
10 }
ba71fe0 @sebersole HHH-6036 - integration documentation generation
sebersole authored
11
12 apply plugin: "java"
8c56875 @stliu HHH-6036 integration documentation generation
stliu authored
13 apply plugin: "jdocbook"
7a82349 @stliu HHH-7385 change to use gradle 1.1
stliu authored
14 ext.pressgangVersion = '3.0.0'
8c56875 @stliu HHH-6036 integration documentation generation
stliu authored
15 dependencies {
7a82349 @stliu HHH-7385 change to use gradle 1.1
stliu authored
16
0e88fdd @sebersole HHH-7153 - Update to newest jDocBook tool chain versions
sebersole authored
17 jdocbookXsl "org.jboss.pressgang:pressgang-xslt-ns:${pressgangVersion}"
18 jdocbookXsl "org.jboss.pressgang:pressgang-fonts:${pressgangVersion}"
19 jdocbookStyles "org.jboss.pressgang:pressgang-jdocbook-style:${pressgangVersion}"
8c56875 @stliu HHH-6036 integration documentation generation
stliu authored
20 }
ba71fe0 @sebersole HHH-6036 - integration documentation generation
sebersole authored
21
8c56875 @stliu HHH-6036 integration documentation generation
stliu authored
22 defaultTasks 'buildDocs'
ba71fe0 @sebersole HHH-6036 - integration documentation generation
sebersole authored
23
8c56875 @stliu HHH-6036 integration documentation generation
stliu authored
24 jdocbook {
ba71fe0 @sebersole HHH-6036 - integration documentation generation
sebersole authored
25 // apply shared formatting config ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
26 format('html_single') {
8c56875 @stliu HHH-6036 integration documentation generation
stliu authored
27 finalName = "index.html"
28 stylesheet = "classpath:/xslt/org/hibernate/jdocbook/xslt/xhtml-single.xsl"
29 }
30 format('html') {
31 finalName = "index.html"
32 stylesheet = "classpath:/xslt/org/hibernate/jdocbook/xslt/xhtml.xsl"
33 }
ba71fe0 @sebersole HHH-6036 - integration documentation generation
sebersole authored
34
35 // book-specific config ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
36 quickstart {
37 masterSourceDocumentName = 'Hibernate_Getting_Started_Guide.xml'
38 // only html supported due to tutorials.zip
39 // formats.pdf.enable = false
40 }
8c56875 @stliu HHH-6036 integration documentation generation
stliu authored
41 devguide {
42 masterSourceDocumentName = 'Hibernate_Development_Guide.xml'
feba0bf @sebersole HHH-7011 - Document multi-tenancy
sebersole authored
43 useRelativeImageUris = false
8c56875 @stliu HHH-6036 integration documentation generation
stliu authored
44 }
ba71fe0 @sebersole HHH-6036 - integration documentation generation
sebersole authored
45 // todo : need to remove this once all content moved to devguide
d02864b @sebersole HHH-6903 - add building of hem and manual docs
sebersole authored
46 manual {
47 masterSourceDocumentName = 'HIBERNATE_-_Relational_Persistence_for_Idiomatic_Java.xml'
ba71fe0 @sebersole HHH-6036 - integration documentation generation
sebersole authored
48 // translation = ['de-DE','es-ES','fr-FR','ja-JP','pt-BR','zh-CN']
d02864b @sebersole HHH-6903 - add building of hem and manual docs
sebersole authored
49 }
ba71fe0 @sebersole HHH-6036 - integration documentation generation
sebersole authored
50 }
51
feba0bf @sebersole HHH-7011 - Document multi-tenancy
sebersole authored
52 // todo : make this part of gradle-jdocbook.
53 // specifically the ability to supply ant-style resource for images (dir + include/exclude patterns)
54 stageStyles_devguide.doLast {
7861fde @sebersole HHH-7067 - Update build to work with Gradle m8
sebersole authored
55 logger.lifecycle( "Staging devguide-specific style resources")
feba0bf @sebersole HHH-7011 - Document multi-tenancy
sebersole authored
56 copy {
57 into project.file( 'target/docbook/stage/devguide/images' )
58 from project.file( 'src/main/docbook/devguide/en-US' )
59 include '**/images/*.png'
60 include '**/images/*.svg'
61 includeEmptyDirs = false
62 }
63 }
64
7861fde @sebersole HHH-7067 - Update build to work with Gradle m8
sebersole authored
65 [ 'devguide', 'manual', 'quickstart' ].each { bookName ->
66 tasks[ "stageStyles_$bookName" ].doLast {
67 logger.lifecycle( "Staging local style resources")
68 copy {
69 into project.file( "target/docbook/stage/$bookName" )
70 from project.file( 'src/main/style' )
71 includeEmptyDirs = false
72 }
73 }
74 }
75
ba71fe0 @sebersole HHH-6036 - integration documentation generation
sebersole authored
76 task buildTutorialZip(type: Zip) {
77 destinationDir = file( "target/work/tutorials" )
78 archiveName = 'hibernate-tutorials.zip'
79 from 'src/main/docbook/quickstart/tutorials'
f6dec69 @sebersole HHH-6909 - "Getting Started Guide" example code cannot be run success…
sebersole authored
80 expand(
81 version: project.version,
82 slf4j: parent.slf4jVersion,
83 junit: parent.junitVersion,
84 h2: parent.h2Version
ba71fe0 @sebersole HHH-6036 - integration documentation generation
sebersole authored
85 )
86 }
87
88 buildDocs.dependsOn buildTutorialZip
89
90 buildDocs.doLast {
91 for ( File languageDir : dirList( "target/docbook/publish/quickstart" ) ) {
92 for ( File formatDir : dirList( languageDir ) ) {
93 final File copyDir = new File( formatDir, "files" );
94 copyDir.mkdirs();
95 ant.copy( file: buildTutorialZip.archivePath.getAbsolutePath(), todir: copyDir.getAbsolutePath() )
96 }
97 }
98 }
99
100 File[] dirList(String dirName) {
101 return dirList( (File) file(dirName) );
102 }
103
104 File[] dirList(File dir) {
105 return dir.listFiles({file -> file.isDirectory() } as FileFilter).sort();
8c56875 @stliu HHH-6036 integration documentation generation
stliu authored
106 }
Something went wrong with that request. Please try again.