-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
287 lines (245 loc) · 10.6 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
group "org.polypheny"
description = "A lightweight Polypheny-DB benchmarking client"
def versionMajor = 4
def versionMinor = 13
def versionQualifier = "-SNAPSHOT"
version = versionMajor + "." + versionMinor + versionQualifier
buildscript {
repositories {
mavenCentral()
maven {
url = uri("https://plugins.gradle.org/m2/")
}
}
dependencies {
// Shadowing; used to make a fat jar (https://github.com/johnrengelman/shadow)
classpath group: "com.github.johnrengelman", name: "shadow", version: "8.1.1"
// Lombok (https://plugins.gradle.org/plugin/io.freefair.lombok)
classpath group: "io.freefair.gradle", name: "lombok-plugin", version: "8.11"
// https://plugins.gradle.org/plugin/org.jetbrains.gradle.plugin.idea-ext
classpath group: "gradle.plugin.org.jetbrains.gradle.plugin.idea-ext", name: "gradle-idea-ext", version: "1.1.9"
// licensee plugin
classpath group: "app.cash.licensee", name: "licensee-gradle-plugin", version: "1.12.0"
// license report
classpath group: "com.jaredsburrows", name: "gradle-license-plugin", version: "0.9.8"
}
}
repositories {
mavenCentral()
maven {
url "https://clojars.org/repo/"
}
}
apply plugin: "java-library"
apply plugin: "org.jetbrains.gradle.plugin.idea-ext"
apply plugin: "io.freefair.lombok"
apply plugin: "com.github.johnrengelman.shadow"
apply plugin: "app.cash.licensee"
apply plugin: "com.jaredsburrows.license"
tasks.withType(JavaCompile).configureEach {
options.encoding = "UTF-8"
}
//configurations.all {
// // check for updates every build
// resolutionStrategy.cacheChangingModulesFor 0, "seconds"
//}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(21))
}
}
configurations {
oldPolyphenyJdbcDriver
newPolyphenyJdbcDriver
}
dependencies {
// Commons
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.17.0' // License: Apache 2.0
implementation group: 'commons-io', name: 'commons-io', version: '2.18.0' // License: Apache 2.0
// Polypheny Control Connector
implementation group: 'org.polypheny', name: 'control-connector', version: '2.2.1' // License: Apache 2.0
// Chronos
implementation group: 'org.chronos-eaas', name: 'chronos-agent', version: '2.5.1' // License: MIT
// REST
implementation group: 'com.konghq', name: 'unirest-java-core', version: '4.4.5' // License: MIT
// JDBC Drivers
oldPolyphenyJdbcDriver group: 'org.polypheny', name: 'polypheny-jdbc-driver', version: '1.5.3' // License: Apache 2.0
newPolyphenyJdbcDriver group: 'org.polypheny', name: 'polypheny-jdbc-driver', version: '2.3' // License: Apache 2.0
implementation group: 'org.postgresql', name: 'postgresql', version: '42.7.4' // License: BSD-2-Clause License
implementation group: 'monetdb', name: 'monetdb-jdbc', version: '3.3' // License: Mozilla Public License 2.0
// Cottontail-DB
//implementation group: 'org.slf4j', name: 'log4j-over-slf4j', version: '1.7.36' // License: MIT
implementation(group: 'org.vitrivr', name: 'cottontaildb', version: '0.10.5') { // License: MIT
exclude group: 'org.apache.logging.log4j'
exclude group: 'org.slf4j'
}
// CLI library
implementation group: 'com.github.rvesse', name: 'airline', version: '3.0.0' // License: Apache 2.0
// Fake data generator
implementation group: 'com.devskiller', name: 'jfairy', version: '0.6.5' // License: Apache 2.0
// Video processing
implementation group: 'org.jcodec', name: 'jcodec', version: '0.2.5' // License: BSD-2-Clause License
implementation group: 'org.jcodec', name: 'jcodec-javase', version: '0.2.5' // License: BSD-2-Clause License
// JSON
implementation group: 'com.google.code.gson', name: 'gson', version: '2.11.0' // License: Apache 2.0
// Logging
implementation group: 'org.slf4j', name: 'slf4j-api', version: '2.0.16' // License: MIT
implementation group: 'org.apache.logging.log4j', name: 'log4j-slf4j2-impl', version: '2.24.3' // License: Apache 2.0
implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.24.3' // License: Apache 2.0
//annotationProcessor group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.21.1' // License: Apache 2.0
// Extracting ZIPs
implementation group: 'net.lingala.zip4j', name: 'zip4j', version: '2.11.5' // License: Apache 2.0
// --- Testing ---
//testImplementation group: 'junit', name: 'junit', version: '4.13.2'
}
/**
* License check
*/
licensee {
// Category A
allow('Apache-2.0')
allow('MIT')
allow('BSD-2-Clause')
allow('BSD-3-Clause')
allowUrl('https://opensource.org/licenses/MIT')
allowDependency('aopalliance', 'aopalliance', '1.0') { because 'Public Domain' }
allowDependency('javax.annotation', 'javax.annotation-api', '1.2') { because 'CDDL license' }
allowDependency('org.jcodec', 'jcodec', '0.2.5') { because 'BSD 2-Clause' }
allowDependency('org.jcodec', 'jcodec-javase', '0.2.5') { because 'BSD 2-Clause' }
allowDependency('org.java-websocket', 'Java-WebSocket', '1.5.4') { because 'MIT License' }
allowDependency('org.bouncycastle', 'bcpkix-jdk15on', '1.61') { because 'MIT License' }
allowDependency('org.bouncycastle', 'bcprov-jdk15on', '1.61') { because 'MIT License' }
allowDependency('org.postgresql', 'postgresql', '42.7.4') { because 'BSD 2-Clause' }
allowDependency('org.vitrivr', 'cottontaildb', '0.10.5') { because 'MIT License' }
allowDependency('org.vitrivr', 'cottontaildb-proto', '0.10.3') { because 'MIT License' }
allowDependency('com.google.re2j', 're2j', '1.2') { because 'BSD 3-Clause' }
// Category B
allow('EPL-1.0')
allow('MPL-2.0')
}
javadoc {
if (JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption("html5", true)
}
// suppress most of the warnings
options.addStringOption("Xdoclint:none", "-quiet")
// Include private fields in JavaDoc
options.memberLevel = JavadocMemberLevel.PRIVATE
options.setOutputLevel(JavadocOutputLevel.QUIET)
options.quiet()
}
/**
* JARs
*/
jar {
manifest {
attributes "Manifest-Version": "1.0"
attributes "Copyright": "The Polypheny Project (polypheny.org)"
attributes "Version": project.version
attributes "Main-Class": "org.polypheny.simpleclient.cli.Main"
attributes "Multi-Release": "true"
attributes "Implementation-Version": project.version
}
}/*
task sourcesJar(type: Jar, dependsOn: classes) {
classifier "sources"
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier "javadoc"
from javadoc.destinationDir
}*/
shadowJar {
zip64 true
archiveClassifier.set('')
mergeServiceFiles {
setPath("META-INF/services")
include("io.grpc.*")
}
// Include everything from 'libs' but rename JARs to another extension to trick the plugin
from('libs') {
eachFile { FileCopyDetails fcd ->
if (fcd.name.endsWith('.jar')) {
int lastIndex = fcd.name.lastIndexOf('.')
fcd.name = fcd.name[0..lastIndex] + 'zip' // Rename .jar to .zip
}
}
into 'libs'
}
}
assemble.dependsOn shadowJar
artifacts {
//archives jar // regular jar containing only the compiled source
archives shadowJar // fat jar which additionally contains all dependencies
//archives sourcesJar // jar file containing the java doc files
//archives javadocJar // jar file containing the source files
}
task copyPolyphenyOldJdbcDriver(type: Copy) {
// Ensure directory is created before copying
doFirst {
mkdir 'libs/polyphenyJdbcDrivers'
}
from configurations.oldPolyphenyJdbcDriver
into 'libs/polyphenyJdbcDrivers'
rename { String fileName ->
'old-driver.jar'
}
}
task copyPolyphenyNewJdbcDriver(type: Copy) {
// Ensure directory is created before copying
doFirst {
mkdir 'libs/polyphenyJdbcDrivers'
}
from configurations.newPolyphenyJdbcDriver
into 'libs/polyphenyJdbcDrivers'
rename { String fileName ->
'new-driver.jar'
}
}
compileJava.dependsOn(copyPolyphenyOldJdbcDriver)
compileJava.dependsOn(copyPolyphenyNewJdbcDriver)
/**
* IntelliJ
*/
idea {
module {
downloadJavadoc = true
downloadSources = true
inheritOutputDirs = false
outputDir = file("${project.buildDir}/classes")
testOutputDir = file("${project.buildDir}/test-classes")
}
project {
settings {
copyright {
useDefault = "MITLicense"
profiles {
MITLicense {
notice = 'The MIT License (MIT)\n' +
'\n' +
'Copyright (c) 2019-$today The Polypheny Project\n' +
'\n' +
'Permission is hereby granted, free of charge, to any person obtaining a\n' +
'copy of this software and associated documentation files (the "Software"), to deal\n' +
'in the Software without restriction, including without limitation the rights\n' +
'to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n' +
'copies of the Software, and to permit persons to whom the Software is\n' +
'furnished to do so, subject to the following conditions:\n' +
'\n' +
'The above copyright notice and this permission notice shall be included in all\n' +
'copies or substantial portions of the Software.\n' +
'\n' +
'THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n' +
'IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n' +
'FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n' +
'AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n' +
'LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n' +
'OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n' +
'SOFTWARE.'
keyword = "Copyright"
}
}
}
}
}
}