-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
136 lines (108 loc) · 3.93 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
plugins {
id 'java'
id 'checkstyle'
id 'io.github.0ffz.github-packages' version '1.2.1'
}
println "Timestamp: ${java.time.Instant.now().atZone(java.time.ZoneId.systemDefault())}, Host: ${java.net.InetAddress.getLocalHost()}"
println "Versions: JVM=${org.gradle.internal.jvm.Jvm.current()}, Groovy=${GroovySystem.getVersion()}, Gradle=${gradle.gradleVersion}"
group = 'hbz.limetrans'
def passSystemProperties = {
def prefix = project.group + '.'
def pattern = ~/(?:\Q${prefix}\E|org\.metafacture\.).*/
it[prefix + 'versions.elasticsearch8'] = versions.elasticsearch8
System.properties.each { k, v ->
if (k.matches(pattern)) it[k] = v
}
}
// https://github.com/lmdbjava/lmdbjava/issues/42
def lmdbJvmArgs = [
'--add-opens=java.base/java.nio=ALL-UNNAMED',
'--add-opens=java.base/sun.nio.ch=ALL-UNNAMED',
// Required for ElasticsearchIndexerTest: ShardNotFoundException[no such shard]
'--add-opens=java.base/jdk.internal.ref=ALL-UNNAMED'
]
apply from: 'gradle/tasks.gradle'
repositories {
mavenCentral()
maven githubPackage.invoke('metafacture')
maven { url = 'https://oss.sonatype.org/content/repositories/snapshots' }
}
dependencies {
gitModules.each { key, args ->
args.modules.each {
implementation(it) {
version(args.version)
if (args.containsKey('dependency')) {
args.dependency(it)
}
}
}
}
implementation "co.elastic.clients:elasticsearch-java:${versions.elasticsearch8}"
implementation "com.fasterxml.jackson.core:jackson-databind:${versions.jackson}"
implementation "com.github.samtools:htsjdk:${versions.htsjdk}"
implementation "commons-cli:commons-cli:${versions['commons-cli']}"
implementation "commons-io:commons-io:${versions['commons-io']}"
implementation "junit:junit:${versions.junit}"
implementation "org.apache.logging.log4j:log4j-1.2-api:${versions.log4j}"
implementation "org.apache.logging.log4j:log4j-core:${versions.log4j}"
implementation "org.apache.logging.log4j:log4j-slf4j-impl:${versions.log4j}"
implementation "org.elasticsearch:elasticsearch:${versions.elasticsearch2}"
implementation "org.lmdbjava:lmdbjava:${versions.lmdb}"
implementation "org.testcontainers:elasticsearch:${versions.testcontainers}"
implementation files("libs/elasticsearch-plugin-bundle-${versions.elasticsearch2}.0.jar")
// Required for ElasticsearchClientTest (elasticsearch2 plugin bundle): com.ibm.icu.text.Normalizer2
testImplementation "org.apache.lucene:lucene-analyzers-icu:${versions.lucene5}"
}
sourceSets {
test {
resources {
exclude '**/output/'
}
}
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(versions.jdk)
}
}
checkstyle {
toolVersion = versions.checkstyle
checkstyleTest.enabled = false // TODO: Enable
}
def printVersions = {
versions.sort().each { key, value -> println "- ${key}=${value}" }
}
task versions(description: 'Prints dependency versions.') {
doFirst { printVersions() }
}
compileJava.doFirst { printVersions() }
tasks.withType(JavaCompile) {
'all -processing -rawtypes -serial'.split().each {
options.compilerArgs << "-Xlint:${it}"
}
options.compilerArgs << '-Werror'
}
tasks.withType(JavaExec) {
javaLauncher = javaToolchains.launcherFor {
languageVersion = java.toolchain.languageVersion
}
jvmArgs = lmdbJvmArgs
maxHeapSize = project.hasProperty('maxHeapSize') ?
project.getProperty('maxHeapSize') : '12G'
doFirst { passSystemProperties(systemProperties) }
}
test {
testLogging {
showStandardStreams = true
exceptionFormat = 'full'
events 'SKIPPED'
}
jvmArgs = lmdbJvmArgs
maxHeapSize = '8G'
maxParallelForks = Runtime.runtime.availableProcessors().intdiv(2) ?: 1
passSystemProperties(systemProperties)
}
clean {
delete 'build.log'
}