1
1
buildscript {
2
2
repositories {
3
- jcenter()
4
3
mavenCentral()
4
+ maven { url " https://plugins.gradle.org/m2/" }
5
5
}
6
6
dependencies {
7
- classpath " org.asciidoctor:asciidoctor-gradle -plugin:${ project.asciiDoctorGradlePluginVersion } "
7
+ classpath " org.asciidoctor:asciidoctor-maven -plugin:${ project.asciiDoctorMavenPluginVersion } "
8
8
classpath " org.asciidoctor:asciidoctorj-pdf:${ project.asciiDoctorJPdfVersion} "
9
9
classpath " org.ajoberstar:gradle-git:${ project.gradleGitVersion} "
10
- classpath " com.bluepapa32:gradle-watch-plugin:${ project.gradleWatchPluginVersion} "
11
10
classpath " org.kordamp.gradle:livereload-gradle-plugin:${ project.livereloadGradlePluginVersion} "
11
+ classpath " org.asciidoctor:asciidoctor-gradle-jvm:${ project.asciidoctorGradleJvm} "
12
+ classpath " org.asciidoctor:asciidoctor-gradle-base:${ project.asciidoctorGradleBase} "
12
13
}
13
14
}
14
15
15
- apply plugin : ' org.asciidoctor.convert'
16
+ apply plugin : ' org.asciidoctor.jvm. convert'
16
17
apply plugin : ' org.ajoberstar.github-pages'
17
- apply plugin : ' com.bluepapa32.watch'
18
18
apply plugin : ' org.kordamp.gradle.livereload'
19
19
apply plugin : ' java'
20
20
apply plugin : ' idea'
21
+ apply plugin : ' org.asciidoctor.base'
21
22
22
23
repositories {
23
- jcenter()
24
24
mavenCentral()
25
25
maven {
26
26
url " https://oss.sonatype.org/content/repositories/snapshots"
@@ -51,19 +51,22 @@ asciidoctor {
51
51
sources {
52
52
include ' index.adoc'
53
53
}
54
- backends = [' html5' ]
54
+ outputOptions {
55
+ backends = [' html5' ]
56
+ }
57
+ outputDir = file(" $buildDir /docs/asciidoc" )
55
58
resources {
56
59
from(sourceDir) {
57
60
include ' images/**'
58
61
}
59
62
}
60
63
}
61
64
62
- tasks. withType(Copy ) {
65
+ tasks. withType(Copy ). configureEach {
63
66
eachFile { println it. file }
64
67
}
65
68
66
- task copyCNAME ( type : Copy ) {
69
+ tasks . register( ' copyCNAME ' , Copy ) {
67
70
from ' CNAME'
68
71
into file(asciidoctor. outputDir. path + ' /html5' )
69
72
}
@@ -86,13 +89,23 @@ githubPages {
86
89
}
87
90
}
88
91
89
- watch {
90
- asciidoc {
91
- files fileTree(' src/docs/asciidoc' )
92
- tasks ' asciidoctor'
92
+ liveReload {
93
+ docRoot asciidoctor. outputDir. canonicalPath
94
+ }
95
+
96
+ tasks. register(' watchAsciidoc' ) {
97
+ doLast {
98
+ tasks. asciidoctor. execute()
93
99
}
94
100
}
95
101
96
- liveReload {
97
- docRoot asciidoctor. outputDir. canonicalPath
102
+ tasks. register(' watch' ) {
103
+ doLast {
104
+ fileTree(' src/docs/asciidoc' ). visit { fileDetails ->
105
+ if (fileDetails. file. isFile()) {
106
+ println " Watching file: ${ fileDetails.file} "
107
+ }
108
+ }
109
+ tasks. watchAsciidoc. execute()
110
+ }
98
111
}
0 commit comments