1
- import org.grails.gradle.plugin.doc.PublishGuideTask
2
-
3
- apply plugin : ' org.grails.grails-doc'
4
-
5
1
configurations. register(' groovydocConfiguration' )
6
2
configurations. register(' guideConfiguration' )
7
3
8
4
dependencies {
9
-
10
5
add(' groovydocConfiguration' , localGroovy(), {
11
6
because ' groovydoc needs to run with the same version as Gradle'
12
7
})
13
-
14
8
add(' guideConfiguration' , libs. grails. docs)
15
9
add(' guideConfiguration' , libs. groovy. templates)
16
10
add(' guideConfiguration' , libs. slf4j. nop) // Get rid of logs during guide generation
@@ -25,8 +19,43 @@ tasks.withType(Groovydoc).configureEach {
25
19
groovyClasspath = configurations. groovydocConfiguration
26
20
}
27
21
28
- tasks. withType(PublishGuideTask ). configureEach {
29
- classpath = configurations. guideConfiguration
30
- javadocDir = null
31
- propertiesFile = layout. projectDirectory. file(' src/docs/guide.properties' ). asFile
22
+ asciidoctor {
23
+ baseDir = file(' src/docs' )
24
+ sourceDir = file(' src/docs' )
25
+ outputDir = file(' build/docs/manual' )
26
+ sources {
27
+ include ' index.adoc'
28
+ }
29
+ jvm {
30
+ jvmArgs + = [
31
+ ' --add-opens' , ' java.base/sun.nio.ch=ALL-UNNAMED' ,
32
+ ' --add-opens' , ' java.base/java.io=ALL-UNNAMED'
33
+ ]
34
+ }
35
+ attributes = [
36
+ copyright : ' Apache License, Version 2.0' ,
37
+ docinfo1 : ' true' ,
38
+ doctype : ' book' ,
39
+ encoding : ' utf-8' ,
40
+ icons : ' font' ,
41
+ id : " $rootProject . name :$projectVersion " ,
42
+ idprefix : ' ' ,
43
+ idseparator : ' -' ,
44
+ lang : ' en' ,
45
+ linkattrs : true ,
46
+ numbered : ' ' ,
47
+ producer : ' Asciidoctor' ,
48
+ revnumber : projectVersion,
49
+ setanchors : true ,
50
+ ' source-highlighter' : ' prettify' ,
51
+ toc : ' left' ,
52
+ toc2 : ' ' ,
53
+ toclevels : ' 2' ,
54
+ projectVersion : projectVersion
55
+ ]
56
+ }
57
+
58
+ tasks. register(' docs' ) {
59
+ group = ' documentation'
60
+ dependsOn ' asciidoctor' , ' groovydoc'
32
61
}
0 commit comments