-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
94 lines (76 loc) · 2.19 KB
/
build.gradle.kts
File metadata and controls
94 lines (76 loc) · 2.19 KB
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
plugins {
kotlin("jvm") version "2.0.20"
id("co.uzzu.dotenv.gradle") version "4.0.0"
id("com.google.cloud.tools.jib") version "3.3.1"
id("idea")
}
group = "it.rattly"
version = "1.0-SNAPSHOT"
repositories {
mavenCentral()
maven("https://jitpack.io/")
}
dependencies {
implementation(kotlin("reflect"))
listOf("polyglot", "js").forEach {
implementation("org.graalvm.polyglot:$it:24.1.1")
}
listOf("javet", "javet-node-linux-x86_64").forEach {
implementation("com.caoccao.javet:$it:4.1.1")
}
listOf("server", "jackson", "openapi").forEach {
implementation("com.github.codeborne.klite:klite-$it:master-SNAPSHOT")
}
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(21))
}
}
tasks.jib.get().dependsOn("runViteBuild")
tasks.register<Exec>("runViteBuild") {
workingDir = layout.projectDirectory.dir("src/main/javascript").asFile
commandLine = listOf("bun", "run", "--bun", "build")
}
jib {
from {
image = "ghcr.io/graalvm/jdk-community:23"
platforms {
platform { os = "linux"; architecture = "arm64" }
}
extraDirectories {
paths {
path {
setFrom("src/main/javascript/dist")
into = "/web"
}
path {
setFrom("src/main/javascript/dist-server")
into = "/web"
}
path {
setFrom("src/main/resources/packages/node_modules/")
into = "/web/node_modules"
}
path {
setFrom("src/main/resources/static")
into = "/web/client"
}
}
}
}
to {
image = "ghcr.io/${env.REGISTRY_USERNAME.value.lowercase()}/${project.name}:latest"
auth {
username = env.REGISTRY_USERNAME.value
password = env.REGISTRY_PASSWORD.value
}
}
container {
mainClass = "it.rattly.MainKt"
jvmFlags = listOf("-Xss2m", "-XX:MaxRAMPercentage=80", "-XX:+ExitOnOutOfMemoryError")
}
}
kotlin {
jvmToolchain(17)
}