-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
58 lines (51 loc) · 1.45 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
plugins {
id 'application'
id 'org.openjfx.javafxplugin' version '0.0.8'
id 'org.beryx.jlink' version '2.17.6'
}
repositories {
mavenCentral()
}
javafx {
modules = ['javafx.controls']
}
mainClassName = "hellofx/org.example.HelloFX"
jlink {
options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages']
jpackage {
if (org.gradle.internal.os.OperatingSystem.current().windows) {
installerOptions += ['--win-per-user-install', '--win-dir-chooser', '--win-menu']
}
}
}
tasks.jpackageImage.doLast {
if (org.gradle.internal.os.OperatingSystem.current().windows) {
def appName = jpackageData.imageName
def dir = "$jpackageData.imageOutputDir/$appName"
file("$dir/lib").mkdirs()
ant.move(todir: "$dir/lib") {
fileset(dir: dir) {
include name: "*.dll"
}
}
file("$dir/${appName}.exe").renameTo "$dir/__app.exe"
copy {
from dir
into dir
include "${appName}.ico"
rename ("${appName}.ico", "__app.ico")
}
copy {
from "$dir/app"
into "$dir/app"
include "${appName}.cfg"
rename ("${appName}.cfg", "__app.cfg")
}
copy {
from "src/main/resources"
into dir
include "launcher.exe"
rename ("launcher.exe", "${appName}.exe")
}
}
}