forked from ZephyrJung/keenwrite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
253 lines (211 loc) · 7.61 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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
//file:noinspection SpellCheckingInspection
buildscript {
repositories {
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'org.owasp:dependency-check-gradle:8.2.1'
classpath "com.github.spotbugs.snom:spotbugs-gradle-plugin:5.0.14"
}
}
plugins {
id 'application'
id 'org.openjfx.javafxplugin' version '0.0.14'
id 'com.palantir.git-version' version '3.0.0'
id "com.github.spotbugs" version "5.0.14"
}
spotbugs {
excludeFilter.set(
file("${projectDir}/bug-filter.xml")
)
}
apply plugin: 'org.owasp.dependencycheck'
repositories {
mavenCentral()
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
maven { url 'https://nexus.bedatadriven.com/content/groups/public' }
maven {
url "https://css4j.github.io/maven"
mavenContent {
releasesOnly()
}
content {
includeGroup 'com.github.css4j'
includeGroup 'io.sf.carte'
includeGroup 'io.sf.jclf'
}
}
}
// 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.graphics/javafx.scene=ALL-UNNAMED',
'--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',
]
java {
sourceCompatibility = 20
targetCompatibility = 20
}
javafx {
version = '20'
modules = ['javafx.base', 'javafx.controls', 'javafx.graphics', 'javafx.swing']
configuration = 'compileOnly'
}
dependencies {
def v_junit = '5.9.3'
def v_flexmark = '0.64.6'
def v_jackson = '2.15.1'
def v_echosvg = '0.3'
def v_picocli = '4.7.3'
// JavaFX
implementation 'org.controlsfx:controlsfx:11.1.2'
implementation 'org.fxmisc.richtext:richtextfx:0.11.0'
implementation 'org.fxmisc.flowless:flowless:0.7.0'
implementation 'org.fxmisc.wellbehaved:wellbehavedfx:0.3.3'
implementation 'com.miglayout:miglayout-javafx:11.0'
implementation 'com.dlsc.preferencesfx:preferencesfx-core:11.16.0'
implementation 'com.panemu:tiwulfx-dock:0.2'
// 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 'org.yaml:snakeyaml:2.0'
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}"
// HTML parsing and rendering
implementation 'org.jsoup:jsoup:1.16.1'
// TODO: https://github.com/flyingsaucerproject/flyingsaucer/pull/170
//implementation 'org.xhtmlrenderer:flying-saucer-core:9.1.22'
// R
implementation 'org.apache.commons:commons-compress:1.23.0'
implementation 'org.codehaus.plexus:plexus-utils:3.5.1'
implementation 'org.renjin:renjin-script-engine:3.5-beta76'
implementation 'org.renjin.cran:rjson:0.2.15-renjin-21'
// SVG
implementation "io.sf.carte:echosvg-awt-util:${v_echosvg}"
implementation "io.sf.carte:echosvg-bridge:${v_echosvg}"
implementation "io.sf.carte:echosvg-css:${v_echosvg}"
implementation "io.sf.carte:echosvg-dom:${v_echosvg}"
implementation "io.sf.carte:echosvg-ext:${v_echosvg}"
implementation "io.sf.carte:echosvg-gvt:${v_echosvg}"
implementation "io.sf.carte:echosvg-parser:${v_echosvg}"
implementation "io.sf.carte:echosvg-script:${v_echosvg}"
implementation "io.sf.carte:echosvg-svg-dom:${v_echosvg}"
implementation "io.sf.carte:echosvg-svggen:${v_echosvg}"
implementation "io.sf.carte:echosvg-transcoder:${v_echosvg}"
implementation "io.sf.carte:echosvg-util:${v_echosvg}"
implementation "io.sf.carte:echosvg-xml:${v_echosvg}"
// Misc.
implementation 'org.ahocorasick:ahocorasick:0.6.3'
implementation 'org.apache.commons:commons-configuration2:2.9.0'
implementation 'com.github.albfernandez:juniversalchardet:2.4.0'
implementation 'javax.validation:validation-api:2.0.1.Final'
implementation 'org.greenrobot:eventbus-java:3.3.1'
// Command-line parsing
implementation "info.picocli:picocli:${v_picocli}"
annotationProcessor "info.picocli:picocli-codegen:${v_picocli}"
// KeenQuotes, KeenType, KeenSpell, word split.
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}"
testImplementation "org.junit.jupiter:junit-jupiter-params:${v_junit}"
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
}
sourceSets {
main {
java {
srcDirs 'src/main'
}
}
test {
java {
srcDirs 'src/test'
}
}
}
final 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 applicationPackage = "com.${applicationName}"
final String applicationClass = "${applicationPackage}.Launcher"
compileJava {
options.compilerArgs += [
"-Xlint:unchecked",
"-Xlint:deprecation",
"-Aproject=${applicationPackage}/${applicationName}"
]
}
application {
mainClass.set( applicationClass )
applicationDefaultJvmArgs = moduleSecurity
}
version = gitVersion()
final File p = new File( "${resourceDir}/com/${applicationName}/app.properties" )
p.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.set( applicationName )
contents {
from { ['LICENSE.md', 'README.md'] }
into( 'images' ) {
from { 'images' }
}
}
}
}
test {
useJUnitPlatform()
doFirst { jvmArgs = moduleSecurity }
testLogging { exceptionFormat = 'full' }
}