-
Notifications
You must be signed in to change notification settings - Fork 9
/
build.gradle
175 lines (146 loc) · 5.35 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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
plugins {
id "java"
id "application"
id "jacoco"
id "com.github.kt3k.coveralls" version "2.6.3"
id "org.openjfx.javafxplugin" version "0.0.8"
id 'org.beryx.jlink' version '2.26.0'
}
apply plugin : "java"
repositories {
mavenLocal()
mavenCentral()
}
targetCompatibility = "11"
sourceCompatibility = "11"
compileJava.options.encoding = 'UTF-8'
wrapper {
gradleVersion = '7.3.3'
}
applicationDefaultJvmArgs = ["-Dfile.encoding=UTF-8"]
application {
mainClassName = "com.zds.zw.Launcher"
mainModule = "zestwriter"
}
// Configures plugin
javafx {
version = '17'
modules = ['javafx.controls', 'javafx.fxml', 'javafx.web']
}
// set jpackage installerType based on OS
def os = org.gradle.internal.os.OperatingSystem.current()
def jPkgInstallerType = 'rpm'
def linuxOs = project.hasProperty('linuxTarget') ? project.property('linuxTarget') : 'deb'
if (os.isLinux()) {
jPkgInstallerType = linuxOs
} else if (os.isMacOsX()) {
jPkgInstallerType = 'dmg'
} else if (os.isWindows()) {
jPkgInstallerType = 'msi'
}
jlink {
options = []
imageZip = project.file("${buildDir}/distributions/zest-writer-${javafx.platform.classifier}.zip")
launcher {
name = 'zestwriter'
moduleName = 'zestwriter'
jvmArgs = applicationDefaultJvmArgs
}
forceMerge 'javafx', 'log4j-api', 'jackson'
mergedModule {
excludeUses 'com.sun.webkit.plugin.PluginHandler'
}
jpackage {
outputDir = "installer"
imageName = 'zestwriter'
skipInstaller = false
installerName = 'zestwriter'
installerType = "${jPkgInstallerType}"
appVersion = "${version}"
installerOptions = [
'--description', "This is a Markdown Editor for Zeste de Savoir contents",
'--copyright', 'Copyright (c) 2016 - 2020 Zest Writer',
'--vendor', 'firm1'
]
if (installerType == 'msi') {
imageOptions += ['--icon', 'src/main/resources/com/zds/zw/logo/logo.ico']
installerOptions += [
'--win-per-user-install',
'--win-dir-chooser',
'--win-menu',
'--win-shortcut',
'--win-menu-group', 'Office'
]
}
if (installerType in ['deb', 'rpm']) {
imageOptions += ['--icon', 'src/main/resources/com/zds/zw/logo/logo-256.png']
installerOptions += [
'--linux-menu-group', 'Office',
'--linux-shortcut'
]
}
if (installerType == 'deb') {
installerOptions += [
'--linux-deb-maintainer', '[email protected]'
]
}
if (installerType == 'rpm') {
installerOptions += [
'--linux-rpm-license-type', 'GPLv3'
]
}
}
}
task dist {
dependsOn clean, jlinkZip
description "Calls clean and then jlinkZip [default]"
}
defaultTasks 'dist'
dependencies {
testImplementation 'junit:junit:4.13-rc-2'
implementation (group: 'de.julielab', name: 'aliasi-lingpipe', version: '4.1.2-JL1.0') {
exclude group: 'org.slf4j', module: 'slf4j-api'
}
implementation group: 'org.jsoup', name: 'jsoup', version: '1.13.1'
// jackson
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.11.1'
// logging
implementation group: 'org.apache.logging.log4j', name: 'log4j-api', version: "${log4jVersion}"
implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: "${log4jVersion}"
implementation group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl', version: "${log4jVersion}"
// icons
implementation group: 'de.jensd', name: 'fontawesomefx-commons', version: "${faVersion}"
implementation group: 'de.jensd', name: 'fontawesomefx-commons', version: "${faVersion}"
implementation group: 'de.jensd', name: 'fontawesomefx-materialdesignfont', version: "2.0.26-${faVersion}"
// utils
implementation group: 'org.zeroturnaround', name: 'zt-zip', version: '1.14'
implementation group: 'org.fxmisc.wellbehaved', name: 'wellbehavedfx', version: '0.3.3'
implementation group: 'org.controlsfx', name: 'controlsfx', version: '11.0.2'
implementation group: 'commons-io', name: 'commons-io', version: '2.7'
implementation group: 'org.apache.commons', name: 'commons-text', version: '1.8'
// graal vm
implementation group: 'org.graalvm.sdk', name: 'graal-sdk', version: "${graalVersion}"
implementation group: 'org.graalvm.js', name: 'js', version: "${graalVersion}"
implementation group: 'org.graalvm.js', name: 'js-scriptengine', version: "${graalVersion}"
implementation group: 'org.graalvm.tools', name: 'chromeinspector', version: "${graalVersion}"
}
test {
filter {
includeTestsMatching "*Test*"
}
systemProperty "zw.username", System.getProperty("zw.username")
systemProperty "zw.password", System.getProperty("zw.password")
systemProperty "zw.github_user", System.getProperty("zw.github_user")
systemProperty "zw.github_token", System.getProperty("zw.github_token")
}
jacocoTestReport {
reports {
xml.enabled = true
html.enabled = true
}
}
tasks.check.dependsOn jacocoTestReport
task doc (type:Exec) {
workingDir './doc'
commandLine 'make', 'html', 'serve'
}