forked from nusCS2113-AY1819S1/addressbook-level3
-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.gradle
131 lines (106 loc) · 3.45 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
// 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'
id 'jacoco'
id 'checkstyle'
id 'com.github.johnrengelman.shadow' version '2.0.3'
id 'application'
}
mainClassName = 'seedu.addressbook.Main'
sourceCompatibility = JavaVersion.VERSION_1_9
targetCompatibility = JavaVersion.VERSION_1_9
repositories {
mavenCentral()
}
checkstyle {
toolVersion = '8.1'
}
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'
compile 'org.apache.httpcomponents:httpclient:4.5.6'
compile group: 'org.json', name: 'json', version: '20090211'
compile group: 'commons-io', name: 'commons-io', version: '2.6'
compile group: 'org.javatuples', name: 'javatuples', version: '1.2'
testImplementation group: 'junit', name: 'junit', version: '4.12'
}
shadowJar{
archiveName = '[F10-3][PRISM].jar'
destinationDir = file("${buildDir}/jar/")
}
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': 'main',
'site-githuburl': 'https://github.com/CS2113-AY1819S1-F10-3/main',
'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)
}
}
jacocoTestReport {
reports {
xml.enabled true
html.enabled false
}
}
// 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
check.dependsOn jacocoTestReport
defaultTasks 'clean', 'test', 'asciidoctor', 'checkstyleMain', 'checkstyleTest'