Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 28 additions & 15 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
buildscript {
repositories {
jcenter()
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath "org.asciidoctor:asciidoctor-gradle-plugin:${project.asciiDoctorGradlePluginVersion}"
classpath "org.asciidoctor:asciidoctor-maven-plugin:${project.asciiDoctorMavenPluginVersion}"
classpath "org.asciidoctor:asciidoctorj-pdf:${project.asciiDoctorJPdfVersion}"
classpath "org.ajoberstar:gradle-git:${project.gradleGitVersion}"
classpath "com.bluepapa32:gradle-watch-plugin:${project.gradleWatchPluginVersion}"
classpath "org.kordamp.gradle:livereload-gradle-plugin:${project.livereloadGradlePluginVersion}"
classpath "org.asciidoctor:asciidoctor-gradle-jvm:${project.asciidoctorGradleJvm}"
classpath "org.asciidoctor:asciidoctor-gradle-base:${project.asciidoctorGradleBase}"
}
}

apply plugin: 'org.asciidoctor.convert'
apply plugin: 'org.asciidoctor.jvm.convert'
apply plugin: 'org.ajoberstar.github-pages'
apply plugin: 'com.bluepapa32.watch'
apply plugin: 'org.kordamp.gradle.livereload'
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'org.asciidoctor.base'

repositories {
jcenter()
mavenCentral()
maven {
url "https://oss.sonatype.org/content/repositories/snapshots"
Expand Down Expand Up @@ -51,19 +51,22 @@ asciidoctor {
sources {
include 'index.adoc'
}
backends = ['html5']
outputOptions {
backends = ['html5']
}
outputDir = file("$buildDir/docs/asciidoc")
resources {
from(sourceDir) {
include 'images/**'
}
}
}

tasks.withType(Copy) {
tasks.withType(Copy).configureEach {
eachFile { println it.file }
}

task copyCNAME(type: Copy) {
tasks.register('copyCNAME', Copy) {
from 'CNAME'
into file(asciidoctor.outputDir.path + '/html5')
}
Expand All @@ -86,13 +89,23 @@ githubPages {
}
}

watch {
asciidoc {
files fileTree('src/docs/asciidoc')
tasks 'asciidoctor'
liveReload {
docRoot asciidoctor.outputDir.canonicalPath
}

tasks.register('watchAsciidoc') {
doLast {
tasks.asciidoctor.execute()
}
}

liveReload {
docRoot asciidoctor.outputDir.canonicalPath
tasks.register('watch') {
doLast {
fileTree('src/docs/asciidoc').visit { fileDetails ->
if (fileDetails.file.isFile()) {
println "Watching file: ${fileDetails.file}"
}
}
tasks.watchAsciidoc.execute()
}
}
5 changes: 3 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
asciiDoctorGradlePluginVersion=1.5.3
asciiDoctorMavenPluginVersion=2.2.6
asciiDoctorJPdfVersion=1.5.0-alpha.10
gradleGitVersion=1.3.2
gradleWatchPluginVersion=0.1.5
livereloadGradlePluginVersion=0.2.1
asciidoctorGradleJvm=2.4.0
asciidoctorGradleBase=2.4.0

description = Vavr Documentation
version = 0.10.4
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists