-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle.kts
70 lines (64 loc) · 1.71 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
import com.saveourtool.osv4k.buildutils.configurePublishing
import com.saveourtool.osv4k.buildutils.createDetektTask
plugins {
id("com.saveourtool.osv4k.buildutils.kotlin-library")
}
group = "com.saveourtool.osv4k"
repositories {
mavenCentral()
}
kotlin {
jvm {
withJava()
compilations.all {
kotlinOptions.jvmTarget = "1.8"
}
}
val nativeTargets = setOf(
linuxX64(),
mingwX64(),
macosX64(),
)
sourceSets {
val commonMain by getting {
dependencies {
api(libs.kotlinx.serialization.json)
api(libs.kotlinx.datetime)
}
}
val commonTest by getting {
dependencies {
implementation(kotlin("test"))
implementation(libs.jetbrains.annotations)
}
}
val commonNonJvmMain by creating {
dependsOn(commonMain)
}
nativeTargets.forEach { nativeTarget ->
getByName("${nativeTarget.name}Main").dependsOn(commonNonJvmMain)
}
@Suppress("UNUSED_VARIABLE")
val jvmMain by getting {
dependencies {
api(libs.jackson.annotations)
api(libs.jackson.databind)
}
}
@Suppress("UNUSED_VARIABLE")
val jvmTest by getting {
dependsOn(commonTest)
dependencies {
implementation(kotlin("test-junit5"))
}
}
}
}
createDetektTask()
configurePublishing()
setOf("compileJava", "compileTestJava").forEach { taskName ->
tasks.named<JavaCompile>(taskName) {
sourceCompatibility = "1.8"
targetCompatibility = "1.8"
}
}