/
build.gradle
287 lines (248 loc) · 9.71 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
import java.nio.charset.StandardCharsets
//
// Copyright 2018-2023 SenX S.A.S.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
sourceSets {
main {
java {
srcDirs 'src/generated/thrift/gen-java'
}
}
}
dependencies {
//
// io.warp10 dependencies
//
api project(':crypto')
api project(':token')
api 'io.warp10:sensision:1.0.26'
api 'joda-time:joda-time:2.2'
api 'org.apache.commons:commons-lang3:3.12.0'
api 'org.apache.commons:commons-math3:3.6.1'
// https://mvnrepository.com/artifact/org.bouncycastle/bcpg-jdk15on
api 'org.bouncycastle:bcprov-jdk15on:1.70'
api 'org.bouncycastle:bcpg-jdk15on:1.70'
// https://mvnrepository.com/artifact/org.foundationdb/fdb-java
api 'org.foundationdb:fdb-java:7.1.37'
api 'org.apache.hadoop:hadoop-common:3.3.6'
api 'org.apache.hadoop:hadoop-mapreduce-client-core:3.3.6'
//
// Processing
//
api 'org.processing:core:3.3.7'
//
// Commons CLI
//
api 'commons-cli:commons-cli:1.5.0'
// For Standalone(Chunked)MemoryStore
api('org.apache.hadoop:hadoop-hdfs-client:3.3.6')
api 'org.eclipse.jetty:jetty-server:9.4.51.v20230217'
api 'org.eclipse.jetty.websocket:websocket-server:9.4.51.v20230217'
api 'org.eclipse.jetty.websocket:websocket-client:9.4.51.v20230217'
// https://mvnrepository.com/artifact/org.apache.curator/curator-x-discovery
api 'org.apache.curator:curator-x-discovery:5.4.0'
api 'com.fasterxml.jackson.core:jackson-databind:2.14.2'
api 'org.slf4j:slf4j-api:1.7.36'
constraints {
api('commons-beanutils:commons-beanutils:1.9.0') {
because '1.7.x and 1.8.x versions include some classes of org.apache.commons.collections which conflicts with commons-collections'
}
}
//
// FFT
//
api 'com.github.rwl:jtransforms:2.4.0'
//
// Pyrolite - need to stick with 4.x
//
api 'net.razorvine:pyrolite:4.30'
//
// LevelDB
//
api 'org.fusesource.leveldbjni:leveldbjni:1.8'
api 'org.fusesource.leveldbjni:leveldbjni-osx:1.8'
api 'org.fusesource.leveldbjni:leveldbjni-linux32:1.8'
api 'org.fusesource.leveldbjni:leveldbjni-linux64:1.8'
api 'org.fusesource.leveldbjni:leveldbjni-win32:1.8'
api 'org.fusesource.leveldbjni:leveldbjni-win64:1.8'
api('org.openlabtesting.leveldbjni:leveldbjni-linux64-aarch64:1.8') {
// Same as org.fusesource.leveldbjni:leveldbjni
exclude group: 'org.openlabtesting.leveldbjni', module: 'leveldbjni'
}
// Use uber version to have access to more native libraries
api 'org.iq80.leveldb:leveldb:0.12:uber'
//
// Mustache
//
api 'com.github.spullara.mustache.java:compiler:0.9.6'
//
// Geo
//
// There are several jts-core (aka jts) packaging. The most up-to-date is org.locationtech.jts:jts-core but the versions
// of the libs below use com.vividsolutions:jts/jts-core.
api('io.senx:geoxplib:1.0.4')
api('org.wololo:jts2geojson:0.10.0') {
// Conflicts with com.vividsolutions:jts pulled by io.senx:geoxplib
exclude group: 'com.vividsolutions', module: 'jts-core'
}
//
// Java Merge Sort
//
api 'com.fasterxml.util:java-merge-sort:1.1.0'
// @see <a href="http://www.mail-archive.com/dev@kafka.apache.org/msg03829.html>http://www.mail-archive.com/dev@kafka.apache.org/msg03829.html</a>
if (null != System.getProperty("pulsar")) {
// https://mvnrepository.com/artifact/org.apache.pulsar/pulsar-client-kafka
api group: 'org.apache.pulsar', name: 'pulsar-client-kafka', version: '2.8.0'
} else {
// https://mvnrepository.com/artifact/org.apache.kafka/kafka-clients
api group: 'org.apache.kafka', name: 'kafka-clients', version: '3.4.0'
}
testCompile 'junit:junit:4.6'
}
configurations.all {
// leveldb-0.12-uber.jar already contains leveldb-api
exclude group: 'org.iq80.leveldb', module: 'leveldb-api'
// leveldb-0.12-uber.jar already contains snappy-java
exclude group: 'org.xerial.snappy', module: 'snappy-java'
// jline-2.13.jar already contains all jansi classes on top of declaring it as dependencies, thus duplicating classes.
exclude group: 'org.fusesource.jansi', module:'jansi'
// Unused
exclude group: 'org.mortbay.jetty', module: 'servlet-api'
exclude group: 'org.mortbay.jetty', module: 'servlet-api-2.5'
exclude group: 'javax.servlet', module: 'servlet-api'
}
task pack(type: Jar) {
// Can be used to check for conflicts in dependencies.
// duplicatesStrategy = DuplicatesStrategy.WARN
// Duplicates must be kept in order not to remove the copyright notice of each dependency.
duplicatesStrategy = DuplicatesStrategy.INCLUDE
zip64 = true
archiveAppendix = (null != System.getProperty('warp')) ? System.getProperty('warp') : ""
manifest {
attributes(
"Main-Class": "io.warp10.standalone.Warp",
)
}
from files(sourceSets.main.output.classesDirs)
from files(sourceSets.main.resources.srcDirs)
from {
configurations.runtimeClasspath.collect {
it.isDirectory() ? it :zipTree(it)
}
} {
// Exclude unused files
exclude 'META-INF/*.DSA'
exclude 'META-INF/*.RSA' // Dependency signatures must be removed otherwise repackaged classes may fail to be validated
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/maven/**'
exclude 'hbase-webapps/**'
exclude 'about.html'
exclude 'jetty-dir.css'
exclude '**/junit/**'
exclude 'module-info.class'
}
}
//
// Exec task to create the Warp 10 tar.gz file
//
task createTarArchive(type: Exec, dependsOn: pack) {
workingDir '.'
commandLine "${projectDir}/src/main/sh/package.sh", version, projectDir, project.getProperties().get("signing.gnupg.keyName")
outputs.file "${buildDir}/libs/warp10-${version}.tar.gz"
}
//
// Set jars title
//
tasks.withType(Jar) {
manifest.attributes.put("Implementation-Title", "Warp 10")
}
//
// Customize POM name and description.
//
publishing {
publications {
maven(MavenPublication) {
pom {
name = "Warp 10"
description = "Warp 10 platform for time series storage and analysis"
}
}
}
}
task generateChangelog(type: Exec) {
workingDir '.'
String separator = "\uBEEF\uC0DE";
commandLine 'git', 'log', '--first-parent', '--decorate=short', '--decorate-refs=refs/tags/', '--format=%cs' + separator + '%D' + separator + '%s' + separator + '%b'
standardOutput = new ByteArrayOutputStream()
File changelogFile = new File(project.parent.projectDir, "CHANGELOG.md")
doLast {
changelogFile.write("# Warp 10 Changelog\n")
boolean firstLine = true
BufferedReader br = new BufferedReader(new InputStreamReader(new ByteArrayInputStream(standardOutput.toByteArray())));
for (String line; (line = br.readLine()) != null;) {
String[] splittedLine = line.trim().split(separator)
if (splittedLine.length < 3) {
// Skip invalid lines, usually the last empty line.
continue
}
// Release
if (!"".equals(splittedLine[1])) {
// There can be several tags for the same commit (rc for instance).
String[] tags = splittedLine[1].split(",")
changelogFile.append("##")
// Last tag is last created, so scan from the end.
for (int i = tags.length - 1; i >= 0; i--) {
if (i < tags.length - 1) {
changelogFile.append(",")
}
changelogFile.append(tags[i].trim().substring(4))
}
// Add date of tagged commit.
changelogFile.append(" (" + splittedLine[0] + ")\n")
} else if (firstLine) {
// First line but no tag, add "Unreleased" section.
changelogFile.append("## Unreleased\n")
}
// Commit
String commitMessage
if (splittedLine.length < 4) {
// Not a PR
commitMessage = splittedLine[2]
} else {
// Most probably a PR
commitMessage = splittedLine[3]
if (splittedLine[2].startsWith("Merge pull request")) {
// Definitively a PR, add link
int prNumberStartIndex = splittedLine[2].indexOf("#") + 1
int prNumberEndIndex = splittedLine[2].indexOf(" ", prNumberStartIndex)
String prNumber = splittedLine[2].substring(prNumberStartIndex, prNumberEndIndex)
commitMessage += " [#" + prNumber + "](https://github.com/senx/warp10-platform/pull/" + prNumber + ")"
}
}
if (commitMessage.startsWith("#")) {
commitMessage = "\\" + commitMessage
}
changelogFile.append("* " + commitMessage + "\n")
firstLine = false
}
}
}
//
// Tasks dependencies
//
compileJava.dependsOn("generateThrift")
createTarArchive.dependsOn("generateChangelog")
pack.dependsOn(":crypto:jar")
pack.dependsOn(":token:jar")