DATAREDIS-336 - Copy styles to output dir.

Upgraded to Asciidoctor 1.5.0. We now cheat on Gradle docbook-reference-plugin by directly copying files to reference work dir to bypass expanding files. Create an empty source folder so that the plugin does not fail.

Original pull request: #94.
This commit is contained in:
Christoph Strobl
2014-08-11 22:04:54 +02:00
committed by Oliver Gierke
parent fe6b75ee2a
commit c6b2ba75af
5 changed files with 144 additions and 37 deletions

View File

@@ -1,12 +1,14 @@
buildscript {
repositories {
maven { url 'http://repo.spring.io/plugins-release' }
jcenter()
}
dependencies {
classpath 'org.springframework.build.gradle:bundlor-plugin:0.1.2'
classpath 'org.springframework.build.gradle:spring-io-plugin:0.0.3.RELEASE'
classpath 'me.champeau.gradle:gradle-javadoc-hotfix-plugin:0.1'
classpath('org.asciidoctor:asciidoctor-gradle-plugin:0.7.0')
classpath 'io.spring.gradle:docbook-reference-plugin:0.3.0'
classpath 'org.asciidoctor:asciidoctor-gradle-plugin:1.5.0'
classpath('org.asciidoctor:asciidoctor-java-integration:0.1.4.preview.1')
}
}
@@ -18,6 +20,7 @@ repositories {
maven { url "http://repo.spring.io/libs-snapshot" }
maven { url "http://repo.spring.io/plugins-release" }
mavenCentral()
jcenter()
}
apply plugin: "java"
@@ -26,7 +29,8 @@ apply plugin: 'idea'
apply from: "$rootDir/maven.gradle"
apply plugin: 'bundlor'
apply plugin: 'javadocHotfix'
apply plugin: 'asciidoctor'
apply plugin: 'org.asciidoctor.gradle.asciidoctor'
apply plugin: 'docbook-reference'
if (project.hasProperty('platformVersion')) {
apply plugin: 'spring-io'
@@ -49,32 +53,6 @@ configurations.all {
}
}
asciidoctor {
sourceDocumentName = new File("$sourceDir/index.adoc")
outputDir = new File("$buildDir/reference/htmlsingle")
options = [
eruby: 'erubis',
attributes: [
linkcss: 'true',
copycss : '',
icons : 'font',
'source-highlighter': 'prettify',
sectanchors : '',
toc: '',
toclevels: '4',
idprefix: '',
idseparator: '-',
doctype: 'book',
numbered: '',
version: project.version,
baseDir: "$sourceDir",
stylesheet: "spring.css",
resourcesDir: "$rootDir/src/main/resources",
referenceDir: "$sourceDir/reference"
]
]
}
// Common dependencies
dependencies {
// Logging
@@ -91,7 +69,6 @@ dependencies {
compile "org.springframework:spring-tx:$springVersion"
compile("org.springframework:spring-oxm:$springVersion", optional)
compile "org.springframework:spring-aop:$springVersion"
compile "org.springframework.integration:spring-integration-core:4.0.3.RELEASE"
// Redis Drivers
compile("redis.clients:jedis:$jedisVersion", optional)
@@ -150,6 +127,14 @@ javadoc {
title = "${rootProject.description} ${version} API"
}
reference {
sourceDir = file("$buildDir/asciidoc/docbook")
}
referencePdf {
sourceDir = file("$buildDir/asciidoc/docbook")
}
bundlor {
manifestTemplate = file("${projectDir}/template.mf").text
}
@@ -183,9 +168,8 @@ task javadocJar(type: Jar) {
from javadoc
}
task docsZip(type: Zip) {
dependsOn asciidoctor
task docsZip(type: Zip, dependsOn:['docbook', 'generateHTML']) {
group = 'Distribution'
classifier = 'docs'
description = "Builds -${classifier} archive containing api and reference for deployment"
@@ -200,12 +184,12 @@ task docsZip(type: Zip) {
from (asciidoctor.outputDir) {
include "index.html"
include "spring.css"
into 'reference/htmlsingle'
}
from ("src/main/resources/asciidoc") {
include "spring.css"
into "reference/htmlsingle"
from ("$buildDir/reference/pdf") {
into 'reference/pdf'
}
}
@@ -293,5 +277,47 @@ task wrapper(type: Wrapper) {
gradleVersion = '1.11'
}
tasks.withType(org.asciidoctor.gradle.AsciidoctorTask) { docTask ->
options = [
logDocuments: true,
attributes: [
linkcss: 'true',
copycss : 'spring.css',
stylesheet: "spring.css",
icons : 'font',
'source-highlighter': 'prettify',
sectanchors : '',
toc: '',
toclevels: '4',
idprefix: '',
idseparator: '-',
doctype: 'book',
numbered: '',
version: project.version,
baseDir: "$sourceDir",
resourcesDir: "$rootDir/src/main/resources",
referenceDir: "$sourceDir/reference"
]
]
}
task generateHTML (type: org.asciidoctor.gradle.AsciidoctorTask, description: 'Generates single and multiple HTML documentation.', group: 'Documentation') {
backend = 'html5'
outputDir = new File("$buildDir/reference/htmlsingle")
options.attributes.doctype = 'book'
options.attributes.copycss = 'spring.css'
}
task generateDocbook (type: org.asciidoctor.gradle.AsciidoctorTask, description: 'Generates DOCBOOK documentation.', group: 'Documentation', dependsOn : ['createEmptyDocbookSourceDirToCheatThePlugin']) {
backend = 'docbook'
outputDir = new File("$buildDir/reference-work")
options.attributes.chunkedOutput = 'true'
options.attributes.stylesheet = 'chunked'
}
task createEmptyDocbookSourceDirToCheatThePlugin << {
new File("$buildDir/asciidoc/docbook").mkdirs()
}
assemble.dependsOn = ['jar', 'sourcesJar']
defaultTasks 'build'

View File

@@ -0,0 +1,79 @@
<?xml version="1.0" encoding="UTF-8"?>
<book xmlns="http://docbook.org/ns/docbook" version="5.0"
xml:id="spring-data-keyvalue-reference"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xlink="http://www.w3.org/1999/xlink">
<bookinfo>
<title>Spring Data Redis Reference Documentation</title>
<titleabbrev>Spring Data Redis ${version}</titleabbrev>
<releaseinfo>${version}</releaseinfo>
<productname>Spring Data Redis</productname>
<authorgroup>
<author>
<firstname>Costin</firstname>
<surname>Leau</surname>
<affiliation>SpringSource</affiliation>
</author>
<author>
<firstname>Jennifer</firstname>
<surname>Hickey</surname>
<affiliation>SpringSource</affiliation>
</author>
<author>
<firstname>Christoph</firstname>
<surname>Strobl</surname>
<affiliation>Pivotal Software, Inc.</affiliation>
</author>
<author>
<firstname>Thomas</firstname>
<surname>Darimont</surname>
<affiliation>Pivotal Software, Inc.</affiliation>
</author>
</authorgroup>
<legalnotice>
<para>
Copies of this document may be made for your own use and for distribution
to others, provided that you do not charge any fee for such copies and
further provided that each copy contains this Copyright Notice, whether
distributed in print or electronically.
</para>
</legalnotice>
<copyright xmlns:xi="http://www.w3.org/2001/XInclude">
<year>2011-2014</year>
<holder>The original authors.</holder>
</copyright>
</bookinfo>
<toc/>
<xi:include href="preface.xml"/>
<part id="introduction">
<title>Introduction</title>
<xi:include href="introduction/introduction.xml"/>
<xi:include href="introduction/why-sdr.xml"/>
<xi:include href="introduction/requirements.xml"/>
<xi:include href="introduction/getting-started.xml"/>
</part>
<part id="reference">
<title>Reference Documentation</title>
<xi:include href="reference/introduction.xml"/>
<xi:include href="reference/redis.xml"/>
</part>
<part id="appendixes">
<title>Appendixes</title>
<xi:include href="appendix/introduction.xml"/>
<xi:include href="appendix/appendix-schema.xml"/>
<xi:include href="appendix/appendix-command-reference.xml"/>
</part>
</book>

View File

@@ -1,5 +1,5 @@
[float]
= Document structure
= Appendix Document structure
Various appendixes outside the reference documentation.

View File

@@ -177,6 +177,8 @@ public RedisConnectionFactory jedisConnectionFactory() {
}
----
Sometimes direct interaction with the one of the Sentinels is required. Using `RedisConnectionFactory.getSentinelConnection()` or `RedisConnection.getSentinelCommands()` gives you access to the first active Sentinel configured.
[[redis:template]]
== Working with Objects through RedisTemplate