-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
111 lines (95 loc) · 3.39 KB
/
build.gradle
File metadata and controls
111 lines (95 loc) · 3.39 KB
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
104
105
106
107
108
109
110
111
plugins {
// Apply the java plugin for better toolchain support.
id 'java'
// Apply the application plugin to add support for building a CLI application in Java.
id 'application'
// Apply javafxplugin for JavaFX support.
id 'org.openjfx.javafxplugin' version '0.0.13'
// Apply jlink for building the app.
id 'org.beryx.jlink' version '2.25.0'
}
ext {
os = org.gradle.internal.os.OperatingSystem.current()
// Set the version of the app.
appVersion = '1.0'
// Set the version of JavaFX to use.
javafxVersion = 19
// Compile target for jlink.
// Options: linux-aarch64, linux-x64, macos-aarch64, macos-x64, win-x64, all.
jlinkTargetPlatform = 'win-x64'
// Compile target for jpackage.
// Options: linux-aarch64, linux-x64, macos-aarch64, macos-x64, win-x64.
jpackageTargetPlatform = 'win-x64'
// Links for downloading jdks.
jdkLinks = [
'linux-aarch64': 'https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.6%2B10/OpenJDK17U-jdk_aarch64_linux_hotspot_17.0.6_10.tar.gz',
'linux-x64' : 'https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.6%2B10/OpenJDK17U-jdk_x64_linux_hotspot_17.0.6_10.tar.gz',
'macos-aarch64': 'https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.6%2B10/OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.6_10.tar.gz',
'macos-x64' : 'https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.6%2B10/OpenJDK17U-jdk_x64_mac_hotspot_17.0.6_10.tar.gz',
'win-x64' : 'https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.6%2B10/OpenJDK17U-jdk_x64_windows_hotspot_17.0.6_10.zip'
]
}
version = appVersion
repositories {
// Use Maven Central for resolving dependencies.
mavenCentral()
}
dependencies {
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}
application {
// Define the main class for the application.
mainClass = 'com.megabyte6.wordle.App'
mainModule = 'wordle'
}
javafx {
version = javafxVersion
modules = ['javafx.controls', 'javafx.fxml']
}
jlink {
options = [
'--strip-debug',
'--compress', '2',
'--no-header-files',
'--no-man-pages'
]
launcher {
noConsole = true
}
imageZip = file("$buildDir/wordle.zip")
if (jlinkTargetPlatform == 'all') {
// Run all cases.
jdkLinks.each { key, value ->
targetPlatform(key) {
jdkHome = jdkDownload(value)
addExtraModulePath('jmods/' + key.split('-').join('/'))
}
}
} else {
targetPlatform(jlinkTargetPlatform) {
jdkHome = jdkDownload(jdkLinks[jlinkTargetPlatform])
addExtraModulePath('jmods/' + jlinkTargetPlatform.split('-').join('/'))
}
}
jpackage {
targetPlatformName = jpackageTargetPlatform
imageName = 'Wordle'
installerName = 'wordle-installer'
icon = 'src/main/resources/icon.ico'
vendor = 'Brayden Chan'
if (os.windows) {
installerOptions = [
'--win-dir-chooser',
'--win-menu',
'--win-menu-group', 'Wordle',
'--win-per-user-install',
'--win-shortcut',
'--win-shortcut-prompt'
]
}
}
}