-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
48 lines (39 loc) · 1.12 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
plugins {
kotlin("jvm") version "1.9.21"
}
group = "com.utopia-rise"
version = "1.0.0-SNAPSHOT"
repositories {
mavenCentral()
}
kotlin {
jvmToolchain(17)
}
tasks.register<Exec>("generateCapCache") {
dependsOn(tasks.build)
group = "graal-ios"
val graalVmNativeImage = File(System.getenv("GRAALVM_HOME"))
.resolve("bin")
.resolve("native-image")
.absolutePath
val libsDir = project.layout.buildDirectory.asFile.get().resolve("libs")
val iosLibDir = libsDir.resolve("ios")
iosLibDir.mkdirs()
val dummyJarFile = tasks.jar.get().outputs.files.files.first().absolutePath
val arguments = arrayOf(
graalVmNativeImage,
"-cp",
dummyJarFile,
"-H:+SharedLibrary",
"-H:Name=usercode",
"-H:PageSize=16384",
"-Dsvm.targetName=iOS",
"-Dsvm.targetArch=arm64",
"-H:+NewCAPCache",
"-H:+ExitAfterCAPCache",
"-H:CAPCacheDir=${iosLibDir.absolutePath}",
"-Dsvm.platform=org.graalvm.nativeimage.Platform\$IOS_AARCH64",
)
println(arguments.joinToString(" "))
commandLine(*arguments)
}