-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
108 lines (94 loc) · 2.65 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
plugins {
id 'java-library'
id 'maven-publish'
id 'org.jetbrains.kotlin.jvm' version '1.3.72'
id 'idea'
id 'jacoco'
}
group 'io.github.marcusadriano.brawlstars'
version '0.2'
repositories {
mavenCentral()
jcenter()
}
test {
// listen to events in the test execution lifecycle
beforeTest { descriptor ->
logger.lifecycle("Running test: " + descriptor)
}
onOutput { descriptor, event ->
logger.lifecycle("Test: " + descriptor + " produced standard out/err: " + event.message )
}
useJUnitPlatform()
}
def jacocoExcludes = [
'io/github/marcusadriano/brawlstars/model/**'
]
def jacocoRulesExcludes = [
'io.github.marcusadriano.brawlstars.model.**'
]
jacocoTestCoverageVerification {
violationRules {
rule {
element = 'METHOD'
excludes = jacocoRulesExcludes
limit {
counter = 'BRANCH'
minimum = 0.9
}
}
}
}
jacocoTestReport {
reports {
xml.enabled true
csv.enabled false
html.enabled true
}
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
fileTree(dir: it, exclude: jacocoExcludes)
}))
}
}
check {
dependsOn jacocoTestCoverageVerification
dependsOn jacocoTestReport
}
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
kotlinOptions {
freeCompilerArgs = ["-Xinline-classes", "-Xjvm-default=compatibility"]
}
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
dependencies {
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.7'
testImplementation 'com.squareup.retrofit2:retrofit-mock:2.9.0'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.4.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.4.0'
testImplementation group: 'org.mockito', name: 'mockito-all', version: '1.10.19'
}
publishing {
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/MarcusAdriano/BrawlStars-SDK")
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("PUBLISH_USERNAME")
password = project.findProperty("gpr.key") ?: System.getenv("PUBLISH_TOKEN")
}
}
}
publications {
gpr(MavenPublication) {
from(components.java)
}
}
}