浏览代码

SEC-2785: Reference outputs PDF, Html Multi, & epub

Rob Winch 10 年之前
父节点
当前提交
5f5e7e7265
共有 2 个文件被更改,包括 17 次插入4 次删除
  1. 1 0
      build.gradle
  2. 16 4
      docs/docs.gradle

+ 1 - 0
build.gradle

@@ -10,6 +10,7 @@ buildscript {
         classpath("org.gradle.api.plugins:gradle-tomcat-plugin:1.2.3")
         classpath('me.champeau.gradle:gradle-javadoc-hotfix-plugin:0.1')
         classpath('org.asciidoctor:asciidoctor-gradle-plugin:1.5.1')
+        classpath("io.spring.gradle:docbook-reference-plugin:0.3.0")
     }
 }
 

+ 16 - 4
docs/docs.gradle

@@ -2,12 +2,13 @@
 apply plugin: 'base'
 
 task docs {
-    dependsOn 'manual:asciidoctor', 'apidocs', 'guides:asciidoctor'
+    dependsOn 'manual:reference', 'apidocs', 'guides:asciidoctor'
 }
 
 project('manual') {
     apply plugin: 'base'
     apply plugin: 'org.asciidoctor.gradle.asciidoctor'
+    apply plugin: 'docbook-reference'
 
     ext.expandPlaceholders = ""
 
@@ -16,6 +17,7 @@ project('manual') {
     }
 
     asciidoctor {
+        backends = ['docbook5']
         options = [
           eruby: 'erubis',
           attributes: [
@@ -35,11 +37,21 @@ project('manual') {
         ]
     }
 
+    reference {
+        sourceDir = new File(asciidoctor.outputDir , 'docbook5')
+        pdfFilename = "spring-security-reference.pdf"
+        epubFilename = "spring-security-reference.epub"
+        expandPlaceholders = ""
+    }
+
+    afterEvaluate {
+        tasks.findAll { it.name.startsWith("reference") }.each{ it.dependsOn.add("asciidoctor") }
+    }
+
 
     ext.spec = copySpec {
-        into ('reference/htmlsingle') {
-            from(asciidoctor.outputDir)
-            exclude 'build', 'Guardfile'
+        from (reference) {
+            into 'reference'
         }
     }
 }