-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
87 lines (76 loc) · 2.68 KB
/
build.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
// https://asciidoctor.github.io/asciidoctor-gradle-plugin/development-3.x/user-guide/
// doc: https://asciidoctor.github.io/asciidoctor-gradle-plugin/development-3.x/
// src: https://github.com/asciidoctor/asciidoctor-gradle-plugin
// project: https://asciidoctor.org/docs/asciidoctor-gradle-plugin/
repositories {
// jcenter() // don't delete, otherwise fails
mavenCentral()
mavenLocal()
}
plugins {
id("org.asciidoctor.jvm.convert") version "4.0.3"
// id("com.github.christophpickl.linkchecker") version "1.0"
}
buildscript {
repositories {
gradlePluginPortal()
mavenLocal()
// dependencies {
// classpath "com.github.christophpickl:linkChecker:1.0"
// }
}
}
tasks {
"asciidoctor"(org.asciidoctor.gradle.jvm.AsciidoctorTask::class) {
doFirst {
println("asciidoctor: source=${Locations.sourceDirectory} output=${Locations.htmlBuildOutput}")
}
// options(mapOf("doctype" to "book", "ruby" to "erubis"))
attributes = mapOf(
// https://docs.asciidoctor.org/asciidoctor/latest/html-backend/default-stylesheet/#customize-docinfo
// "docinfo" to "shared"
"stylesheet" to "custom.css",
)
sourceDir(Locations.sourceDirectory)
setOutputDir(Locations.htmlBuildOutput)
// https://asciidoctor.github.io/asciidoctor-gradle-plugin/master/user-guide/
// copyAllResources
// resources
}
}
val copyResourcesTask = tasks.register<Copy>("copyResources") {
doFirst {
println("Copying resources from ${Locations.sourceDirectory} to ${Locations.htmlBuildOutput}")
}
from(Locations.sourceDirectory)
include(*Constants.includedNonHtmlFileExtensions.map { "**/*.$it" }.toList().toTypedArray())
into(Locations.htmlBuildOutput)
}
tasks.build {
dependsOn(copyResourcesTask)
dependsOn("asciidoctor")
}
tasks.register<GradleBuild>("deploy") {
tasks = listOf("copyLocalDocs") //, "copyLocalSite")
}
tasks.register<Copy>("copyLocalDocs") {
doFirst {
println("Local copy to: ${Locations.githubTargetDirectory}")
}
from(Locations.htmlBuildOutput)
into(Locations.githubTargetDirectory)
}
//tasks.register<Copy>("copyLocalSite") {
// doFirst {
// println("Local deploy to: ${Constants.localWebRoot}")
// }
// from(Locations.htmlBuildOutput)
// //include("**/*.jpg")
// into(Constants.localWebRoot)
//}
// ./gradlew -q linkChecker
//tasks.create<LinkCheckerTask>("linkChecker") {
// localBuildDirAbsPath = Locations.htmlBuildOutput.absolutePath
// websiteHomePagePath = "/index.html"
// linkCheckIgnore = setOf("https://quizlet.com/nl/603903561/psychology-flash-cards/")
//}