-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.gradle
169 lines (143 loc) · 4.99 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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
buildscript {
ext.kotlin_version = '1.3.10'
ext.ktor_version = '1.0.0'
ext.spring_boot_version = '1.5.19.RELEASE'
repositories {
mavenCentral()
jcenter()
// gradle plugins repository
gradlePluginPortal()
}
configurations.maybeCreate("pitest")
dependencies {
classpath "org.jetbrains.dokka:dokka-gradle-plugin:0.9.17"
classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.6.2"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.6'
classpath 'info.solidsoft.gradle.pitest:gradle-pitest-plugin:1.3.0'
classpath "org.jetbrains.kotlin:kotlin-allopen:$kotlin_version"
classpath 'com.github.jengelman.gradle.plugins:shadow:4.0.1'
pitest 'org.pitest:pitest-junit5-plugin:0.3'
}
}
plugins {
id "com.github.dolgopolovwork.testreport" version "1"
}
group = 'd3'
version = '1.0-SNAPSHOT'
apply plugin: 'com.google.protobuf'
apply plugin: "jacoco"
apply plugin: 'info.solidsoft.pitest'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'org.sonarqube'
testReport {
testFolders = Arrays.asList(
"notary-iroha-integration-test",
"notary-sora-integration-test",
"notifications-integration-test")
}
allprojects {
apply plugin: 'java'
apply plugin: 'kotlin'
apply plugin: 'org.jetbrains.dokka'
apply plugin: 'maven'
repositories {
mavenCentral()
// for Ktor
jcenter()
maven { url = 'https://dl.bintray.com/kotlin/ktor' }
maven { url 'https://jitpack.io' }
}
}
subprojects {
dokka {
outputFormat = 'html'
outputDirectory = "build/reports/dokka"
reportUndocumented = true
sourceDirs = files("${project.projectDir}/src/main/kotlin")
}
sonarqube {
properties {
property "sonar.java.binaries", "${project.projectDir}/build/classes"
property "sonar.java.test.binaries", "${project.projectDir}/build/test-results/test/binary"
property "sonar.junit.reportsPaths", "${project.projectDir}/build/test-results/**/*.xml"
property "sonar.jacoco.reportPaths", "${project.projectDir}/build/jacoco/test.exec"
property "sonar.exclusions", "${project.projectDir}/**/*.txt"
}
}
}
sourceCompatibility = 1.8
// ------------------| Test dependencies |------------------
allprojects {
dependencies {
// unit tests
testCompile('org.junit.jupiter:junit-jupiter-api:5.2.0')
testRuntime('org.junit.jupiter:junit-jupiter-engine:5.2.0')
// https://mvnrepository.com/artifact/org.mockito/mockito-all
testCompile group: 'org.mockito', name: 'mockito-all', version: '2.0.2-beta'
compile("com.nhaarman.mockitokotlin2:mockito-kotlin:2.1.0")
// for setting env variables in tests
testCompile group: 'com.github.stefanbirkner', name: 'system-rules', version: '1.18.0'
// to run both junit4 and junit5 tests
testRuntime("org.junit.vintage:junit-vintage-engine:5.2.0")
}
}
wrapper {
gradleVersion = 4.10
}
allprojects {
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
}
protobuf {
protoc {
artifact = "com.google.protobuf:protoc:3.5.1"
}
plugins {
grpc {
artifact = 'io.grpc:protoc-gen-grpc-java:1.14.0'
}
}
generateProtoTasks {
all()*.plugins {
grpc {}
}
}
}
compileKotlin.dependsOn ':generateProto'
// -------------------------| End Iroha bindings |-------------------------
// -------------------------| PIT mutation testing |-------------------------
pitest {
pitestVersion = "1.3.0"
testPlugin = "junit5"
targetClasses = ['util.*', 'notary.*', 'registration.*', 'withdrawalservice.*']
excludedClasses = ['notary.db.*', '*Test*']
targetTests = ['util.*', 'notary.*', 'registration.*', 'withdrawalservice.*']
avoidCallsTo = ['kotlin.jvm.internal', 'mu']
mutators = ['CONDITIONALS_BOUNDARY', 'NEGATE_CONDITIONALS', 'REMOVE_CONDITIONALS', 'MATH', 'INCREMENTS',
'INVERT_NEGS', 'INLINE_CONSTS', 'VOID_METHOD_CALLS']
}
// -------------------------| JaCoCo code coverage |-------------------------
task codeCoverageReport(type: JacocoReport) {
// Gather execution data from all subprojects
// (change this if you e.g. want to calculate unit test/integration test coverage separately)
executionData fileTree(project.rootDir.absolutePath).include("**/build/jacoco/*.exec")
// Add all relevant sourcesets from the subprojects
subprojects.each {
sourceSets it.sourceSets.main
}
reports {
xml.enabled true
html.enabled true
html.destination "${buildDir}/reports/jacoco"
csv.enabled false
}
}
// always run the tests before generating the report
codeCoverageReport.dependsOn {
subprojects*.test
}