-
-
Notifications
You must be signed in to change notification settings - Fork 31
/
build.gradle.kts
87 lines (76 loc) · 2.24 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
import org.gradle.jvm.tasks.Jar
plugins {
kotlin("jvm") version "2.0.21"
java
id("org.beryx.runtime") version "1.13.1"
}
group = "eu.tricht.gamesense"
version = "1.15.0"
repositories {
mavenCentral()
}
dependencies {
implementation(kotlin("stdlib-jdk8"))
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.18.+")
implementation("com.squareup.retrofit2:retrofit:2.11.0")
implementation("com.squareup.retrofit2:converter-jackson:2.11.0")
implementation("net.java.dev.jna:jna:5.15.0")
implementation("net.java.dev.jna:jna-platform:5.15.0")
implementation("com.hynnet:jacob:1.18")
}
tasks {
compileKotlin {
kotlinOptions.jvmTarget = JavaVersion.VERSION_21.majorVersion
}
}
java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
val fatJar = task("fatJar", type = Jar::class) {
archiveBaseName.set("${project.name}-fat")
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
manifest {
attributes["Implementation-Title"] = "Gamesense Essentials"
attributes["Implementation-Version"] = archiveVersion
attributes["Main-Class"] = "eu.tricht.gamesense.MainKt"
}
from(configurations.runtimeClasspath.get().map { if (it.isDirectory) it else zipTree(it) })
with(tasks.jar.get() as CopySpec)
}
tasks {
"build" {
dependsOn(fatJar)
}
}
application {
mainClass.set("eu.tricht.gamesense.MainKt")
}
// TODO: Use github actions...
runtime {
options.set(listOf("--strip-debug", "--compress", "2", "--no-header-files", "--no-man-pages"))
modules.set(listOf("java.desktop", "java.logging", "java.datatransfer", "jdk.localedata"))
jpackage {
imageOptions.addAll(listOf("--icon", "src/main/resources/icon.ico"))
installerOptions.addAll(
listOf(
"--win-per-user-install",
"--win-dir-chooser",
"--win-menu",
"--win-shortcut"
)
)
}
launcher {
jvmArgs = listOf("-Djava.locale.providers=HOST")
}
}
tasks.jre {
doLast {
copy {
from("src/main/resources")
include("jacob-1.18-x64.dll")
into("build/jre/bin/")
}
}
}