-
Notifications
You must be signed in to change notification settings - Fork 81
/
build.gradle
276 lines (232 loc) · 8.64 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
import org.jetbrains.gradle.ext.Gradle
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath group: "io.freefair.gradle", name: "lombok-plugin", version: lombok_version
classpath group: "com.adarshr", name: "gradle-test-logger-plugin", version: gradle_test_logger_version
classpath group: "org.reflections", name: "reflections", version: reflections_version
classpath group: "com.jaredsburrows", name: "gradle-license-plugin", version: license_report_version
}
}
plugins {
id "java"
id "org.jetbrains.gradle.plugin.idea-ext" version "1.1.7"
id 'nebula.lint' version "$nebula_lint_version"
}
test {
useJUnitPlatform()
}
allprojects {
version = versionMajor + "." + versionMinor + "." + versionMicro
isRelease = isRelease.toBoolean()
if (!isRelease) {
version = version + "-SNAPSHOT"
}
buildscript {
repositories {
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
maven {
url "https://clojars.org/repo/"
}
}
}
apply plugin: "java-library"
apply plugin: "io.freefair.lombok"
apply plugin: "com.adarshr.test-logger"
apply plugin: "com.jaredsburrows.license"
apply plugin: "nebula.lint"
compileJava.options.encoding = "UTF-8"
compileTestJava.options.encoding = "UTF-8"
javadoc.options.encoding = "UTF-8"
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
vendor = JvmVendorSpec.ADOPTIUM
}
}
tasks.withType(JavaCompile).configureEach {
options.encoding = "UTF-8"
}
repositories {
mavenLocal()
mavenCentral()
maven {
url "https://clojars.org/repo/"
}
maven {
// DBIS Nexus
url "https://dbis-nexus.dmi.unibas.ch/repository/maven2/"
}
maven {
url "https://oss.sonatype.org/content/repositories/snapshots/"
}
}
configurations.configureEach {
// check for updates every build
resolutionStrategy.cacheChangingModulesFor 0, "seconds"
}
tasks.withType(Javadoc) {
options.addBooleanOption("html5", true)
// Suppress most of the warnings
options.addStringOption("Xdoclint:none", "-quiet")
// Include private fields in JavaDoc
options.memberLevel = JavadocMemberLevel.PRIVATE
}
gradleLint.rules = ['all-dependency', 'unused-dependency']
gradleLint {
alwaysRun = false
}
String storeName = System.getProperty("store.default") != null ? System.getProperty("store.default") : 'hsqldb'
tasks.register('integrationTests', Test) {
description = 'Runs integration tests.'
group = 'verification'
systemProperty 'store.default', storeName
useJUnitPlatform {
includeTags("adapter")
excludeTags(storeName.toLowerCase() + "Excluded")
}
shouldRunAfter(tasks.named('test'))
}
integrationTests.dependsOn(testClasses)
testlogger {
theme 'standard'
showExceptions true
showStackTraces true
showFullStackTraces false
showCauses true
slowThreshold 2000
showSummary true
showSimpleNames false
showPassed false
showSkipped false
showFailed true
showStandardStreams true
showPassedStandardStreams false
showSkippedStandardStreams false
showFailedStandardStreams true
logLevel 'lifecycle'
}
dependencies {
////// PF4J
compileOnly(group: 'org.pf4j', name: 'pf4j', version: pf4j_version) {
exclude group: "org.slf4j"
}
annotationProcessor group: 'org.pf4j', name: 'pf4j', version: pf4j_version
implementation group: "org.slf4j", name: "slf4j-api", version: slf4j_api_version // MIT
implementation group: "org.apache.logging.log4j", name: "log4j-slf4j2-impl", version: log4j_slf4j_impl_version // Apache 2.0
testCompileOnly(group: 'org.pf4j', name: 'pf4j', version: pf4j_version) {
exclude group: "org.slf4j"
}
testImplementation(group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: junit_jupiter_version)
}
test {
useJUnitPlatform()
}
licenseReport {
generateJsonReport = true
generateCsvReport = false
generateHtmlReport = false
generateTextReport = false
}
idea {
module {
downloadJavadoc = true
downloadSources = true
inheritOutputDirs = false
outputDir = file("${project.buildDir}/classes")
testOutputDir = file("${project.buildDir}/test-classes")
generatedSourceDirs += file("${project.buildDir}/generated-sources")
generatedSourceDirs += file("${project.buildDir}/generated-test-sources")
}
}
}
tasks.register('gatherLicenseReports', Copy) {
// Define the destination directory for the reports
def destinationDir = "${rootProject.buildDir}/reports/licenses"
// Go through each subproject
subprojects.each { subproject ->
from("${subproject.buildDir}/reports/licenses") {
include 'licenseReport.json'
// Rename the report file to include the module name
rename { String fileName ->
"${subproject.name}-$fileName"
}
}
}
// Set the destination for the copied files
into destinationDir
}
gradle.projectsEvaluated { // Make sure the task runs after all projects are evaluated
gatherLicenseReports.dependsOn subprojects*.tasks*.findByName('licenseReport')
}
// plugin location
ext.pluginsDir = rootProject.buildDir.path + '/plugins'
build {
dependsOn(":plugins:build")
}
allprojects {
test.dependsOn(":plugins:assemblePlugins")
}
task printJavaVersion {
doLast {
println("Java version used for running Gradle: " + org.gradle.api.JavaVersion.current())
println "Current JAVA_HOME used by Gradle: " + System.getProperty("java.home")
// Retrieve and print the Java version configured in the toolchain
// Check if a toolchain is configured and retrieve details
if (project.extensions.findByType(JavaPluginExtension.class)?.toolchain != null) {
def toolchainService = project.extensions.getByType(JavaToolchainService.class)
def javaCompiler = toolchainService.compilerFor {
languageVersion.set(project.extensions.getByType(JavaPluginExtension.class).toolchain.languageVersion.get())
}
println "Java version used by toolchain: " + javaCompiler.get().metadata.languageVersion
println "Toolchain JAVA_HOME: " + javaCompiler.get().metadata.installationPath
} else {
println "No toolchain configured."
}
}
}
idea {
project {
settings {
runConfigurations {
"Polypheny-DB"(Gradle) {
taskNames = ["assemblePlugins", "runDev"]
}
"Polypheny-DB (reset)"(Gradle) {
taskNames = ["assemblePlugins", ":dbms:runDevReset"]
}
"Polypheny-DB (production)"(Gradle) {
taskNames = ["assemblePlugins", "run"]
}
}
copyright {
useDefault = "ApacheLicense"
profiles {
ApacheLicense {
notice = 'Copyright 2019-$today.year The Polypheny Project\n' +
'\n' +
'Licensed under the Apache License, Version 2.0 (the \"License\");\n' +
'you may not use this file except in compliance with the License.\n' +
'You may obtain a copy of the License at\n' +
'\n' +
'http://www.apache.org/licenses/LICENSE-2.0\n' +
'\n' +
'Unless required by applicable law or agreed to in writing, software\n' +
'distributed under the License is distributed on an \"AS IS\" BASIS,\n' +
'WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n' +
'See the License for the specific language governing permissions and\n' +
'limitations under the License.'
keyword = "Copyright"
}
}
}
}
}
}