-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
131 lines (109 loc) · 3.34 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
import com.vanniktech.maven.publish.SonatypeHost
plugins {
id 'checkstyle'
id 'java'
// this is a hopefully temporary plugin until maven central can add official gradle support
id 'com.vanniktech.maven.publish' version '0.29.0'
}
group = 'com.fauna'
compileJava {
options.encoding = 'UTF-8'
}
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
withSourcesJar()
}
test {
useJUnitPlatform {
excludeTags "perfTests"
}
}
tasks.register("perfTests", Test) {
useJUnitPlatform {
includeTags "perfTests"
}
}
repositories {
mavenCentral()
}
dependencies {
implementation "com.fasterxml.jackson.core:jackson-core:${jacksonVersion}"
implementation "com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}"
testImplementation 'junit:junit:4.13.2'
testImplementation "org.junit.jupiter:junit-jupiter-api:${junitVersion}"
testImplementation "org.junit.jupiter:junit-jupiter-params:${junitVersion}"
testImplementation "org.mockito:mockito-core:${mockitoVersion}"
testImplementation "org.mockito:mockito-junit-jupiter:${mockitoVersion}"
testImplementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:${jacksonVersion}"
testImplementation 'org.apache.commons:commons-math3:3.6.1'
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${junitVersion}"
}
mavenPublishing {
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL)
signAllPublications()
coordinates(project.group, project.name, project.version)
def githubRepo = "github.com/fauna/${project.name}"
pom {
name = project.name
description = 'JVM driver for Fauna'
url = "https://${githubRepo}"
licenses {
license {
name = 'MPL 2.0'
url = 'https://www.mozilla.org/en-US/MPL/2.0/'
distribution = 'repo'
}
}
developers {
developer {
name = 'Fauna Engineering'
id = '[email protected]'
organization = 'fauna.com'
organizationUrl = 'https://fauna.com'
}
}
scm {
url = 'https://${githubRepo}'
connection = "scm:git:git://${githubRepo}.git"
developerConnection = "scm:git:git://${githubRepo}.git"
}
issueManagement {
system = 'GitHub'
url = "https://${githubRepo}/issues"
}
}
}
// tasks
tasks.register('printVersion') {
doLast {
println project.version
}
}
tasks.register('writeProps', WriteProperties) {
destinationFile = file("src/main/resources/version.properties")
encoding = 'UTF-8'
property('version', project.version)
property('name', project.name)
property('group', project.group)
}
tasks.register('packageJar', Zip) {
into('lib') {
from(tasks.jar)
from(configurations.runtimeClasspath)
}
archiveFileName = 'fauna-jvm-package.zip'
}
checkstyle {
toolVersion = '10.19.0' // Latest Checkstyle version at the time of writing
ignoreFailures = false
}
tasks.withType(Checkstyle).configureEach {
reports {
xml.required = false
html.required = true
}
}
packageJar.dependsOn(compileJava)
processResources.dependsOn(writeProps)
sourcesJar.dependsOn(writeProps)