forked from ZephyrJung/keenwrite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
213 lines (174 loc) · 7.02 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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
plugins {
id 'application'
id 'org.openjfx.javafxplugin' version '0.0.10'
id 'com.palantir.git-version' version '0.12.3'
}
repositories {
mavenCentral()
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots/'
}
maven {
url "https://nexus.bedatadriven.com/content/groups/public"
}
}
// Assume a cross-platform überjar unless targetOs is set.
String[] os = ["win", "mac", "linux"]
if (project.hasProperty('targetOs')) {
if ("windows" == targetOs) {
os = ["win"]
} else {
os = [targetOs]
}
}
def moduleSecurity = [
"--add-opens=javafx.controls/javafx.scene.control=ALL-UNNAMED",
"--add-opens=javafx.controls/javafx.scene.control.skin=ALL-UNNAMED",
"--add-opens=javafx.graphics/javafx.scene.text=ALL-UNNAMED",
"--add-opens=javafx.graphics/com.sun.javafx.css=ALL-UNNAMED",
"--add-opens=javafx.graphics/com.sun.javafx.text=ALL-UNNAMED",
"--add-exports=javafx.base/com.sun.javafx.event=ALL-UNNAMED",
"--add-exports=javafx.graphics/com.sun.javafx.application=ALL-UNNAMED",
"--add-exports=javafx.graphics/com.sun.javafx.geom=ALL-UNNAMED",
"--add-exports=javafx.graphics/com.sun.javafx.text=ALL-UNNAMED",
"--add-exports=javafx.graphics/com.sun.javafx.scene=ALL-UNNAMED",
"--add-exports=javafx.graphics/com.sun.javafx.scene.text=ALL-UNNAMED",
"--add-exports=javafx.graphics/com.sun.javafx.scene.traversal=ALL-UNNAMED",
]
javafx {
version = "17"
modules = ['javafx.controls', 'javafx.swing']
configuration = 'compileOnly'
}
dependencies {
def v_junit = '5.8.2'
def v_flexmark = '0.62.2'
def v_jackson = '2.13.1'
def v_batik = '1.14'
def v_wheatsheaf = '2.0.1'
// JavaFX
// TODO: Reinstate when JDK 17-compatible release is published
//implementation 'org.controlsfx:controlsfx:11.1.0'
implementation 'org.fxmisc.richtext:richtextfx:0.10.7'
implementation 'org.fxmisc.flowless:flowless:0.6.7'
implementation 'org.fxmisc.wellbehaved:wellbehavedfx:0.3.3'
implementation 'com.miglayout:miglayout-javafx:11.0'
implementation 'com.dlsc.preferencesfx:preferencesfx-core:11.8.0'
// Pure JavaFX File Chooser
// TODO: Reinstate when file picker performance increases
// implementation "com.io7m.jwheatsheaf:com.io7m.jwheatsheaf:${v_wheatsheaf}"
// implementation "com.io7m.jwheatsheaf:com.io7m.jwheatsheaf.api:${v_wheatsheaf}"
// implementation "com.io7m.jwheatsheaf:com.io7m.jwheatsheaf.ui:${v_wheatsheaf}"
// Markdown
implementation "com.vladsch.flexmark:flexmark:${v_flexmark}"
implementation "com.vladsch.flexmark:flexmark-ext-definition:${v_flexmark}"
implementation "com.vladsch.flexmark:flexmark-ext-gfm-strikethrough:${v_flexmark}"
implementation "com.vladsch.flexmark:flexmark-ext-superscript:${v_flexmark}"
implementation "com.vladsch.flexmark:flexmark-ext-tables:${v_flexmark}"
implementation "com.vladsch.flexmark:flexmark-ext-typographic:${v_flexmark}"
// YAML
implementation "com.fasterxml.jackson.core:jackson-core:${v_jackson}"
implementation "com.fasterxml.jackson.core:jackson-databind:${v_jackson}"
implementation "com.fasterxml.jackson.core:jackson-annotations:${v_jackson}"
implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:${v_jackson}"
implementation 'org.yaml:snakeyaml:1.29'
// XML
implementation 'com.ximpleware:vtd-xml:2.13.4'
// HTML parsing and rendering
implementation 'org.jsoup:jsoup:1.14.3'
// TODO: Wait for https://github.com/flyingsaucerproject/flyingsaucer/pull/170
//implementation 'org.xhtmlrenderer:flying-saucer-core:9.1.22'
// R
implementation 'org.renjin:renjin-script-engine:3.5-beta76'
// SVG
implementation "org.apache.xmlgraphics:batik-anim:${v_batik}"
implementation "org.apache.xmlgraphics:batik-awt-util:${v_batik}"
implementation "org.apache.xmlgraphics:batik-bridge:${v_batik}"
implementation "org.apache.xmlgraphics:batik-css:${v_batik}"
implementation "org.apache.xmlgraphics:batik-dom:${v_batik}"
implementation "org.apache.xmlgraphics:batik-ext:${v_batik}"
implementation "org.apache.xmlgraphics:batik-gvt:${v_batik}"
implementation "org.apache.xmlgraphics:batik-parser:${v_batik}"
implementation "org.apache.xmlgraphics:batik-script:${v_batik}"
implementation "org.apache.xmlgraphics:batik-svg-dom:${v_batik}"
implementation "org.apache.xmlgraphics:batik-svggen:${v_batik}"
implementation "org.apache.xmlgraphics:batik-transcoder:${v_batik}"
implementation "org.apache.xmlgraphics:batik-rasterizer:${v_batik}"
implementation "org.apache.xmlgraphics:batik-util:${v_batik}"
implementation "org.apache.xmlgraphics:batik-xml:${v_batik}"
// Misc.
implementation 'org.ahocorasick:ahocorasick:0.6.3'
implementation 'org.apache.commons:commons-configuration2:2.7'
implementation 'com.googlecode.juniversalchardet:juniversalchardet:1.0.3'
implementation 'javax.validation:validation-api:2.0.1.Final'
implementation 'org.greenrobot:eventbus-java:3.3.1'
implementation 'org.apache.commons:commons-configuration2:2.7'
//noinspection GradlePackageUpdate
implementation 'commons-beanutils:commons-beanutils:1.9.4'
// Command-line parsing
implementation 'info.picocli:picocli:4.6.2'
// Spelling, TeX, Docking, KeenQuotes
implementation fileTree(include: ['**/*.jar'], dir: 'libs')
def fx = ['controls', 'graphics', 'fxml', 'swing']
fx.each { fxitem ->
os.each { ositem ->
runtimeOnly "org.openjfx:javafx-${fxitem}:${javafx.version}:${ositem}"
}
}
testImplementation "org.testfx:testfx-junit5:4.0.16-alpha"
testImplementation "org.junit.jupiter:junit-jupiter-api:${v_junit}"
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
}
compileJava {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
def resourceDir = sourceSets.main.resources.srcDirs[0]
final Properties config = new Properties()
final File configFile = file("${resourceDir}/bootstrap.properties")
final FileInputStream configStream = new FileInputStream(configFile)
config.load(configStream)
configStream.close()
final String applicationName = config.get("application.title").toString().toLowerCase()
final String applicationClass = "com.${applicationName}.Launcher"
application {
mainClass.set(applicationClass)
applicationDefaultJvmArgs = moduleSecurity
}
version = gitVersion()
final File propertiesFile = new File("${resourceDir}/com/${applicationName}/app.properties")
propertiesFile.write("application.version=${version}")
jar {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
doFirst {
manifest {
attributes 'Main-Class': applicationClass
}
}
from {
(configurations.runtimeClasspath.findAll { !it.path.endsWith(".pom") }).collect {
it.isDirectory() ? it : zipTree(it)
}
}
archiveFileName = "${applicationName}.jar"
exclude 'META-INF/*.RSA', 'META-INF/*.SF', 'META-INF/*.DSA'
}
distributions {
main {
distributionBaseName = applicationName
contents {
from { ['LICENSE.md', 'README.md'] }
into('images') {
from { 'images' }
}
}
}
}
test {
useJUnitPlatform()
doFirst {
jvmArgs = moduleSecurity
}
testLogging {
exceptionFormat = 'full'
}
}