Skip to content

Commit 3156c99

Browse files
Update asciidoctor and gradle (#52)
1 parent 1bc3981 commit 3156c99

File tree

3 files changed

+32
-18
lines changed

3 files changed

+32
-18
lines changed

build.gradle

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
buildscript {
22
repositories {
3-
jcenter()
43
mavenCentral()
4+
maven { url "https://plugins.gradle.org/m2/" }
55
}
66
dependencies {
7-
classpath "org.asciidoctor:asciidoctor-gradle-plugin:${project.asciiDoctorGradlePluginVersion}"
7+
classpath "org.asciidoctor:asciidoctor-maven-plugin:${project.asciiDoctorMavenPluginVersion}"
88
classpath "org.asciidoctor:asciidoctorj-pdf:${project.asciiDoctorJPdfVersion}"
99
classpath "org.ajoberstar:gradle-git:${project.gradleGitVersion}"
10-
classpath "com.bluepapa32:gradle-watch-plugin:${project.gradleWatchPluginVersion}"
1110
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}"
1213
}
1314
}
1415

15-
apply plugin: 'org.asciidoctor.convert'
16+
apply plugin: 'org.asciidoctor.jvm.convert'
1617
apply plugin: 'org.ajoberstar.github-pages'
17-
apply plugin: 'com.bluepapa32.watch'
1818
apply plugin: 'org.kordamp.gradle.livereload'
1919
apply plugin: 'java'
2020
apply plugin: 'idea'
21+
apply plugin: 'org.asciidoctor.base'
2122

2223
repositories {
23-
jcenter()
2424
mavenCentral()
2525
maven {
2626
url "https://oss.sonatype.org/content/repositories/snapshots"
@@ -51,19 +51,22 @@ asciidoctor {
5151
sources {
5252
include 'index.adoc'
5353
}
54-
backends = ['html5']
54+
outputOptions {
55+
backends = ['html5']
56+
}
57+
outputDir = file("$buildDir/docs/asciidoc")
5558
resources {
5659
from(sourceDir) {
5760
include 'images/**'
5861
}
5962
}
6063
}
6164

62-
tasks.withType(Copy) {
65+
tasks.withType(Copy).configureEach {
6366
eachFile { println it.file }
6467
}
6568

66-
task copyCNAME(type: Copy) {
69+
tasks.register('copyCNAME', Copy) {
6770
from 'CNAME'
6871
into file(asciidoctor.outputDir.path + '/html5')
6972
}
@@ -86,13 +89,23 @@ githubPages {
8689
}
8790
}
8891

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()
9399
}
94100
}
95101

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+
}
98111
}

gradle.properties

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
asciiDoctorGradlePluginVersion=1.5.3
1+
asciiDoctorMavenPluginVersion=2.2.6
22
asciiDoctorJPdfVersion=1.5.0-alpha.10
33
gradleGitVersion=1.3.2
4-
gradleWatchPluginVersion=0.1.5
54
livereloadGradlePluginVersion=0.2.1
5+
asciidoctorGradleJvm=2.4.0
6+
asciidoctorGradleBase=2.4.0
67

78
description = Vavr Documentation
89
version = 0.10.4
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.2-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)