-
Notifications
You must be signed in to change notification settings - Fork 15
/
build.gradle.kts
86 lines (77 loc) · 2.04 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
import org.beryx.jlink.util.JdkUtil
plugins {
application
com.teamscale.`java-convention`
com.teamscale.coverage
id("org.beryx.jlink") version ("3.0.1")
}
tasks.jar {
manifest {
attributes(
//"Automatic-Module-Name" to "com.teamscale.profiler.installer",
"Main-Class" to "com.teamscale.profiler.installer.RootCommand",
)
}
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}
application {
applicationName = "installer"
mainClass = "com.teamscale.profiler.installer.RootCommand"
mainModule = "com.teamscale.profiler.installer"
applicationDefaultJvmArgs = listOf(
// Ensure that no stack traces are lost.
// See <https://stackoverflow.com/questions/2411487/nullpointerexception-in-java-with-no-stacktrace>
"-XX:-OmitStackTraceInFastThrow",
)
}
val ADOPTIUM_BINARY_REPOSITORY = "https://api.adoptium.net/v3/binary"
val RUNTIME_JDK_VERSION = "17.0.5+8"
jlink {
options = listOf(
"--compress", "2",
"--no-header-files",
"--no-man-pages",
"--dedup-legal-notices", "error-if-not-same-content"
)
launcher {
name = "installer"
}
targetPlatform("linux-x86_64") {
setJdkHome(
jdkDownload(
"$ADOPTIUM_BINARY_REPOSITORY/version/jdk-${RUNTIME_JDK_VERSION}/linux/x64/jdk/hotspot/normal/eclipse",
closureOf<JdkUtil.JdkDownloadOptions> {
archiveExtension = "tar.gz"
})
)
}
targetPlatform("windows-x86_64") {
setJdkHome(
jdkDownload(
"$ADOPTIUM_BINARY_REPOSITORY/version/jdk-${RUNTIME_JDK_VERSION}/windows/x64/jdk/hotspot/normal/eclipse",
closureOf<JdkUtil.JdkDownloadOptions> {
archiveExtension = "zip"
})
)
}
}
dependencies {
implementation(libs.okhttp.core)
implementation(libs.commonsLang)
implementation(libs.commonsIo)
implementation(libs.picocli.core)
annotationProcessor(libs.picocli.codegen)
implementation("net.java.dev.jna:jna-platform:5.14.0")
testImplementation(libs.spark)
}
tasks.processResources {
filesMatching("**/app.properties") {
filter {
it.replace("%APP_VERSION_TOKEN_REPLACED_DURING_BUILD%", rootProject.ext["appVersion"].toString())
}
}
}