-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
70 lines (58 loc) · 1.57 KB
/
build.gradle
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
repositories {
mavenCentral()
google()
}
apply plugin: "java-library"
apply plugin: "eclipse"
apply plugin: "idea"
dependencies {
implementation files('libs/flatlaf-3.5.2.jar')
}
compileJava {
options.release = 21
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}
project.ext.appName = "PokeMMO"
project.ext.mainClassName = "com.pokeemu.unix.UnixInstaller"
project.ext.mainJar = "unix-installer.jar"
// creates a slim JDK runtime for distribution
task createRuntime(type: Exec) {
doFirst() {
project.delete("${buildDir}/runtime")
}
String runtimePath = "${buildDir}/runtime"
String jlinkPath = "$System.env.JRE_TARGET" + "/bin/jlink"
workingDir project.projectDir
commandLine = [
jlinkPath,
'--add-modules', 'java.se,java.base,java.desktop,jdk.unsupported,jdk.crypto.ec',
'--strip-debug',
'--no-header-files',
'--no-man-pages',
"--vm=server",
"--compress=2",
'--output', runtimePath
]
}
jar {
archiveFileName = project.mainJar
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
manifest {
attributes(
'Main-Class': project.mainClassName
)
}
from {
configurations.runtimeClasspath.findAll { it.name.endsWith('jar') }.collect { zipTree(it) }
}
}
task dist(type: GradleBuild) {
buildName "dist"
startParameter.projectProperties = gradle.startParameter.projectProperties
tasks = ['clean', 'createRuntime', 'jar']
}
assemble.dependsOn dist