-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.gradle.kts
110 lines (86 loc) · 2.35 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
import org.gradle.api.JavaVersion.VERSION_21
import org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_21
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile
plugins {
kotlin("jvm")
id("org.graalvm.buildtools.native")
}
buildscript {
repositories {
mavenCentral()
gradlePluginPortal()
}
}
kotlin {
jvmToolchain {
languageVersion.set(JavaLanguageVersion.of(21))
}
}
repositories {
mavenCentral()
mavenLocal()
}
val http4kVersion: String by project
val VERSION: String? by project
version = (VERSION ?: "LOCAL")
val mainMcpDesktopClass = "org.http4k.mcp.Http4kMcpDesktop"
graalvmNative {
toolchainDetection.set(true)
binaries {
named("main") {
imageName.set("http4k-mcp-desktop")
mainClass.set(mainMcpDesktopClass)
useFatJar.set(true)
sharedLibrary.set(false)
buildArgs.add("-O1")
buildArgs.add("--no-fallback")
buildArgs.add("-march=compatibility")
}
}
}
tasks {
register("generateVersionProperties" ) {
doLast {
file("src/main/resources/version.properties").apply {
parentFile.mkdirs()
writeText("version=${project.version}")
}
}
}
named("processResources") {
dependsOn("generateVersionProperties")
}
withType<KotlinJvmCompile>().configureEach {
compilerOptions {
allWarningsAsErrors = false
jvmTarget.set(JVM_21)
freeCompilerArgs.add("-Xjvm-default=all")
}
}
withType<Test> {
useJUnitPlatform()
}
java {
sourceCompatibility = VERSION_21
targetCompatibility = VERSION_21
}
}
dependencies {
implementation(platform("org.http4k:http4k-bom:$http4kVersion"))
api("dev.forkhandles:bunting4k:_")
runtimeOnly("org.slf4j:slf4j-nop:_")
api("org.http4k:http4k-security-oauth")
api("org.http4k:http4k-client-websocket")
api("org.http4k:http4k-realtime-core")
testApi(platform(Testing.junit.bom))
testApi(Testing.junit.jupiter.api)
testApi(Testing.junit.jupiter.engine)
testApi("org.http4k:http4k-testing-hamkrest")
testApi("org.http4k.pro:http4k-mcp-sdk")
testApi("org.http4k:http4k-server-helidon")
}
sourceSets {
test {
kotlin.srcDir("src/examples/kotlin")
}
}