-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle
202 lines (173 loc) · 5.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
buildscript {
repositories {
// jcenter()
// mavenCentral()
google()
}
dependencies {
classpath 'com.bmuschko:gradle-nexus-plugin:2.3.1'
}
}
plugins {
id 'com.palantir.git-version' version '0.9.1'
id 'nebula.lint' version '8.3.1'
}
import org.apache.tools.ant.filters.ExpandProperties
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
if (new File('.git').exists() && (exec {
commandLine "sh", "-c", "git --version"
standardOutput = new ByteArrayOutputStream()
errorOutput = new ByteArrayOutputStream()
ignoreExitValue true
}).exitValue == 0) {
version gitVersion()
} else {
version "unspecified"
}
group 'com.upserve'
description = """Uppend: fast, append-only key-multivalue store"""
// TODO unused-dependency is broken - claims all dependencies are unused!
//gradleLint.rules += 'unused-dependency'
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'jacoco'
apply plugin: 'com.bmuschko.nexus'
apply plugin: 'c'
jacoco {
toolVersion = "0.8.2" // Fixed to resolve issue with JDK 11 in Gradle 4.X.Y
}
sourceCompatibility = 1.9
targetCompatibility = 1.9
// Requires 1.9 or greater due to unsafe memory access in MappebByteBuffer - Oracle Incident Report 9119653
repositories {
mavenCentral()
}
dependencies {
compile 'com.google.guava:guava:21.0'
compile 'info.picocli:picocli:4.0.1'
compile 'io.dropwizard.metrics:metrics-core:3.2.3'
compile 'it.unimi.dsi:fastutil:7.0.13'
compile 'com.github.jnr:jnr-ffi:2.1.1'
// compile 'me.lemire.integercompression:JavaFastPFOR:0.1.11'
compile 'org.slf4j:slf4j-api:1.7.22'
testCompile 'junit:junit:4.12'
testCompile 'org.apache.logging.log4j:log4j-api:2.17.1'
testCompile 'org.mockito:mockito-core:2.18.3'
}
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation" << "-Werror"
//options.verbose = true
}
sourceSets {
main {
output.resourcesDir = "${buildDir}/classes/main"
}
test {
output.resourcesDir = "${buildDir}/classes/test"
}
}
ant.property(name: 'gradle_build_version', value: version)
processResources {
from(sourceSets.main.resources.srcDirs) {
include '**/*.properties'
filter(ExpandProperties, project: ant.antProject)
}
}
// TODO include the cross compiled nativeIO libs as a resource. Unpack and load from jar!
task fatJar(type: Jar) {
dependencies {
compile 'org.apache.logging.log4j:log4j-core:2.17.1'
compile 'org.apache.logging.log4j:log4j-slf4j-impl:2.17.1'
}
manifest {
attributes 'Main-Class': 'com.upserve.uppend.Uppend'
}
baseName = project.name + '-all'
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
}
tasks.withType(Test) {
maxHeapSize = "2048m"
// From https://stackoverflow.com/a/36130467/2136991
testLogging {
// set options for log level LIFECYCLE
events TestLogEvent.FAILED,
TestLogEvent.PASSED,
TestLogEvent.SKIPPED,
TestLogEvent.STANDARD_OUT
exceptionFormat TestExceptionFormat.FULL
showExceptions true
showCauses true
showStackTraces true
// set options for log level DEBUG and INFO
debug {
events TestLogEvent.STARTED,
TestLogEvent.FAILED,
TestLogEvent.PASSED,
TestLogEvent.SKIPPED,
TestLogEvent.STANDARD_ERROR,
TestLogEvent.STANDARD_OUT
exceptionFormat TestExceptionFormat.FULL
}
info.events = debug.events
info.exceptionFormat = debug.exceptionFormat
afterSuite { desc, result ->
if (!desc.parent) { // will match the outermost suite
def output = "Results: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} successes, ${result.failedTestCount} failures, ${result.skippedTestCount} skipped)"
def startItem = '| ', endItem = ' |'
def repeatLength = startItem.length() + output.length() + endItem.length()
println('\n' + ('-' * repeatLength) + '\n' + startItem + output + endItem + '\n' + ('-' * repeatLength))
}
}
}
}
jacocoTestReport {
reports {
xml.enabled = true
html.enabled = true
}
}
check.dependsOn jacocoTestReport
modifyPom {
project {
name 'Uppend'
description 'Uppend is an append-only, key-multivalue store.'
url 'https://github.com/upserve/uppend'
inceptionYear '2017'
scm {
url 'https://github.com/upserve/uppend'
connection 'scm:https://upserve@github.com/upserve/uppend.git'
developerConnection 'scm:git://github.com/upserve/uppend.git'
}
licenses {
license {
name 'The MIT License'
url 'https://opensource.org/licenses/MIT'
distribution 'repo'
}
}
developers {
developer {
id 'bfulton'
name 'Bright Fulton'
url 'https://github.com/bfulton'
}
developer {
id 'dstuebe'
name 'David Stuebe'
url 'https://github.com/dstuebe'
}
developer {
id 'jazzdan'
name 'Dan Miller'
url 'https://github.com/jazzdan'
}
developer {
id 'kbarrette'
name 'Keith Barrette'
url 'https://github.com/kbarrette'
}
}
}
}