-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
125 lines (110 loc) · 3.59 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
plugins {
id 'java'
id 'application'
id 'org.openjfx.javafxplugin' version '0.0.10'
id 'org.beryx.jlink' version '2.24.1'
}
group 'net.lucraft'
version '1.0.0'
repositories {
mavenCentral()
}
project.description = """
Lucraft PDF-Converter Description
"""
ext {
junitVersion = '5.8.0'
}
sourceCompatibility = '16'
targetCompatibility = '16'
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
application {
mainModule = 'lucraft.converter'
mainClass = 'net.lucraft.converter.Main'
}
javafx {
version = '16'
modules = [
'javafx.controls',
'javafx.fxml',
'javafx.web',
'javafx.swing'
]
}
dependencies {
implementation('org.controlsfx:controlsfx:11.1.0')
implementation('com.dlsc.formsfx:formsfx-core:11.4.2') {
exclude(group: 'org.openjfx')
}
implementation('net.synedra:validatorfx:0.1.13') {
exclude(group: 'org.openjfx')
}
implementation('org.kordamp.ikonli:ikonli-javafx:12.2.0')
implementation('org.kordamp.bootstrapfx:bootstrapfx-core:0.4.0')
implementation('eu.hansolo:tilesfx:16.0.3') {
exclude(group: 'org.openjfx')
}
implementation('com.itextpdf:itext7-core:7.1.16')
implementation('commons-io:commons-io:2.6')
implementation('org.jetbrains:annotations:22.0.0')
implementation('com.google.code.gson:gson:2.8.8')
testImplementation("org.junit.jupiter:junit-jupiter-api:${junitVersion}")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${junitVersion}")
}
test {
useJUnitPlatform()
}
jlink {
addExtraDependencies("javafx")
options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages']
launcher {
name = 'PDF Converter'
}
jpackage {
installerOptions = [
'--description', project.description,
'--copyright', 'Copyrigth 2021 Luca Lewin',
'--vendor', 'Luca Lewin'
]
if (project.hasProperty('installerType')) {
installerType = project.findProperty('installerType') // we will pass this from the command line (example: -PinstallerType=msi)
if (installerType == 'msi') {
imageOptions += ['--icon', 'src/main/resources/net/lucraft/converter/icons/favicon.ico']
installerOptions += [
'--install-dir', 'lucraft/pdf-converter/',
'--win-per-user-install', '--win-dir-chooser',
'--win-menu', '--win-shortcut'
]
}
if (installerType == 'pkg') {
imageOptions += ['--icon', 'src/main/resources/pdfdecorator/gui/icon.icns']
}
if (['deb', 'rpm'].contains(installerType)) {
imageOptions += ['--icon', 'src/main/resources/net/lucraft/converter/icons/icon.png']
installerOptions += [
'--linux-menu-group', 'Office',
'--linux-shortcut'
]
}
// if (installerType == 'deb') {
// installerOptions += [
// '--linux-deb-maintainer', 'maintainer@example.com'
// ]
// }
// if (installerType == 'rpm') {
// installerOptions += [
// '--linux-rpm-license-type', 'GPLv3'
// ]
// }
} else {
println("property 'installerType' has to be specified!")
}
}
}
jpackage {
doFirst {
project.getProperty('installerType') // throws exception if its missing
}
}