-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
120 lines (99 loc) · 3.5 KB
/
build.gradle.kts
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
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
plugins {
kotlin("jvm") version libs.versions.kotlin
id("org.jetbrains.kotlin.plugin.serialization") version libs.versions.kotlin
id("org.sonarqube") version libs.versions.sonarqube
id("org.barfuin.gradle.jacocolog") version libs.versions.jacocolog
jacoco
`java-test-fixtures`
}
repositories {
mavenCentral()
}
sonarqube {
properties {
properties(
mapOf<String, Any>(
"sonar.projectKey" to "reisi007_reisishot.pictures",
"sonar.organization" to "reisi007",
"sonar.host.url" to "https://sonarcloud.io",
"sonar.exclusions" to "**/backend/html/src/main/java/**/*",
"sonar.coverage.jacoco.xmlReportPaths" to "$buildDir/reports/jacoco/jacocoAggregatedReport/jacocoAggregatedReport.xml",
)
)
}
}
subprojects {
group = "at.reisishot.mise"
version = "1.0-SNAPSHOT"
apply(plugin = "org.jetbrains.kotlin.jvm")
apply(plugin = "org.jetbrains.kotlin.plugin.serialization")
apply(plugin = "jacoco")
apply(plugin = "java-test-fixtures")
jacoco {
toolVersion = "0.8.7"
}
kotlin.target.compilations.getByName("testFixtures") {
associateWith(target.compilations.getByName("main"))
}
tasks.jacocoTestReport {
dependsOn(tasks.test)
reports {
xml.required.set(true)
html.required.set(false)
}
}
tasks.test {
useJUnitPlatform {
includeEngines("junit-jupiter")
}
testLogging {
exceptionFormat = TestExceptionFormat.FULL
showExceptions = true
showCauses = true
showStackTraces = true
}
finalizedBy(tasks.jacocoTestReport)
}
val compileKotlin by tasks.compileKotlin
val compileTestKotlin by tasks.compileTestKotlin
val compileJava by tasks.compileJava
val javaVersion: JavaVersion by extra(JavaVersion.valueOf(extra.get("java.version") as String))
val jvmTarget: String by extra(javaVersion.toString())
for (cur in listOf(compileKotlin, compileTestKotlin)) {
cur.apply {
kotlinOptions.jvmTarget = jvmTarget
}
}
java.sourceCompatibility = javaVersion
java.targetCompatibility = javaVersion
repositories {
mavenCentral()
}
val libs = rootProject.libs
dependencies {
implementation(libs.kotlin.stdlib)
implementation(libs.kotlinx.coroutines)
implementation(libs.kotlinx.serialization.json)
testImplementation(libs.assertk)
testImplementation(libs.assertj)
testImplementation(libs.junit.api)
testImplementation(libs.junit.params)
testRuntimeOnly(libs.junit.engine)
/*
* Add commons' testFixtures to the test implementation of all projects -
* and add test dependencies to testFixture of this project as test dependency of all other projects
*
* NOTE: `:commons` should be the ONLY testFixture, which has test dependencies!
* Therefore, this overcomplicated solution
*/
val testFixturesImpl = ":commons"
if (getName(this@subprojects) != testFixturesImpl) {
testImplementation(testFixtures(project(testFixturesImpl)))
} else {
testFixturesImplementation(libs.assertk)
testFixturesImplementation(libs.assertj)
}
}
}
fun getName(project: Project): String = project.path