-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle.kts
64 lines (55 loc) · 1.43 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
plugins {
kotlin("multiplatform") version "1.9.20"
id("com.github.johnrengelman.shadow") version "8.1.1"
java
}
group = "ru.cororo"
version = "1.0"
repositories {
mavenCentral()
}
kotlin {
val targets = listOf(
// FIXME: Not works
// linuxX64("linux"),
mingwX64("mingw")
)
jvm("jvm") {
compilations.getByName("main") {
dependencies {
implementation(kotlin("stdlib"))
}
}
}
targets.forEach {
it.apply {
compilations.getByName("main") {
cinterops {
val libcurl by creating {
packageName("curl")
}
}
}
binaries {
executable {
runTask.let { task ->
task?.args("https://example.org/")
}
entryPoint = "main"
}
}
}
}
}
val shadowJar = tasks.withType<com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar> {
manifest {
attributes["Main-Class"] = "MainKt"
}
val target = kotlin.targets.find { it.targetName == "jvm" }!!
from(target.compilations["main"].output)
val runtimeClasspath = target.compilations["main"].compileDependencyFiles
configurations = mutableListOf(runtimeClasspath)
}
tasks.getByName("jvmJar") {
dependsOn(shadowJar)
}