-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle
210 lines (179 loc) · 5.68 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
buildscript {
repositories {
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}
}
}
plugins {
id 'java'
id 'scala'
id 'java-library'
id 'idea'
id 'maven-publish'
id 'signing'
id 'com.github.sherter.google-java-format' version '0.9'
id "com.github.johnrengelman.shadow" version "4.0.4"
id 'io.codearte.nexus-staging' version '0.30.0'
}
googleJavaFormat {
toolVersion = '1.7' // Java 8 compatible version
}
group 'io.tiledb'
version '1.20.0-SNAPSHOT'
sourceCompatibility = 11
targetCompatibility = 11
repositories {
mavenLocal()
jcenter()
mavenCentral()
maven {
url "https://oss.sonatype.org/content/repositories/snapshots"
}
}
nexusStaging {
username = System.getenv('SONATYPE_USERNAME')
password = System.getenv('SONATYPE_PASSWORD')
}
sourceSets {
main {
java {
srcDir 'main/java'
}
}
test {
java {
srcDir 'test/java'
}
}
}
dependencies {
compileOnly 'org.apache.spark:spark-sql_2.12:3.5.3'
compileOnly 'org.apache.spark:spark-core_2.12:3.5.3'
implementation 'io.tiledb:tiledb-java:0.28.0'
implementation 'commons-beanutils:commons-beanutils:1.9.4'
implementation group: 'com.github.oshi', name: 'oshi-core', version: '4.0.0'
implementation group: 'io.dropwizard.metrics', name: 'metrics-core', version: '4.1.0'
implementation 'joda-time:joda-time:2.10.13'
implementation 'com.fasterxml.jackson.core:jackson-annotations:2.12.3'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.12.3'
implementation 'com.fasterxml.jackson.core:jackson-core:2.12.3'
testImplementation group: 'junit', name: 'junit', version: '4.11'
testImplementation 'org.apache.spark:spark-sql_2.12:3.5.3'
testImplementation 'org.apache.spark:spark-core_2.12:3.5.3'
}
test {
failFast = true
maxHeapSize = "2048m"
systemProperty "java.library.path", new File(buildDir, "TileDB-Java/build/tiledb_jni")
testLogging {
showStandardStreams = true
}
}
// metrics.jar
task metricsJar(type: Jar) {
baseName = "tiledb-spark-metrics"
from(sourceSets.main.output) {
include "org/apache/spark/metrics/**"
}
}
assemble.dependsOn(metricsJar)
task getHomeDir {
doLast {
println gradle.gradleHomeDir
}
}
tasks.jar.configure {
classifier = 'default'
}
tasks.shadowJar.configure {
classifier = null
zip64 true
}
import com.github.sherter.googlejavaformatgradleplugin.GoogleJavaFormat
import com.github.sherter.googlejavaformatgradleplugin.VerifyGoogleJavaFormat
task format(type: GoogleJavaFormat) {
source = sourceSets*.allJava
include '**/*.java'
}
task checkFormat(type: VerifyGoogleJavaFormat) {
source = sourceSets*.allJava
include '**/*.java'
ignoreFailures false
}
task sourceJar(type: Jar) {
classifier "sources"
from sourceSets.main.allJava
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier "javadoc"
from javadoc.destinationDir
}
artifacts {
archives jar
archives sourceJar
archives javadocJar
}
import org.gradle.plugins.signing.Sign
gradle.taskGraph.whenReady { taskGraph ->
if (taskGraph.allTasks.any { it instanceof Sign }) {
allprojects { ext."signing.keyId" = System.getenv('GPG_KEY_ID') }
allprojects { ext."signing.secretKeyRingFile" = System.getenv('GPG_KEY_LOCATION') }
allprojects { ext."signing.password" = System.getenv('GPG_PASSPHRASE') }
}
// Do not sign archives by default (a local build without gpg keyring should succeed)
if (taskGraph.allTasks.any { it.name == 'build' || it.name == 'assemble' || it.name == 'publishToMavenLocal'}) {
tasks.findAll { it.name == 'signArchives' || it.name == 'signDocsJar' || it.name == 'signTestJar' || it.name == 'signMavenJavaPublication'}.each { task ->
task.enabled = false
}
}
}
publishing {
publications {
mavenJava(MavenPublication) {
artifact jar
artifact sourceJar
artifact javadocJar
pom {
name = 'TileDB Spark'
description = 'Spark interface to the TileDB storage manager'
url = 'https://github.com/TileDB-Inc/TileDB-Spark'
licenses {
license {
name = 'The MIT License (MIT)'
url = 'https://github.com/TileDB-Inc/TileDB-Spark/blob/master/LICENSE'
}
}
scm {
connection = 'scm:git:https://github.com/TileDB-Inc/TileDB-Spark.git'
developerConnection = 'scm:git:ssh://[email protected]/TileDB-Inc/TileDB-Spark'
url = 'https://github.com/TileDB-Inc/TileDB-Spark'
}
developers {
developer {
name = 'TileDB, Inc'
email = '[email protected]'
organization = 'TileDB, Inc.'
organizationUrl = 'https://tiledb.com/'
}
}
}
}
}
repositories {
maven {
def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username System.getenv('SONATYPE_USERNAME')
password System.getenv('SONATYPE_PASSWORD')
}
}
}
}
signing {
sign publishing.publications.mavenJava
sign configurations.archives
}