-
Notifications
You must be signed in to change notification settings - Fork 125
/
build.gradle
118 lines (99 loc) · 3.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
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
import java.util.stream.Collectors
buildscript {
ext.kotlinVersion = '1.2.41'
ext.spekVersion = '1.1.5'
ext.moshiVersion = '1.6.0'
ext.autoValueVersion = '1.5.4'
ext.dokkaVersion = '0.9.17'
ext.okhttpVersion = '3.10.0'
repositories {
jcenter()
maven { url 'https://plugins.gradle.org/m2/' }
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath 'org.junit.platform:junit-platform-gradle-plugin:1.0.0'
classpath "org.jetbrains.dokka:dokka-gradle-plugin:${dokkaVersion}"
classpath 'net.ltgt.gradle:gradle-apt-plugin:0.13'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.0'
}
}
apply plugin: 'jacoco'
repositories {
jcenter()
}
task wrapper(type: Wrapper) {
gradleVersion = '4.7'
distributionType = org.gradle.api.tasks.wrapper.Wrapper.DistributionType.ALL
}
subprojects {
apply plugin: 'org.junit.platform.gradle.plugin'
apply plugin: 'kotlin'
apply plugin: 'jacoco'
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
group = 'net.dean.jraw'
version = '1.1.0'
repositories {
jcenter()
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
testCompile 'com.winterbe:expekt:0.5.0'
testCompile ("org.jetbrains.spek:spek-api:$spekVersion") {
exclude group: 'org.jetbrains.kotlin'
}
testRuntime 'org.junit.platform:junit-platform-engine:1.0.0'
testRuntime "org.jetbrains.spek:spek-junit-platform-engine:$spekVersion"
}
compileKotlin {
kotlinOptions {
apiVersion = "1.1"
languageVersion = "1.1"
}
}
project.afterEvaluate {
def junitPlatformTestTask = project.tasks.getByName('junitPlatformTest')
jacoco {
toolVersion = "0.7.9"
reportsDir = file("$buildDir/reports/jacoco")
applyTo junitPlatformTestTask
}
project.task(type: JacocoReport, "junitPlatformJacocoReport", {
sourceDirectories = files("src/main/kotlin")
classDirectories = files("$buildDir/classes/main")
reports {
xml.enabled = true
html.enabled = true
xml.destination file("$buildDir/reports/jacoco/test/jacocoTestReport.xml")
html.destination file("$buildDir/reports/jacoco/test/jacocoTestReport.html")
}
executionData junitPlatformTestTask
})
}
junitPlatform {
platformVersion '1.0.0'
filters {
engines {
include 'spek'
}
}
}
}
// Only do code coverage for :lib
def reportedProjects = subprojects.findAll { it.name == "lib" }
def subprojectsExecFiles = files(reportedProjects.stream().map { "${it.name}/build/jacoco/junitPlatformTest.exec" }.collect(Collectors.toList()) )
task jacocoRootReport(type: JacocoReport) {
additionalSourceDirs = files(reportedProjects.sourceSets.main.allSource.srcDirs)
sourceDirectories = files(reportedProjects.sourceSets.main.allSource.srcDirs)
classDirectories = files(reportedProjects.sourceSets.main.output)
executionData = subprojectsExecFiles
reports {
html.enabled = true
xml.enabled = true
csv.enabled = false
}
onlyIf = {
true
}
}