forked from se-edu/addressbook-level25
-
Notifications
You must be signed in to change notification settings - Fork 41
/
build.gradle
99 lines (83 loc) · 2.78 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
91
92
93
94
95
96
97
98
99
// 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/4.8.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_9
targetCompatibility = JavaVersion.VERSION_1_9
repositories {
mavenCentral()
}
sourceSets {
main {
java {
srcDirs = ['src']
}
resources {
srcDirs = ['src']
}
}
test {
java {
srcDirs = ['test/java']
}
}
}
dependencies {
implementation group: 'javax.xml.bind', name: 'jaxb-api', version: '2.2.8'
implementation group: 'com.sun.xml.bind', name: 'jaxb-impl', version: '2.3.0'
implementation group: 'com.sun.xml.bind', name: 'jaxb-core', version: '2.3.0'
implementation group: 'javax.activation', name: 'activation', version: '1.1.1'
testImplementation group: 'junit', name: 'junit', version: '4.12'
}
task wrapper(type: Wrapper) {
gradleVersion = '4.8.1'
}
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'