-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
61 lines (53 loc) · 1.79 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
plugins {
kotlin("jvm")
id("org.graalvm.buildtools.native")
}
repositories {
mavenCentral()
}
tasks.wrapper {
gradleVersion = "8.11.1"
distributionSha256Sum = "89d4e70e4e84e2d2dfbb63e4daa53e21b25017cc70c37e4eea31ee51fb15098a"
distributionType = Wrapper.DistributionType.ALL
}
dependencies {
implementation(Kotlin.stdlib)
}
graalvmNative {
toolchainDetection = true
binaries {
named("main") {
imageName = "hello"
mainClass = "MainKt"
buildArgs.apply {
// disable native toolchain checking (macOS only?)
addAll("-H:+UnlockExperimentalVMOptions", "-H:-CheckToolchain")
// prepare for the next GraalVM release
add("--strict-image-heap")
// require types to be fully defined at image build-time
add("--link-at-build-time")
// enable more CPU features for improved performance
add("-march=native")
// all optimisations for best performance
add("-O3")
// build stand-alone image or report failure
add("--no-fallback")
// heap settings at build time
add("-R:MinHeapSize=128k")
add("-R:MaxHeapSize=1m")
add("-R:MaxNewSize=512k")
// no need for garbage collection
add("--gc=epsilon")
// no need for safepoints
add("-H:-GenLoopSafepoints")
}
quickBuild = false
richOutput = false
verbose = false
javaLauncher = javaToolchains.launcherFor {
languageVersion = JavaLanguageVersion.of(21)
vendor = JvmVendorSpec.GRAAL_VM
}
}
}
}