-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
/
build.gradle
734 lines (621 loc) · 26.7 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
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
import org.gradle.internal.os.OperatingSystem
import org.jabref.build.xjc.XjcPlugin
import org.jabref.build.xjc.XjcTask
plugins {
id 'application'
id 'com.github.andygoossens.modernizer' version '1.8.0'
id 'me.champeau.jmh' version '0.7.1'
id 'org.javamodularity.moduleplugin' version '1.8.12'
id 'org.openjfx.javafxplugin' version '0.0.14'
id 'org.beryx.jlink' version '2.26.0'
// nicer test outputs during running and completion
// Homepage: https://github.com/radarsh/gradle-test-logger-plugin
id 'com.adarshr.test-logger' version '3.2.0'
id 'jacoco'
id 'checkstyle'
id 'project-report'
id 'idea'
id 'org.openrewrite.rewrite' version '6.3.2'
}
// Enable following for debugging
// gradle.startParameter.showStacktrace = org.gradle.api.logging.configuration.ShowStacktrace.
apply plugin: XjcPlugin
apply from: 'eclipse.gradle'
group = "org.jabref"
version = project.findProperty('projVersion') ?: '100.0.0'
java {
sourceCompatibility = JavaVersion.VERSION_19
targetCompatibility = JavaVersion.VERSION_19
// Workaround needed for Eclipse, probably because of https://github.com/gradle/gradle/issues/16922
// Should be removed as soon as Gradle 7.0.1 is released ( https://github.com/gradle/gradle/issues/16922#issuecomment-828217060 )
modularity.inferModulePath.set(false)
toolchain {
languageVersion = JavaLanguageVersion.of(20)
}
}
application {
mainClass.set('org.jabref.cli.Launcher')
mainModule.set('org.jabref')
}
// Workaround for https://github.com/openjfx/javafx-gradle-plugin/issues/89
// See also https://github.com/java9-modularity/gradle-modules-plugin/issues/165
modularity.disableEffectiveArgumentsAdjustment()
sourceSets {
main {
java {
// src-gen reasoning: https://stackoverflow.com/a/64612308/873282
srcDirs = ["src/main/java", "src-gen/main/java"]
}
resources {
srcDirs = ["src/main/java", "src/main/resources"]
}
}
test {
java {
srcDirs = ["src/test/java"]
}
resources {
srcDirs = ["src/test/resources"]
}
}
}
repositories {
mavenLocal()
mavenCentral()
maven { url 'https://oss.sonatype.org/content/groups/public' }
maven { url 'https://s01.oss.sonatype.org/content/repositories/snapshots/' }
maven { url 'https://jitpack.io' }
maven { url 'https://sandec.jfrog.io/artifactory/repo' }
}
configurations {
antlr4
// TODO: Remove the following workaround for split error messages such as
// error: module java.xml.bind reads package javax.annotation from both jsr305 and java.annotation
compile {
extendsFrom implementation
exclude group: "javax.activation"
}
}
dependencyLocking {
lockAllConfigurations()
}
javafx {
version = "20"
modules = [ 'javafx.controls', 'javafx.fxml', 'javafx.web', 'javafx.swing' ]
}
jacoco {
toolVersion = "0.8.10"
}
dependencies {
// Include all jar-files in the 'lib' folder as dependencies
implementation fileTree(dir: 'lib', includes: ['*.jar'])
implementation 'org.apache.pdfbox:pdfbox:3.0.0'
implementation 'org.apache.pdfbox:fontbox:3.0.0'
implementation 'org.apache.pdfbox:xmpbox:3.0.0'
implementation 'org.apache.lucene:lucene-core:9.7.0'
implementation 'org.apache.lucene:lucene-queryparser:9.7.0'
implementation 'org.apache.lucene:lucene-queries:9.7.0'
implementation 'org.apache.lucene:lucene-analysis-common:9.7.0'
implementation 'org.apache.lucene:lucene-highlighter:9.7.0'
implementation group: 'org.apache.commons', name: 'commons-csv', version: '1.10.0'
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.13.0'
implementation 'com.h2database:h2-mvstore:2.2.222'
// required for reading write-protected PDFs - see https://github.com/JabRef/jabref/pull/942#issuecomment-209252635
implementation 'org.bouncycastle:bcprov-jdk18on:1.76'
implementation 'commons-cli:commons-cli:1.5.0'
implementation 'org.libreoffice:unoloader:7.6.0'
implementation 'org.libreoffice:libreoffice:7.6.0'
implementation 'io.github.java-diff-utils:java-diff-utils:4.12'
implementation 'info.debatty:java-string-similarity:2.0.0'
implementation 'com.github.javakeyring:java-keyring:1.0.4'
antlr4 'org.antlr:antlr4:4.13.0'
implementation 'org.antlr:antlr4-runtime:4.13.0'
implementation group: 'org.eclipse.jgit', name: 'org.eclipse.jgit', version: '6.6.0.202305301015-r'
implementation group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-yaml', version: '2.15.2'
implementation group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jsr310', version: '2.15.2'
implementation group: 'org.mariadb.jdbc', name: 'mariadb-java-client', version: '2.7.9'
implementation 'org.postgresql:postgresql:42.6.0'
implementation ('com.oracle.ojdbc:ojdbc10:19.3.0.0') {
// causing module issues
exclude module: 'oraclepki'
}
implementation ('com.google.guava:guava:32.1.2-jre') {
// TODO: Remove this as soon as https://github.com/google/guava/issues/2960 is fixed
exclude module: "jsr305"
}
implementation 'jakarta.annotation:jakarta.annotation-api:2.1.1'
implementation 'jakarta.inject:jakarta.inject-api:2.0.1'
implementation 'org.jabref:afterburner.fx:1.1.0-SNAPSHOT'
implementation 'org.kordamp.ikonli:ikonli-javafx:12.3.1'
implementation 'org.kordamp.ikonli:ikonli-materialdesign2-pack:12.3.1'
implementation 'com.github.sialcasa.mvvmFX:mvvmfx-validation:f195849ca9' //jitpack
implementation 'de.saxsys:mvvmfx:1.8.0'
implementation 'com.tobiasdiez:easybind:2.2.1-SNAPSHOT'
implementation 'org.fxmisc.flowless:flowless:0.7.1'
implementation 'org.fxmisc.richtext:richtextfx:0.11.1'
implementation (group: 'com.dlsc.gemsfx', name: 'gemsfx', version: '1.77.0') {
exclude module: 'javax.inject' // Split package, use only jakarta.inject
exclude group: 'org.apache.logging.log4j'
}
implementation 'org.controlsfx:controlsfx:11.1.2'
implementation 'org.jsoup:jsoup:1.16.1'
implementation 'com.konghq:unirest-java:3.14.5'
implementation 'org.slf4j:slf4j-api:2.0.7'
implementation "org.tinylog:tinylog-api:2.6.2"
implementation "org.tinylog:slf4j-tinylog:2.6.2"
implementation "org.tinylog:tinylog-impl:2.6.2"
// route all requests to java.util.logging to SLF4J (which in turn routes to tinylog)
implementation 'org.slf4j:jul-to-slf4j:2.0.7'
implementation 'de.undercouch:citeproc-java:3.0.0-beta.2'
// jakarta.activation is already dependency of glassfish
implementation group: 'jakarta.xml.bind', name: 'jakarta.xml.bind-api', version: '3.0.1'
implementation group: 'org.glassfish.jaxb', name: 'jaxb-runtime', version: '3.0.2'
implementation ('com.github.tomtung:latex2unicode_2.13:0.3.2') {
exclude module: 'fastparse_2.13'
}
implementation group: 'com.microsoft.azure', name: 'applicationinsights-core', version: '2.4.1'
implementation (group: 'com.microsoft.azure', name: 'applicationinsights-logging-log4j2', version: '2.4.1') {
exclude module: "log4j-core"
}
implementation 'com.vladsch.flexmark:flexmark:0.64.8'
implementation group: 'net.harawata', name: 'appdirs', version: '1.2.2'
implementation group: 'org.jooq', name: 'jool', version: '0.9.15'
// JAX-RS implemented by Jersey
// API
implementation 'jakarta.ws.rs:jakarta.ws.rs-api:3.1.0'
// Implementation of the API
implementation 'org.glassfish.jersey.core:jersey-server:3.1.1'
// injection framework
implementation 'org.glassfish.jersey.inject:jersey-hk2:3.1.3'
implementation 'org.glassfish.hk2:hk2-api:3.0.4'
// testImplementation 'org.glassfish.hk2:hk2-testing:3.0.4'
// implementation 'org.glassfish.hk2:hk2-testing-jersey:3.0.4'
// testImplementation 'org.glassfish.hk2:hk2-junitrunner:3.0.4'
// HTTP server
// implementation 'org.glassfish.jersey.containers:jersey-container-netty-http:3.1.1'
implementation 'org.glassfish.jersey.containers:jersey-container-grizzly2-http:3.1.3'
testImplementation 'org.glassfish.jersey.test-framework.providers:jersey-test-framework-provider-grizzly2:3.1.3'
// Allow objects "magically" to be mapped to JSON using GSON
// implementation 'org.glassfish.jersey.media:jersey-media-json-gson:3.1.1'
testImplementation 'io.github.classgraph:classgraph:4.8.162'
testImplementation 'org.junit.jupiter:junit-jupiter:5.10.0'
testImplementation 'org.junit.platform:junit-platform-launcher:1.10.0'
testImplementation 'org.mockito:mockito-core:5.4.0'
testImplementation 'org.xmlunit:xmlunit-core:2.9.1'
testImplementation 'org.xmlunit:xmlunit-matchers:2.9.1'
testRuntimeOnly 'com.tngtech.archunit:archunit-junit5-engine:1.1.0'
testImplementation 'com.tngtech.archunit:archunit-junit5-api:1.1.0'
testImplementation "org.testfx:testfx-core:4.0.16-alpha"
testImplementation "org.testfx:testfx-junit5:4.0.16-alpha"
testImplementation "org.hamcrest:hamcrest-library:2.2"
checkstyle 'com.puppycrawl.tools:checkstyle:10.12.3'
// xjc needs the runtime as well for the ant task, otherwise it fails
xjc group: 'org.glassfish.jaxb', name: 'jaxb-xjc', version: '3.0.2'
xjc group: 'org.glassfish.jaxb', name: 'jaxb-runtime', version: '3.0.2'
rewrite(platform("org.openrewrite.recipe:rewrite-recipe-bom:2.2.1"))
rewrite("org.openrewrite.recipe:rewrite-logging-frameworks")
rewrite("org.openrewrite.recipe:rewrite-static-analysis")
}
clean {
delete "src/main/generated"
delete "src-gen"
}
processResources {
gradle.taskGraph.whenReady {
if (gradle.taskGraph.hasTask(":jpackage")) {
logger.info('Adding buildres/csl to resources')
from("buildres/csl")
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
}
filteringCharset = 'UTF-8'
filesMatching("build.properties") {
expand(version: project.findProperty('projVersionInfo') ?: '100.0.0',
"year": String.valueOf(Calendar.getInstance().get(Calendar.YEAR)),
"maintainers": new File('MAINTAINERS').readLines().findAll { !it.startsWith("#") }.join(", "),
"azureInstrumentationKey": System.getenv('AzureInstrumentationKey') ? System.getenv('AzureInstrumentationKey') : '',
"springerNatureAPIKey": System.getenv('SpringerNatureAPIKey') ? System.getenv('SpringerNatureAPIKey') : '',
"astrophysicsDataSystemAPIKey": System.getenv('AstrophysicsDataSystemAPIKey') ? System.getenv('AstrophysicsDataSystemAPIKey') : '',
"ieeeAPIKey": System.getenv('IEEEAPIKey') ? System.getenv('IEEEAPIKey') : '',
"scienceDirectApiKey": System.getenv('SCIENCEDIRECTAPIKEY') ? System.getenv('SCIENCEDIRECTAPIKEY') : '',
"biodiversityHeritageApiKey": System.getenv('BiodiversityHeritageApiKey') ? System.getenv('BiodiversityHeritageApiKey') : ''
)
filteringCharset = 'UTF-8'
}
filesMatching(["resources/resource/ods/meta.xml", "resources/resource/openoffice/meta.xml"]) {
expand version: project.version
}
}
tasks.register('generateSource') {
dependsOn("generateBstGrammarSource",
"generateSearchGrammarSource",
"generateCitaviSource")
group = 'JabRef'
description 'Generates all necessary (Java) source files.'
}
tasks.register("generateBstGrammarSource", JavaExec) {
main = "org.antlr.v4.Tool"
classpath = configurations.antlr4
group = "JabRef"
description = 'Generates BstLexer.java and BstParser.java from the Bst.g grammar file using antlr4.'
inputs.dir('src/main/antlr4/org/jabref/bst/')
outputs.dir("src-gen/main/java/org/jabref/logic/bst/")
args = ["-o", "src-gen/main/java/org/jabref/logic/bst/", "-visitor", "-no-listener", "-package", "org.jabref.logic.bst", "$projectDir/src/main/antlr4/org/jabref/bst/Bst.g4"]
}
tasks.register("generateSearchGrammarSource", JavaExec) {
group = 'JabRef'
description = "Generates java files for Search.g antlr4."
classpath = configurations.antlr4
main = "org.antlr.v4.Tool"
inputs.dir("src/main/antlr4/org/jabref/search/")
outputs.dir("src-gen/main/java/org/jabref/search/")
args = ["-o","src-gen/main/java/org/jabref/search" , "-visitor", "-no-listener", "-package", "org.jabref.search", "$projectDir/src/main/antlr4/org/jabref/search/Search.g4"]
}
tasks.register("generateJournalAbbreviationList", JavaExec) {
group = "JabRef"
description = "Converts the comma-separated journal abbreviation file to a H2 MVStore"
classpath = sourceSets.main.runtimeClasspath
main = "org.jabref.cli.JournalListMvGenerator"
}
jar.dependsOn "generateJournalAbbreviationList"
test.dependsOn "generateJournalAbbreviationList"
tasks.register('generateCitaviSource', XjcTask) {
group = 'JabRef'
description = "Generates java files for the citavi importer."
schemaFile = "src/main/resources/xjc/citavi/citavi.xsd"
outputDirectory = "src-gen/main/java/"
javaPackage = "org.jabref.logic.importer.fileformat.citavi"
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
}
compileJava {
options.compilerArgs << "-Xlint:none"
dependsOn "generateSource"
options.generatedSourceOutputDirectory.set(file("src-gen/main/java"))
moduleOptions {
// TODO: Remove access to internal api
addExports = [
'javafx.controls/com.sun.javafx.scene.control' : 'org.jabref',
'org.controlsfx.controls/impl.org.controlsfx.skin' : 'org.jabref'
]
}
}
run {
// TODO: Remove access to internal api
moduleOptions {
addExports = [
'javafx.controls/com.sun.javafx.scene.control' : 'org.jabref',
'org.controlsfx.controls/impl.org.controlsfx.skin' : 'org.jabref',
// Not sure why we need to restate the controlfx exports
// Taken from here: https://github.com/controlsfx/controlsfx/blob/9.0.0/build.gradle#L1
'javafx.graphics/com.sun.javafx.scene' : 'org.controlsfx.controls',
'javafx.graphics/com.sun.javafx.scene.traversal' : 'org.controlsfx.controls',
'javafx.graphics/com.sun.javafx.css' : 'org.controlsfx.controls',
'javafx.controls/com.sun.javafx.scene.control' : 'org.controlsfx.controls',
'javafx.controls/com.sun.javafx.scene.control.behavior' : 'org.controlsfx.controls',
'javafx.controls/com.sun.javafx.scene.control.inputmap' : 'org.controlsfx.controls',
'javafx.base/com.sun.javafx.event' : 'org.controlsfx.controls',
'javafx.base/com.sun.javafx.collections' : 'org.controlsfx.controls',
'javafx.base/com.sun.javafx.runtime': 'org.controlsfx.controls',
'javafx.web/com.sun.webkit' : 'org.controlsfx.controls',
]
addOpens = [
'javafx.controls/javafx.scene.control' : 'org.jabref',
'org.controlsfx.controls/org.controlsfx.control.textfield' : 'org.jabref',
'javafx.controls/com.sun.javafx.scene.control' : 'org.jabref',
'javafx.controls/javafx.scene.control.skin' : 'org.controlsfx.controls',
'javafx.graphics/javafx.scene' : 'org.controlsfx.controls'
]
}
if (project.hasProperty('component')){
if (component == 'httpserver'){
main = 'org.jabref.http.server.Server'
}
}
}
javadoc {
options {
encoding = 'UTF-8'
version = false
author = false
addMultilineStringsOption("-add-exports").setValue([
'javafx.controls/com.sun.javafx.scene.control=org.jabref',
'org.controlsfx.controls/impl.org.controlsfx.skin=org.jabref'
])
}
}
test {
useJUnitPlatform {
excludeTags 'DatabaseTest', 'FetcherTest', 'GUITest'
}
moduleOptions {
// TODO: Remove this as soon as ArchUnit is modularized
runOnClasspath = true
}
testLogging {
// set options for log level LIFECYCLE
// for debugging tests: add "STANDARD_OUT", "STANDARD_ERROR"
events = ["FAILED"]
exceptionFormat "full"
}
}
testlogger {
theme 'standard-parallel'
showPassed false
showSkipped false
}
tasks.register('databaseTest', Test) {
useJUnitPlatform {
includeTags 'DatabaseTest'
}
testLogging {
// set options for log level LIFECYCLE
events = ["FAILED"]
exceptionFormat "full"
}
}
tasks.register('fetcherTest', Test) {
useJUnitPlatform {
includeTags 'FetcherTest'
}
testLogging {
// set options for log level LIFECYCLE
events = ["FAILED"]
exceptionFormat "full"
}
}
tasks.register('guiTest', Test) {
useJUnitPlatform {
includeTags 'GUITest'
}
testLogging {
// set options for log level LIFECYCLE
events = ["FAILED"]
exceptionFormat "full"
}
}
// Test result tasks
tasks.register('copyTestResources', Copy) {
from "${projectDir}/src/test/resources"
into "${buildDir}/classes/test"
}
processTestResources.dependsOn copyTestResources
tasks.withType(Test) {
reports.html.outputLocation.set(file("${reporting.baseDir}/${name}"))
}
tasks.register('jacocoPrepare') {
doFirst {
// Ignore failures of tests
tasks.withType(Test).tap {
configureEach {
ignoreFailures = true
}
}
}
}
test.mustRunAfter jacocoPrepare
databaseTest.mustRunAfter jacocoPrepare
fetcherTest.mustRunAfter jacocoPrepare
jacocoTestReport {
executionData files(
"$buildDir/jacoco/test.exec",
"$buildDir/jacoco/databaseTest.exec",
"$buildDir/jacoco/fetcherTest.exec").filter { it.exists() }
dependsOn jacocoPrepare, test, databaseTest, fetcherTest
reports {
csv.getRequired().set(true)
html.getRequired().set(true)
xml.getRequired().set(true) // coveralls plugin depends on xml format report
}
}
// Code quality tasks
checkstyle {
// will only run when called explicitly from the command line
sourceSets = []
}
rewrite {
activeRecipe(
'org.jabref.config.rewrite.cleanup'
)
exclusion (
"build.gradle",
"buildSrc/build.gradle",
"eclipse.gradle",
"settings.gradle",
"src-gen/**",
"src/main/resources/**",
"src/test/resources/**",
"**/module-info.java",
"**/*.py",
"**/*.xml",
"**/*.yml"
)
plainTextMask("**/*.md")
failOnDryRunResults = true
}
modernizer {
failOnViolations = false
includeTestClasses = true
exclusions = [
'java/util/Optional.get:()Ljava/lang/Object;'
]
}
// Release tasks
tasks.register('deleteInstallerTemp', Delete) {
delete "$buildDir/installer"
}
jpackage.dependsOn deleteInstallerTemp
jlink {
addOptions('--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages')
launcher {
name = 'JabRef'
}
addOptions("--bind-services")
// TODO: Remove the following as soon as the dependencies are fixed (upstream)
// forceMerge is usually needed when some non-modular artifacts in the dependency graph use code that was previously part of the JDK
// but it was removed in the newer releases.
// The pom.xml associated with such a non-modular artifact does not mention that the artifact depends on the removed code
// (because the artifact was published when this code was still available in the JDK).
forceMerge "javafx"
forceMerge "controlsfx", "bcprov", "jaxb", "istack", "stax", "log4j"
// TODO: Remove the following correction to the merged module
// The module descriptor automatically generated by the plugin for the merged module contained some invalid entries.
// Execute ./gradlew suggestMergedModuleInfo and include the suggested directives here.
mergedModule {
requires 'java.compiler'
requires 'java.datatransfer'
requires 'java.desktop'
requires 'java.logging'
requires 'java.management'
requires 'java.naming'
requires 'java.net.http'
requires 'java.scripting'
requires 'java.security.jgss'
requires 'java.security.sasl'
requires 'java.sql'
requires 'java.sql.rowset'
requires 'java.transaction.xa'
requires 'java.rmi'
requires 'java.xml'
requires 'jdk.jsobject'
requires 'jdk.unsupported'
requires 'jdk.unsupported.desktop'
requires 'jdk.security.jgss'
requires 'jdk.xml.dom'
requires 'com.google.gson'
requires 'org.slf4j'
requires 'jakarta.xml.bind'
uses 'org.mariadb.jdbc.credential.CredentialPlugin'
uses 'org.mariadb.jdbc.authentication.AuthenticationPlugin'
uses 'org.mariadb.jdbc.tls.TlsSocketPlugin'
uses 'org.mariadb.jdbc.LocalInfileInterceptor'
uses 'org.eclipse.jgit.transport.SshSessionFactory'
uses 'org.eclipse.jgit.lib.GpgSigner'
provides 'org.mariadb.jdbc.tls.TlsSocketPlugin' with 'org.mariadb.jdbc.internal.protocol.tls.DefaultTlsSocketPlugin'
provides 'java.sql.Driver' with 'org.postgresql.Driver'
provides 'org.mariadb.jdbc.authentication.AuthenticationPlugin' with 'org.mariadb.jdbc.internal.com.send.authentication.CachingSha2PasswordPlugin',
'org.mariadb.jdbc.internal.com.send.authentication.ClearPasswordPlugin',
'org.mariadb.jdbc.internal.com.send.authentication.Ed25519PasswordPlugin',
'org.mariadb.jdbc.internal.com.send.authentication.NativePasswordPlugin',
'org.mariadb.jdbc.internal.com.send.authentication.OldPasswordPlugin',
'org.mariadb.jdbc.internal.com.send.authentication.SendGssApiAuthPacket',
'org.mariadb.jdbc.internal.com.send.authentication.SendPamAuthPacket',
'org.mariadb.jdbc.internal.com.send.authentication.Sha256PasswordPlugin'
provides 'org.mariadb.jdbc.credential.CredentialPlugin' with 'org.mariadb.jdbc.credential.aws.AwsIamCredentialPlugin',
'org.mariadb.jdbc.credential.env.EnvCredentialPlugin',
'org.mariadb.jdbc.credential.system.PropertiesCredentialPlugin'
provides 'java.security.Provider' with 'org.bouncycastle.jce.provider.BouncyCastleProvider',
'org.bouncycastle.pqc.jcajce.provider.BouncyCastlePQCProvider'
}
jpackage {
outputDir = "distribution"
if (OperatingSystem.current().isWindows()) {
// This requires WiX to be installed: https://github.com/wixtoolset/wix3/releases
installerType = "msi"
imageOptions = [
'--icon', "${projectDir}/src/main/resources/icons/jabref.ico",
]
installerOptions = [
'--vendor', 'JabRef',
'--app-version', "${project.version}",
'--verbose',
'--win-upgrade-uuid', 'd636b4ee-6f10-451e-bf57-c89656780e36',
'--win-dir-chooser',
'--win-shortcut',
'--win-menu',
'--win-menu-group', "JabRef",
'--temp', "$buildDir/installer",
'--resource-dir', "${projectDir}/buildres/windows",
'--license-file', "${projectDir}/buildres/LICENSE_with_Privacy.md",
'--file-associations', "${projectDir}/buildres/windows/bibtexAssociations.properties"
]
}
if (OperatingSystem.current().isLinux()) {
imageOptions = [
'--icon', "${projectDir}/src/main/resources/icons/JabRef-icon-64.png",
'--app-version', "${project.version}",
]
installerOptions = [
'--verbose',
'--vendor', 'JabRef',
'--app-version', "${project.version}",
// '--temp', "$buildDir/installer",
'--resource-dir', "${projectDir}/buildres/linux",
'--linux-menu-group', 'Office;',
'--linux-rpm-license-type', 'MIT',
// '--license-file', "${projectDir}/LICENSE.md",
'--description', 'JabRef is an open source bibliography reference manager. The native file format used by JabRef is BibTeX, the standard LaTeX bibliography format.',
'--linux-shortcut',
'--file-associations', "${projectDir}/buildres/linux/bibtexAssociations.properties"
]
}
if (OperatingSystem.current().isMacOsX()) {
imageOptions = [
'--icon', "${projectDir}/src/main/resources/icons/jabref.icns",
'--resource-dir', "${projectDir}/buildres/mac"
]
// Notarized mac images and packages are built on the pipeline only
skipInstaller = true
installerOptions = [
'--verbose',
'--vendor', 'JabRef',
'--mac-package-identifier', "JabRef",
'--mac-package-name', "JabRef",
'--app-version', "${project.version}",
'--file-associations', "${projectDir}/buildres/mac/bibtexAssociations.properties",
'--resource-dir', "${projectDir}/buildres/mac"
]
}
}
}
if (OperatingSystem.current().isWindows()) {
tasks.jpackageImage.doLast {
copy {
from("${projectDir}/buildres/windows") {
include "jabref-firefox.json", "jabref-chrome.json", "JabRefHost.bat", "JabRefHost.ps1"
}
into "$buildDir/distribution/JabRef"
}
}
}
if (OperatingSystem.current().isLinux()) {
tasks.jpackageImage.doLast {
copy {
from("${projectDir}/buildres/linux") {
include "native-messaging-host/**", "jabrefHost.py"
}
into "$buildDir/distribution/JabRef/lib"
}
}
}
if (OperatingSystem.current().isMacOsX()) {
tasks.jpackageImage.doLast {
copy {
from("${projectDir}/buildres/mac") {
include "native-messaging-host/**", "jabrefHost.py"
}
into "$buildDir/distribution/JabRef.app/Contents/Resources"
}
}
}
jmh {
warmupIterations = 5
iterations = 10
fork = 2
}
// Source: https://stackoverflow.com/a/44168582/873282
task downloadDependencies {
description "Pre-downloads *most* dependencies"
doLast {
configurations.getAsMap().each { name, config ->
println "Retrieving dependencies for $name"
try {
config.files
} catch (e) {
// some cannot be resolved, just log them
project.logger.info e.message
}
}
}
}