This repository has been archived by the owner on Jul 26, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1k
/
build.gradle
90 lines (76 loc) · 2.4 KB
/
build.gradle
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
88
89
90
// Gradle Configuration File
// For more details take a look at the Java Quickstart chapter in the Gradle
// user guide available at http://gradle.org/docs/5.2.1/userguide/tutorial_java_projects.html
import org.gradle.api.tasks.testing.logging.TestLogEvent
plugins {
id 'java'
id 'org.asciidoctor.convert' version '1.5.6'
}
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
repositories {
mavenCentral()
}
sourceSets {
main {
java {
srcDirs = ['src']
}
resources {
srcDirs = ['src']
}
}
test {
java {
srcDirs = ['test/java']
}
}
}
dependencies {
testImplementation group: 'junit', name: 'junit', version: '4.12'
}
test {
testLogging {
events TestLogEvent.FAILED, TestLogEvent.SKIPPED
// Prints the currently running test's name in the CI's build log,
// so that we can check if tests are being silently skipped or
// stalling the build.
if (System.env.'CI') {
events << TestLogEvent.STARTED
}
}
}
asciidoctor {
backends 'html5'
sourceDir 'docs'
outputDir "${buildDir}/docs"
options = [
template_dirs: [file("${sourceDir}/templates")],
]
attributes = [
linkcss: true,
stylesheet: 'gh-pages.css',
'source-highlighter': 'coderay',
icons: 'font',
experimental: true,
sectlinks: true,
idprefix: '', // for compatibility with GitHub preview
idseparator: '-',
'site-root': "${sourceDir}", // must be the same as sourceDir, do not modify
'site-name': 'AddressBook-Level3',
'site-githuburl': 'https://github.com/se-edu/addressbook-level3',
'site-seedu': true, // delete this line if your project is not a fork (not a SE-EDU project)
]
options['template_dirs'].each {
inputs.files fileTree(it)
}
}
// Copies stylesheets into the directory containing generated HTML files as
// Asciidoctor does not copy linked CSS files to the output directory when rendering.
// This is needed for linked stylesheets and embedded stylesheets which import other files.
task copyStylesheets(type: Copy) {
from "${asciidoctor.sourceDir}/stylesheets"
into "${asciidoctor.outputDir}/html5/stylesheets"
}
asciidoctor.dependsOn copyStylesheets
defaultTasks 'clean', 'test', 'asciidoctor'