forked from brunoborges/fx2048
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
91 lines (74 loc) · 2.09 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
plugins {
id 'java'
id 'application'
id 'org.openjfx.javafxplugin' version '0.0.10'
id 'org.beryx.jlink' version '2.24.0'
}
application {
mainModule = 'fx2048'
mainClass = 'io.fxgame.game2048.AppLauncher'
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of('17')
}
}
javafx {
version = '16'
modules = [
'javafx.base',
'javafx.graphics',
'javafx.controls'
]
}
// set jpackage installerType based on OS
def os = org.gradle.internal.os.OperatingSystem.current()
def pkgType = os.windows ? 'msi' : os.linux ? 'deb' : 'pkg'
jlink {
options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages']
imageZip = project.file("${buildDir}/distributions/game2048-${javafx.platform.classifier}.zip")
launcher {
name = 'fx2048'
noConsole = true
}
jpackage {
imageName = 'fx2048'
imageOptions = []
if (os.macOsX) {
imageOptions += ['--mac-package-identifier','fx2048']
}
installerName = 'fx2048'
installerType = "${pkgType}"
installerOptions = ['--resource-dir', "src/main/resources"]
installerOptions += [
'--vendor', 'Bruno Borges',
'--app-version', '1.0'
]
if (os.windows) {
installerOptions += ['--win-per-user-install', '--win-dir-chooser', '--win-menu']
}
if (os.macOsX) {
installerOptions += ["--mac-package-name", "fx2048"]
// Code Signing
// installerOptions += ['--mac-sign', '--mac-signing-keychain', '/Users/bruno/certificates.p12', '--mac-signing-key-user-name', 'Bruno Borges']
}
skipInstaller = false
}
}
/*
task deletePostInstall {
print("deltePostInstall")
// delete 'uglyFolder', 'uglyFile'
}
tasks.named("jpackageImage") {
finalizedBy deletePostInstall
}
*/
tasks.named("jpackageImage") {
dependsOn jlinkZip
}
task dist {
dependsOn clean, jpackage
description "Calls clean and then jpackage [default]"
}
defaultTasks 'dist'