forked from Xfel/ksubprocess
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
117 lines (103 loc) · 3.03 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
@Suppress("DSL_SCOPE_VIOLATION")
plugins {
alias(libs.plugins.multiplatform)
alias(libs.plugins.dokka)
alias(libs.plugins.binaryCompat)
alias(libs.plugins.spotless)
alias(libs.plugins.completeKotlin)
alias(libs.plugins.mavenPublish)
}
repositories {
mavenCentral()
}
version = System.getenv("GITHUB_REF")?.substringAfter("refs/tags/v", version.toString()) ?: version
kotlin {
jvm()
macosX64()
macosArm64()
mingwX64("windows")
configure(listOf(linuxX64(), linuxArm64())) {
compilations.named("main") {
cinterops {
create("runprocess") {
defFile(project.file("src/linuxMain/cinterop/runprocess.def"))
}
}
}
}
applyDefaultHierarchyTemplate()
compilerOptions {
freeCompilerArgs.add("-Xexpect-actual-classes")
}
sourceSets {
all {
explicitApi()
languageSettings.apply {
optIn("kotlinx.coroutines.ExperimentalCoroutinesApi")
optIn("kotlin.time.ExperimentalTime")
optIn("kotlinx.cinterop.ExperimentalForeignApi")
optIn("kotlinx.cinterop.BetaInteropApi")
}
}
commonMain {
dependencies {
api(libs.okio.core)
api(libs.coroutines.core)
}
}
commonTest {
dependencies {
implementation(libs.coroutines.test)
implementation(kotlin("test-common"))
implementation(kotlin("test-annotations-common"))
}
}
val posixMain by creating {
dependsOn(commonMain.get())
}
linuxMain {
dependsOn(posixMain)
}
macosMain {
dependsOn(posixMain)
}
jvmTest {
dependencies {
implementation(kotlin("test"))
implementation(kotlin("test-junit"))
}
}
}
}
spotless {
kotlin {
target("**/**.kt")
ktlint(libs.versions.ktlint.get())
//.setUseExperimental(true)
/*.editorConfigOverride(mapOf(
"disabled_rules" to "no-wildcard-imports,trailing-comma,filename"
))*/
}
}
tasks.withType<Test> {
dependsOn(":testprograms:shadowJar")
environment("TEST", "TESTVAL")
environment("PT_JAVA_EXE", org.gradle.internal.jvm.Jvm.current().javaExecutable.absolutePath)
doFirst {
environment(
"PT_JAR",
project(":testprograms").tasks.named<Jar>("shadowJar").get().archiveFile.get()
)
}
}
tasks.withType<org.jetbrains.kotlin.gradle.targets.native.tasks.KotlinNativeTest> {
dependsOn(":testprograms:shadowJar")
environment("TEST", "TESTVAL")
environment("PT_JAVA_EXE", org.gradle.internal.jvm.Jvm.current().javaExecutable.absolutePath)
doFirst {
environment(
"PT_JAR",
project(":testprograms").tasks.named<Jar>("shadowJar").get().archiveFile.get()
)
}
}