-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
60 lines (49 loc) · 1.73 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
import org.graalvm.buildtools.gradle.dsl.GraalVMExtension
import java.lang.System.getProperty
import org.gradle.api.tasks.wrapper.Wrapper.DistributionType.ALL
plugins {
kotlin("jvm") version("2.0.20")
id("org.graalvm.buildtools.native") version("0.10.2")
}
val hexagonVersion = "3.6.5"
val gradleScripts = "https://raw.githubusercontent.com/hexagontk/hexagon/$hexagonVersion/gradle"
ext.set("modules", "java.logging,java.management")
ext.set("options", "-Xmx48m")
ext.set("applicationClass", "org.example.ApplicationKt")
apply(from = "$gradleScripts/kotlin.gradle")
apply(from = "$gradleScripts/application.gradle")
apply(from = "$gradleScripts/native.gradle")
defaultTasks("build")
version="1.0.0"
group="org.example"
description="Service's description"
dependencies {
"implementation"("com.hexagonkt:http_server_helidon:$hexagonVersion")
"testImplementation"("com.hexagonkt:http_client_jetty:$hexagonVersion")
"testImplementation"("org.slf4j:slf4j-nop:2.0.16")
}
tasks.wrapper {
gradleVersion = "8.10"
distributionType = ALL
}
extensions.configure<GraalVMExtension> {
fun option(name: String, value: (String) -> String): String? =
getProperty(name)?.let(value)
binaries {
named("main") {
listOfNotNull(
option("static") { "--static" },
option("enableMonitoring") { "--enable-monitoring" },
option("pgoInstrument") { "--pgo-instrument" },
option("pgo") { "--pgo=../../../default.iprof" },
)
.forEach(buildArgs::add)
}
named("test") {
listOfNotNull(
option("pgoInstrument") { "--pgo-instrument" },
)
.forEach(buildArgs::add)
}
}
}