-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle.kts
93 lines (82 loc) · 3.2 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
plugins {
val kotlinVersion = "2.0.20"
kotlin("jvm") version kotlinVersion
kotlin("plugin.serialization") version kotlinVersion
application
id("org.beryx.runtime") version "1.13.1"
}
repositories {
mavenCentral()
maven("https://kotlin.bintray.com/ktor")
}
application {
mainClass.set("io.github.legion2.open_cue_cli.MainKt")
executableDir = ""
applicationName = "open-cue-cli"
}
runtime {
addOptions("--strip-debug", "--compress", "2", "--no-header-files", "--no-man-pages")
addModules(
"java.base",
"java.sql",//because of gson
"jdk.unsupported"//https://stackoverflow.com/questions/61727613/unexpected-behaviour-from-gson
)
imageZip.set(file("$buildDir/${project.application.applicationName}.zip"))
targetPlatform("linux-x64") {
setJdkHome(jdkDownload("https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.3%2B7/OpenJDK17U-jdk_x64_linux_hotspot_17.0.3_7.tar.gz"))
}
targetPlatform("linux-aarch64") {
setJdkHome(jdkDownload("https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.3%2B7/OpenJDK17U-jdk_aarch64_linux_hotspot_17.0.3_7.tar.gz"))
}
targetPlatform("linux-arm32") {
setJdkHome(jdkDownload("https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.3%2B7/OpenJDK17U-jdk_arm_linux_hotspot_17.0.3_7.tar.gz"))
}
targetPlatform("windows-x64") {
setJdkHome(jdkDownload("https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.3%2B7/OpenJDK17U-jdk_x64_windows_hotspot_17.0.3_7.zip"))
}
targetPlatform("mac-x64") {
setJdkHome(jdkDownload("https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.3%2B7/OpenJDK17U-jdk_x64_mac_hotspot_17.0.3_7.tar.gz"))
}
targetPlatform("mac-aarch64") {
setJdkHome(jdkDownload("https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.3%2B7/OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.3_7.tar.gz"))
}
}
val ktorVersion = "2.3.11"
val cliktVersion = "3.5.4"
dependencies {
implementation("com.github.ajalt.clikt:clikt:$cliktVersion")
implementation("io.ktor:ktor-client-core:$ktorVersion")
implementation("io.ktor:ktor-client-cio:$ktorVersion")
implementation("io.ktor:ktor-client-content-negotiation:$ktorVersion")
implementation("io.ktor:ktor-serialization-kotlinx-json:$ktorVersion")
}
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions {
jvmTarget = "17"
languageVersion = "1.7"
apiVersion = "1.7"
}
}
val generateCliCompletions by tasks.registering(JavaExec::class) {
dependsOn("classes")
classpath = sourceSets.main.get().runtimeClasspath
main = application.mainClass.get()
environment("OPEN_CUE_CLI_COMPLETE", "bash")
val completions = file("$buildDir/completions")
outputs.dir(completions)
doFirst {
completions.mkdirs()
standardOutput = File(completions, "bash-complete-open-cue-cli.sh").outputStream()
}
}
distributions {
main {
contents {
from(generateCliCompletions)
}
}
}
tasks.withType<Wrapper> {
gradleVersion = "7.3"
distributionType = Wrapper.DistributionType.ALL
}