Skip to content

Commit 454e30e

Browse files
Jay Bryantartembilan
authored andcommitted
Modernize the look and feel and remove Docbook
* Upgrade to latest `sciidoctor-gradle-plugin` and `asciidoctorj-pdf` * Remove `Authors:` and move `version` before Copyright in the `index.adoc`
1 parent c7f6148 commit 454e30e

File tree

4 files changed

+71
-762
lines changed

4 files changed

+71
-762
lines changed

build.gradle

Lines changed: 59 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ buildscript {
44
maven { url 'https://repo.spring.io/plugins-release' }
55
}
66
dependencies {
7-
classpath 'io.spring.gradle:docbook-reference-plugin:0.3.1'
8-
classpath 'org.asciidoctor:asciidoctor-gradle-plugin:1.5.8'
7+
classpath 'org.asciidoctor:asciidoctor-gradle-plugin:1.5.9.2'
8+
classpath 'org.asciidoctor:asciidoctorj-pdf:1.5.0-alpha.16'
99
classpath 'me.champeau.gradle:gradle-javadoc-hotfix-plugin:0.1'
1010
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
1111
classpath "org.jetbrains.kotlin:kotlin-allopen:$kotlinVersion"
@@ -22,8 +22,6 @@ apply plugin: 'base'
2222
apply plugin: 'project-report'
2323
apply plugin: 'idea'
2424

25-
def docsDir = 'src/reference/asciidoc'
26-
2725
ext {
2826
isTravisBuild = System.getenv().get("TRAVIS") == 'true'
2927
linkHomepage = 'https://projects.spring.io/spring-amqp'
@@ -32,6 +30,7 @@ ext {
3230
linkScmUrl = 'https://github.com/spring-projects/spring-amqp'
3331
linkScmConnection = 'git://github.com/spring-projects/spring-amqp.git'
3432
linkScmDevConnection = '[email protected]:spring-projects/spring-amqp.git'
33+
docResourcesVersion = '0.1.0.RELEASE'
3534
}
3635

3736
allprojects {
@@ -329,40 +328,64 @@ project('spring-rabbit-test') {
329328

330329
}
331330

331+
configurations {
332+
docs
333+
}
334+
335+
dependencies {
336+
docs "io.spring.docresources:spring-doc-resources:${docResourcesVersion}@zip"
337+
}
338+
339+
task prepareAsciidocBuild(type: Sync) {
340+
dependsOn configurations.docs
341+
from {
342+
configurations.docs.collect { zipTree(it) }
343+
}
344+
from 'src/reference/asciidoc/'
345+
into "$buildDir/asciidoc"
346+
}
347+
332348
apply plugin: 'org.asciidoctor.convert'
333349

334-
asciidoctor {
335-
sourceDir = file("$docsDir")
350+
task reference(type: org.asciidoctor.gradle.AsciidoctorTask) {
351+
backends = ['pdf']
352+
sourceDir "$buildDir/asciidoc"
336353
sources {
337354
include 'index.adoc'
338-
}
339-
backends = ['html5', 'docbook']
340-
logDocuments = true
341-
options = [
342-
doctype: 'book',
343-
]
344-
attributes = [
345-
docinfo: '',
346-
toc2: '',
347-
'compat-mode': '',
348-
imagesdir: '',
349-
stylesdir: "stylesheets/",
350-
stylesheet: 'golo.css',
351-
'spring-amqp-version': "$version",
352-
'source-highlighter': 'highlightjs'
353-
]
355+
}
356+
options doctype: 'book', eruby: 'erubis'
357+
attributes 'source-highlighter': 'coderay',
358+
'icons': 'font',
359+
"project-version=$project.version"
354360
}
355361

356-
apply plugin: DocbookReferencePlugin
362+
reference.dependsOn asciidoctor
357363

358-
reference {
359-
sourceFileName = 'index.xml'
360-
sourceDir = file("$buildDir/asciidoc/docbook")
361-
pdfFilename = 'spring-amqp-reference.pdf'
362-
expandPlaceholders = ''
364+
asciidoctor {
365+
sourceDir "$buildDir/asciidoc"
366+
sources {
367+
include 'index.adoc'
368+
}
369+
resources {
370+
from(sourceDir) {
371+
include 'images/*', 'css/**', 'js/**'
372+
}
373+
}
374+
logDocuments = true
375+
backends = ['html5']
376+
options doctype: 'book', eruby: 'erubis'
377+
attributes 'docinfo': 'shared',
378+
stylesdir: "css/",
379+
stylesheet: 'spring.css',
380+
'linkcss': true,
381+
'icons': 'font',
382+
'source-highlighter=highlight.js',
383+
'highlightjsdir=js/highlight',
384+
'highlightjs-theme=atom-one-dark-reasonable',
385+
"project-version=$project.version"
363386
}
364387

365-
reference.dependsOn asciidoctor
388+
asciidoctor.dependsOn prepareAsciidocBuild
366389

367390
sonarqube {
368391
properties {
@@ -426,7 +449,7 @@ task schemaZip(type: Zip) {
426449
}
427450
}
428451

429-
task docsZip(type: Zip) {
452+
task docsZip(type: Zip, dependsOn: [reference]) {
430453
group = 'Distribution'
431454
classifier = 'docs'
432455
description = "Builds -${classifier} archive containing api and reference " +
@@ -440,7 +463,12 @@ task docsZip(type: Zip) {
440463
into 'api'
441464
}
442465

443-
from (reference) {
466+
from ('build/asciidoc/html5') {
467+
into 'reference'
468+
}
469+
470+
from ('build/asciidoc/pdf') {
471+
include 'index.pdf'
444472
into 'reference'
445473
}
446474
}

src/reference/asciidoc/index-docinfo.xml

Lines changed: 0 additions & 52 deletions
This file was deleted.

src/reference/asciidoc/index.adoc

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
11
[[spring-amqp-reference]]
2-
32
= Spring AMQP
3+
:toc: left
4+
:toclevels: 4
5+
:numbered:
6+
:icons: font
7+
:hide-uri-scheme:
8+
Mark Pollack; Mark Fisher; Oleg Zhurakousky; Dave Syer; Gary Russell; Gunnar Hillert; Artem Bilan; Stéphane Nicoll; Arnaud Cogoluègnes; Jay Bryant
9+
10+
*{project-version}*
11+
12+
(C) 2010 - 2019 by Pivotal Software, Inc.
13+
14+
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.
415

5-
:toc:
616

717
== Preface
818

0 commit comments

Comments
 (0)