Repository navigation
Expand file tree
/
Copy pathbuild.gradle
More file actions
746 lines (643 loc) · 24.1 KB
/
Copy pathbuild.gradle
File metadata and controls
746 lines (643 loc) · 24.1 KB
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
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
// workaround to force gradle to download not just the dependencies for --offline use
// but also the plugins
buildscript {
repositories {
maven {
url = "https://plugins.gradle.org/m2/"
}
}
}
plugins {
id("net.ltgt.errorprone") version "5.2.0" apply false
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'application'
apply plugin: 'checkstyle'
apply plugin: 'jacoco'
checkstyleTest.enabled = false
configurations {
compileClasspath {
resolutionStrategy.activateDependencyLocking()
}
runtimeClasspath {
resolutionStrategy.activateDependencyLocking()
}
annotationProcessor {
resolutionStrategy.activateDependencyLocking()
}
}
def protobufVersion = '31.1'
def protoc = file("${projectDir}/tools/protoc-" + protobufVersion + '/bin/protoc')
def logbackConfig = "logback.xml"
def jvmOpts = ["-Xms32M"]
def jvmSatelliteOpts = ["-Xms32M", "-Xmx2G", "-XX:+CrashOnOutOfMemoryError"]
def jvmControllerOpts = ["-Xms256M", "-Xmx8G", "-XX:+CrashOnOutOfMemoryError"]
def cronVersion = '9.2.1'
def javaHome = providers.gradleProperty("javaHome")
group = 'com.linbit'
allprojects {
plugins.withType(JavaPlugin) {
java {
sourceCompatibility = JavaVersion.VERSION_21
}
}
plugins.withType(CheckstylePlugin) {
checkstyle {
toolVersion = "14.4.0"
}
}
}
subprojects {
apply plugin: 'java'
apply plugin: 'checkstyle'
apply plugin: 'jacoco'
if (!rootProject.hasProperty('disableErrorProne'))
{
apply plugin: 'net.ltgt.errorprone'
dependencies {
errorprone("com.google.errorprone:error_prone_core:2.52.0")
}
}
// "compileJava" would exclude "compileTestJava"
tasks.withType(JavaCompile).configureEach {
options.release = 21
options.compilerArgs.add("-Werror")
if (!rootProject.hasProperty('disableErrorProne'))
{
options.errorprone {
disableWarningsInGeneratedCode = true
excludedPaths = ".*/generated-(dbdrivers|src)/.*"
disable("SameNameButDifferent")
disable("EmptyCatch")
disable("NonApiType")
disable("DoNotCallSuggester")
disable("MutablePublicArray")
disable("NullableTypeParameter")
disable("StringCaseLocaleUsage")
disable("AnnotateFormatMethod")
disable("DeprecatedVariable")
disable("IfChainToSwitch")
disable("LoopToTestParameter")
}
}
}
repositories {
mavenCentral()
}
installDist {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
}
project(':server') {
apply plugin: 'java-library'
apply plugin: 'java-library-distribution'
// shared test utilities (server/src/testFixtures) usable by all module test source sets
apply plugin: 'java-test-fixtures'
dependencies {
api 'com.google.inject:guice:7.0.0'
api 'com.google.inject.extensions:guice-assistedinject:7.0.0'
// compileOnly "com.google.protobuf:protobuf-javalite:${protobufVersion}"
api "com.google.protobuf:protobuf-java:4.${protobufVersion}"
api 'io.sentry:sentry:8.64.0'
api 'info.picocli:picocli:4.7.7'
// project-reactor
api platform('io.projectreactor:reactor-bom:2025.0.8')
// add dependencies without a version number
api 'io.projectreactor:reactor-core'
compileOnly 'org.slf4j:slf4j-api:2.0.20'
api 'ch.qos.logback:logback-classic:1.6.6'
api 'org.apache.httpcomponents.client5:httpclient5:5.6.5'
api 'com.fasterxml.jackson.jr:jackson-jr-objects:2.22.4'
api 'com.fasterxml.jackson.core:jackson-databind:2.22.4'
api 'org.apache.commons:commons-dbcp2:2.14.0'
api 'org.apache.commons:commons-pool2:2.13.1'
api 'com.h2database:h2:2.4.240'
// prometheus client
api 'io.prometheus:simpleclient_common:0.16.0'
api platform('com.amazonaws:aws-java-sdk-bom:1.12.797') // switching to awssdk 2.x needs some more work
api 'com.amazonaws:aws-java-sdk-s3'
api 'com.amazonaws:aws-java-sdk-ebs'
api 'com.amazonaws:aws-java-sdk-ec2'
api "com.cronutils:cron-utils:${cronVersion}"
// toml parsing library
api 'io.hotmoka:toml4j:0.7.3'
// LINSTOR only uses the k8s client as a CRD-based database backend. The
// kubernetes-client(-api) pulls in a model module per k8s API group, but we only
// need the base types (model-core/-common) and CustomResourceDefinitions
// (model-apiextensions). We must additionally keep the model modules whose classes
// the fabric8 client loads regardless of which resource we operate on:
// - eagerly, while building the KubernetesClient: KubernetesClientImpl
// .registerDefaultHandlers() hard-references handler classes from apps
// (Deployment/ReplicaSet/StatefulSet), batch (Job), certificates
// (CertificateSigningRequest) and extensions (Deployment/ReplicaSet);
// - reflectively, on any CRUD operation: BaseOperation/OperationSupport build
// anonymous Jackson TypeReferences, so generic-signature reification calls
// Class.getDeclaredMethods() on those classes and force-loads the model types
// in their method descriptors, namely autoscaling (Scale) and extensions
// (DeploymentRollback).
// Excluding any of those breaks startup/operations with a ClassNotFoundException.
// The remaining model modules are only reachable from typed DSL accessors
// (client.network()/.rbac()/.policy()/...) that LINSTOR never calls, so exclude
// the model modules for those API groups.
//
// The fabric8 HTTP transport is pluggable (ServiceLoader). The default Vert.x
// transport drags in vertx-core and the whole netty stack, which we only used to
// talk to the k8s API server. Use the JDK (java.net.http) transport instead, which
// has no further dependencies.
def excludeUnusedK8sModels = { dep ->
[
'admissionregistration', 'coordination', 'discovery', 'events',
'flowcontrol', 'gatewayapi', 'metrics', 'networking', 'node', 'policy',
'rbac', 'resource', 'scheduling', 'storageclass'
].each { apiGroup ->
dep.exclude group: 'io.fabric8', module: "kubernetes-model-$apiGroup"
}
}
api('io.fabric8:kubernetes-client:7.9.0') {
excludeUnusedK8sModels(it)
exclude group: 'io.fabric8', module: 'kubernetes-httpclient-vertx'
}
// depends on kubernetes-client-api, so it needs the same model exclusions
api('io.fabric8:kubernetes-httpclient-jdk:7.9.0') {
excludeUnusedK8sModels(it)
}
api 'com.github.spotbugs:spotbugs-annotations:4.10.5'
api 'info.faljse:SDNotify:1.6'
testImplementation(platform('org.junit:junit-bom:6.1.3'))
testFixturesImplementation 'junit:junit:4.13.2'
}
sourceSets {
main {
java {
srcDirs = ["src/main/java", "generated-dbdrivers", "generated-src"]
}
resources {
srcDirs = ["src/main/resources", "generated-resources"]
}
}
test {
java {
srcDirs = ["src/test/java"]
}
}
}
/////////////////////////// Version Info ///////////////////////////
tasks.register('versionInfo') {
String propsFile = "$projectDir/generated-resources/version-info.properties"
outputs.file(propsFile)
if (project.hasProperty('versionOverride')) {
logger.warn("Overriding version with $versionOverride")
version = versionOverride
}
if (!project.hasProperty('versionOverride')) {
File gitFolder = file("$projectDir/../.git")
if (gitFolder.exists()) {
try {
// providers.exec captures stdout/stderr instead of printing it
providers.exec {
workingDir projectDir
commandLine 'make', '-C', '..', 'versioninfo'
}.result.get()
} catch (Exception exc) {
throw new RuntimeException("Cannot generate version.", exc)
}
}
Properties props = new Properties()
try {
props.load(new FileInputStream(propsFile))
} catch (Exception exc) {
throw new RuntimeException("Cannot read version.", exc)
}
version = props.get("version")
}
}
/**
* Generates Java sources from common API definitions. This includes the protobuf compilation.
*
* For package builds this task is run in the 'make debrelease' stage, the generated sources are bundled in the package
* tarball, and it is then skipped when the package is finally built.
*/
tasks.register('generateProto', Exec) {
doFirst {
if (!protoc.exists()) {
throw new GradleException("'protoc' binary not found; run the task 'getProtoc' to download the binary")
}
}
commandLine 'make', '-C', "${projectDir}/proto", "PROTOC=" + protoc, 'proto'
inputs.files(fileTree("${projectDir}/proto"))
outputs.dir(file("${projectDir}/generated-src"))
}
tasks.register('generateJava', Exec) {
commandLine 'make', '-C', '../linstor-common', 'java'
inputs.files(fileTree("../linstor-common"))
outputs.files(file("${projectDir}/generated-src/com/linbit/linstor/api/ApiConsts.java"),
"${projectDir}/generated-src/com/linbit/linstor/api/prop/GeneratedPropertyRules.java"
)
dependsOn generateProto
}
tasks.register('cleanProto', Exec) {
commandLine 'make', '-C', "${projectDir}/proto", 'clean-proto'
}
tasks.register('cleanCommon', Exec) {
commandLine 'make', '-C', "../linstor-common", 'cleanjava'
}
processResources.dependsOn versionInfo
compileJava {
dependsOn generateJava
}
clean {
delete "${projectDir}/generated-resources"
dependsOn cleanCommon, cleanProto
}
}
project(':satellite') {
apply plugin: 'application'
dependencies {
implementation project(':server'), project(':jclcrypto')
testImplementation testFixtures(project(':server'))
testImplementation 'junit:junit:4.13.2'
testImplementation "org.assertj:assertj-core:3.27.+"
testImplementation "org.mockito:mockito-core:5.24.0"
}
sourceSets {
main {
java {
srcDirs = ["src/main/java"]
}
resources {
srcDirs = ["src/main/resources"]
}
}
test {
java {
srcDirs = ["src/test/java"]
}
}
}
startScripts.enabled = false
tasks.register('SatelliteStartup', CreateStartScripts) {
mainClass = 'com.linbit.linstor.core.Satellite'
applicationName = "Satellite"
outputDir = layout.buildDirectory.dir('satellite').get().asFile
classpath = files('conf') + files('*')
defaultJvmOpts = jvmSatelliteOpts
doLast {
delete windowsScript
if (javaHome.present) {
unixScript.text = unixScript.text.replaceFirst("JAVACMD=\"?java\"?", "JAVACMD=${javaHome.get()}/bin/java")
}
}
}
distributions {
main {
contents {
from(SatelliteStartup) {
into("bin")
}
}
}
}
}
project(':jclcrypto') {
apply plugin: 'java-library'
apply plugin: 'java-library-distribution'
dependencies {
implementation project(':server')
}
sourceSets {
main {
java {
srcDirs = ["src/main/java", "generated-src"]
}
}
test {
java {
srcDirs = ["src/test/java"]
}
}
}
}
version = project(':server').version
project(':controller').version = version
project(':satellite').version = version
project(':jclcrypto').version = version
def jerseyVersion = '4.0.3'
project(':controller') {
apply plugin: 'application'
configurations {
// H2 1.x jar shipped outside the classpath (lib/migration), only used by
// "linstor-database migrate-h2" to read pre-2.x database files
h2v1migration {
transitive = false
canBeConsumed = false
}
}
dependencies {
implementation project(':server'), project(':jclcrypto')
testImplementation project(':server'), project(':jclcrypto')
testImplementation testFixtures(project(':server'))
testImplementation 'junit:junit:4.13.2'
testImplementation "org.assertj:assertj-core:3.27.+"
testImplementation "org.mockito:mockito-core:5.24.0"
h2v1migration 'com.h2database:h2:1.4.197'
// rest libs (grizzly http(s), jersey(rest))
implementation 'org.glassfish.grizzly:grizzly-http-server:5.0.3'
// jersey 4.0.2 is built against the hk2 4.0.0-M3 milestone; align all hk2 artifacts with guice-bridge
implementation 'org.glassfish.hk2:guice-bridge:4.0.3'
implementation 'org.glassfish.hk2:hk2-api:4.0.3'
implementation 'org.glassfish.hk2:hk2-locator:4.0.3'
implementation 'org.glassfish.hk2:hk2-utils:4.0.3'
implementation "org.glassfish.jersey.inject:jersey-hk2:${jerseyVersion}"
implementation "org.glassfish.jersey.containers:jersey-container-grizzly2-http:${jerseyVersion}"
implementation "org.glassfish.jersey.containers:jersey-container-grizzly2-servlet:${jerseyVersion}"
implementation "org.glassfish.jersey.media:jersey-media-sse:${jerseyVersion}"
// prometheus client library
implementation 'io.prometheus:simpleclient_hotspot:0.16.0'
runtimeOnly 'org.mariadb.jdbc:mariadb-java-client:3.5.11'
runtimeOnly 'org.postgresql:postgresql:42.7.14'
}
sourceSets {
main {
java {
srcDirs = ["src/main/java", "generated-src"]
}
resources {
srcDirs = ["src/main/resources", "generated-resources"]
}
}
test {
java {
srcDirs = ["src/test/java"]
}
}
}
startScripts.enabled = false
tasks.register('ControllerStartup', CreateStartScripts) {
mainClass = 'com.linbit.linstor.core.Controller'
applicationName = "Controller"
outputDir = layout.buildDirectory.dir('controller').get().asFile
classpath = files('conf') + files('*')
defaultJvmOpts = jvmControllerOpts
doLast {
delete windowsScript
if (javaHome.present) {
unixScript.text = unixScript.text.replaceFirst("JAVACMD=\"?java\"?", "JAVACMD=${javaHome.get()}/bin/java")
}
}
}
tasks.register('LinstorConfigStartup', CreateStartScripts) {
mainClass = 'com.linbit.linstor.core.LinstorConfigTool'
applicationName = "linstor-config"
outputDir = layout.buildDirectory.dir('linstorconfig').get().asFile
classpath = files('*')
defaultJvmOpts = jvmOpts
doLast {
delete windowsScript
if (javaHome.present) {
unixScript.text = unixScript.text.replaceFirst("JAVACMD=\"?java\"?", "JAVACMD=${javaHome.get()}/bin/java")
}
}
}
tasks.register('LinstorDbToolStartup', CreateStartScripts) {
mainClass = 'com.linbit.linstor.core.LinstorDatabaseTool'
applicationName = "linstor-database"
outputDir = layout.buildDirectory.dir('linstordb').get().asFile
classpath = files('*')
defaultJvmOpts = jvmOpts
doLast {
delete windowsScript
if (javaHome.present) {
unixScript.text = unixScript.text.replaceFirst("JAVACMD=\"?java\"?", "JAVACMD=${javaHome.get()}/bin/java")
}
}
}
distributions {
main {
contents {
from(ControllerStartup) {
into("bin")
}
from(LinstorConfigStartup) {
into("bin")
}
from(LinstorDbToolStartup) {
into("bin")
}
from(configurations.h2v1migration) {
into("lib/migration")
}
}
}
}
}
sourceSets {
test {
java {
srcDirs = ["src/test/java"]
}
}
}
test {
jvmArgs("--add-opens", "java.base/java.lang=ALL-UNNAMED",
"--add-opens", "java.base/java.util=ALL-UNNAMED",
"--add-opens", "java.base/java.io=ALL-UNNAMED",)
// gradle's 512M default is too small for the H2/Guice based API test suites + jacoco instrumentation
maxHeapSize = '2g'
finalizedBy jacocoTestReport // report is always generated after tests run
}
jacocoTestReport {
if (project.hasProperty('CoverageReport')) {
dependsOn = subprojects.test
additionalSourceDirs.setFrom(files(subprojects.sourceSets.main.allSource.srcDirs))
sourceDirectories.setFrom(files(subprojects.sourceSets.main.allSource.srcDirs))
classDirectories.setFrom(files(subprojects.sourceSets.main.output))
// include the execution data of the per-module test tasks (satellite, controller)
executionData.setFrom(
files(
layout.buildDirectory.file("jacoco/test.exec"),
subprojects.collect { it.layout.buildDirectory.file("jacoco/test.exec") }
).filter { it.exists() }
)
reports {
html.required = true
xml.required = true
csv.required = true
}
onlyIf = {
true
}
// doFirst {
// executionData.setFrom(files(executionData.findAll {
// it.exists()
// }))
// }
afterEvaluate {
excludedClassFilesForReport(classDirectories)
}
}
}
jacocoTestCoverageVerification {
if (project.hasProperty('CoverageReport')) {
afterEvaluate {
excludedClassFilesForReport(classDirectories)
}
}
}
private excludedClassFilesForReport(classDirectories) {
classDirectories.setFrom(files(classDirectories.files.collect {
fileTree(dir: it,
exclude: [
// generated code only: keep the coverage denominator to handwritten classes
'com/linbit/linstor/proto/**',
'com/linbit/linstor/dbdrivers/k8s/crd/GenCrdCurrent*',
'com/linbit/linstor/dbdrivers/k8s/crd/GenCrdV*',
'com/linbit/linstor/dbdrivers/GeneratedDatabaseTables*',
'com/linbit/linstor/api/prop/GeneratedPropertyRules*',
'com/linbit/linstor/api/ApiConsts*'
]
)
}))
}
repositories {
mavenCentral()
}
dependencies {
implementation project(':server'), project(':controller'), project(':satellite'), project(':jclcrypto')
testImplementation project(':server'), project(':controller'), project(':satellite'), project(':jclcrypto')
testImplementation testFixtures(project(':server'))
testImplementation "com.google.protobuf:protobuf-java:4.${protobufVersion}"
testImplementation 'org.mockito:mockito-core:5.24.0'
testCompileOnly 'org.slf4j:slf4j-api:2.0.20'
testImplementation 'org.assertj:assertj-core:3.27.+'
testImplementation 'pl.pragmatists:JUnitParams:1.1.1'
testImplementation "com.cronutils:cron-utils:${cronVersion}"
testImplementation 'com.google.inject.extensions:guice-testlib:7.0.0'
testImplementation 'io.projectreactor:reactor-test:3.8.+'
}
/////////////////////////// Start scripts ///////////////////////////
startScripts.enabled = false
distributions {
main {
contents {
from(project(":controller").ControllerStartup) {
into("bin")
}
from(project(":satellite").SatelliteStartup) {
into("bin")
}
from(project(":controller").LinstorConfigStartup) {
into("bin")
}
from(project(":controller").LinstorDbToolStartup) {
into("bin")
}
from("server/" + logbackConfig) {
into("lib/conf")
}
from("scripts/linstor-controller.service") {
into("systemd")
}
from("scripts/linstor-satellite.service") {
into("systemd")
}
from("scripts/linstor-controller-ha-setup.py") {
into("bin")
rename { "linstor-controller-ha-setup" }
}
from(project(":controller").configurations.h2v1migration) {
into("lib/migration")
}
}
}
}
installDist {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
tasks.register('showMeCache') {
doLast {
configurations.runtimeClasspath.each { println it }
}
}
tasks.register('showMeTestCache') {
doLast {
configurations.testRuntimeClasspath.each { println it }
}
}
/////////////////////////// Test commands ///////////////////////////
tasks.register('buildTestCommands', Exec) {
workingDir 'test-support'
commandLine 'make'
//store the output instead of printing to the console:
standardOutput = new ByteArrayOutputStream()
//extension method buildTestCommands.output() can be used to obtain the output:
ext.output = {
return standardOutput.toString()
}
}
tasks.register('unzipProtoc', Copy) {
dependsOn(downloadProtoc)
def zipFile = file("tools/protoc-" + protobufVersion + '-linux-x86_64.zip')
def outputDir = file("tools/protoc-" + protobufVersion)
from zipTree(zipFile)
into outputDir
eachFile {
if (it.relativePath.getFile(destinationDir).exists()) {
it.exclude()
}
}
}
tasks.register('downloadProtoc') {
outputs.dir "tools"
def protozip = new File("${projectDir}/tools/protoc-" + protobufVersion + '-linux-x86_64.zip')
outputs.file protozip
doLast {
if (!protozip.exists()) {
mkdir "tools"
println "downloading protoc..."
new URL('https://github.com/google/protobuf/releases/download/v'
+ protobufVersion + '/protoc-' + protobufVersion + '-linux-x86_64.zip')
.withInputStream { i -> protozip.withOutputStream { it << i } }
}
}
}
tasks.register('getProtoc') {
dependsOn downloadProtoc, unzipProtoc
}
tasks.register('cleanTestCommands', Exec) {
workingDir 'test-support'
commandLine 'make', 'clean'
//store the output instead of printing to the console:
standardOutput = new ByteArrayOutputStream()
//extension method buildTestCommands.output() can be used to obtain the output:
ext.output = {
return standardOutput.toString()
}
}
compileTestJava {
dependsOn buildTestCommands
}
clean {
dependsOn cleanTestCommands
}
// this task is needed for RPM packaging
// it creates a list of dependency jars needed for the server project
tasks.register('showServerRuntimeLibs') {
doLast {
project(':server').configurations.getByName('runtimeClasspath').files.each { f ->
print('/usr/share/linstor-server/lib/' + f.getName().toString() + '\n')
}
}
}
tasks.register('downloadDependencies') {
doLast {
subprojects.each { prj ->
['compileClasspath', 'runtimeClasspath'].each { scope ->
prj.configurations.getByName(scope).resolve()
}
}
// needed by --offline package builds for "linstor-database migrate-h2"
project(':controller').configurations.getByName('h2v1migration').resolve()
}
}