This repository has been archived by the owner on Sep 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
124 lines (104 loc) · 3.16 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
apply plugin: 'java'
apply plugin: 'idea'
defaultTasks 'updateSubmodules', 'check', 'installDist', 'war', 'alljavadoc'
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.6.3'
}
}
apply plugin: 'com.github.kt3k.coveralls'
task updateSubmodules(type: Exec) {
commandLine 'git', 'submodule', 'update'
}
idea {
project {
jdkName = '1.8'
languageLevel = '1.8'
}
}
allprojects {
apply plugin: 'jacoco'
}
subprojects {
if (['Processor','Reader','UI','shared','Replayer','Publisher'].contains(name)) {
apply plugin: 'java'
sourceCompatibility = '1.8'
version = '0.4'
repositories {
mavenCentral()
}
dependencies {
// Testing dependencies
// JUnit, duh
testCompile group: 'junit', name: 'junit', version: '4.+'
// Hamcrest provides assertThat
testCompile group: 'org.hamcrest', name: 'hamcrest-all', version: '1.+'
// Shazamcrest provides sameBeanAs
testCompile group: 'com.shazam', name: 'shazamcrest', version: '0.+'
// Mockito for mocking
testCompile group: 'org.mockito', name: 'mockito-all', version: '1.+'
// Hamcrest-JSON provides sameJson
testCompile group: 'uk.co.datumedge', name: 'hamcrest-json', version: '0.+'
}
jacocoTestReport {
reports {
xml.enabled = true
html.enabled = true
csv.enabled = false
}
}
}
}
def exportedProjects = [
":shared",
":Processor",
":Reader",
":Publisher"
]
repositories {
jcenter()
}
configurations {
asciidoclet
}
dependencies {
asciidoclet 'org.asciidoctor:asciidoclet:1.+'
}
task jacocoRootReport(type: org.gradle.testing.jacoco.tasks.JacocoReport) {
def testedProjects = exportedProjects.collect { project(it) }
dependsOn = testedProjects.test
sourceDirectories = files(testedProjects.sourceSets.main.allSource.srcDirs)
classDirectories = files(testedProjects.sourceSets.main.output)
executionData = files(testedProjects.jacocoTestReport.executionData)
reports {
html.enabled = true
xml.enabled = true
csv.enabled = false
xml.destination = "${buildDir}/reports/jacoco/test/jacocoTestReport.xml"
}
onlyIf = {
true
}
doFirst {
executionData = files(executionData.findAll {
it.exists()
})
}
}
coveralls {
def testedProjects = exportedProjects.collect { project(it) }
sourceDirs = files(testedProjects.sourceSets.main.allSource.srcDirs).files.absolutePath
}
task alljavadoc(type: Javadoc) {
source exportedProjects.collect { project(it).sourceSets.main.allJava }
destinationDir = file("${buildDir}/doc/javadoc");
classpath = files(exportedProjects.collect { project(it).sourceSets.main.compileClasspath })
}
alljavadoc {
options.docletpath = configurations.asciidoclet.files.asType(List)
options.doclet = 'org.asciidoctor.Asciidoclet'
options.addStringOption('-base-dir', "${projectDir}")
}