forked from petertrr/kotlin-multiplatform-diff
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
67 lines (59 loc) · 1.59 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
import io.github.petertrr.configurePublishing
import io.github.petertrr.configureVersioning
import io.gitlab.arturbosch.detekt.Detekt
import org.jetbrains.kotlin.gradle.targets.jvm.tasks.KotlinJvmTest
plugins {
kotlin("multiplatform")
id("jacoco-convention")
alias(libs.plugins.detekt)
}
configureVersioning()
group = "io.github.petertrr"
description = "A multiplatform Kotlin library for calculating text differences"
kotlin {
explicitApi()
jvm()
js(BOTH) {
browser()
nodejs()
}
// setup native compilation
linuxX64()
mingwX64()
macosX64()
sourceSets {
val commonTest by getting {
dependencies {
implementation(kotlin("test-common"))
implementation(kotlin("test-annotations-common"))
}
}
// platform-specific dependencies are needed to use actual test runners
val jvmTest by getting {
dependencies {
implementation(kotlin("test-junit5"))
implementation(libs.junit.jupiter.engine)
}
}
val jsTest by getting {
dependencies {
implementation(kotlin("test-js"))
}
}
}
}
configurePublishing()
tasks.withType<KotlinJvmTest> {
useJUnitPlatform()
}
detekt {
buildUponDefaultConfig = true
config = files("detekt.yml")
autoCorrect = (findProperty("detektAutoCorrect") as String?)?.toBoolean() ?: true
}
dependencies {
detektPlugins(libs.detekt.formatting)
}
tasks.withType<Detekt> {
tasks.getByName("check").dependsOn(this)
}