-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
103 lines (90 loc) · 2.76 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
val javaVersion: String = JavaVersion.VERSION_16.toString()
val appMainClass: String = "gargoyle.netsquares.NetSquares"
val appModule: String = "NetSquares"
val appName: String = "NetSquares"
val os: org.gradle.internal.os.OperatingSystem = org.gradle.internal.os.OperatingSystem.current()
val appInstallerType: String = "msi"
val appIconIco: String = "src/main/resources/gargoyle/netsquares/res/ns.ico"
val appIconPng: String = "src/main/resources/gargoyle/netsquares/res/ns.gif"
val appCopyright: String = "Lure of Chaos"
val appVendor: String = "Lure of Chaos"
group = "gargoyle.netsquares"
version = "1.0"
description = "NetSquares"
plugins {
java
application
kotlin("jvm") version ("1.6.21")
id("org.javamodularity.moduleplugin") version ("1.8.12")
id("org.beryx.jlink") version ("2.25.0")
}
repositories {
mavenCentral()
}
dependencies {
constraints {
implementation(kotlin("stdlib-jdk7"))
implementation(kotlin("stdlib-jdk8"))
}
implementation(platform(kotlin("bom")))
implementation(kotlin("reflect"))
}
tasks.compileJava {
modularity.inferModulePath.set(true)
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
options.encoding = Charsets.UTF_8.toString()
}
tasks.compileKotlin {
destinationDirectory.set(tasks.compileJava.get().destinationDirectory)
targetCompatibility = javaVersion
kotlinOptions {
jvmTarget = javaVersion
}
}
tasks.jar {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
tasks.build {
dependsOn += tasks.jpackage
}
application {
mainClass.set(appMainClass)
mainModule.set(appModule)
}
jlink {
options.set(listOf("--strip-debug", "--compress", "2", "--no-header-files", "--no-man-pages"))
launcher {
name = appName
mainClass.set(appMainClass)
}
jpackage {
installerType = appInstallerType
installerName = appName
appVersion = project.version.toString()
if (os.isWindows) {
icon = rootProject.file(appIconIco).path
installerOptions = listOf(
"--description", rootProject.description,
"--copyright", appCopyright,
"--vendor", appVendor,
"--win-dir-chooser",
"--win-menu",
"--win-per-user-install",
"--win-shortcut"
)
}
if (os.isLinux) {
icon = rootProject.file(appIconPng).path
installerOptions = listOf(
"--description", rootProject.description,
"--copyright", appCopyright,
"--vendor", appVendor,
"--linux-shortcut"
)
}
if (os.isMacOsX) {
icon = rootProject.file(appIconPng).path
}
}
}