-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle.kts
116 lines (109 loc) · 3.5 KB
/
build.gradle.kts
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
plugins {
alias(libs.plugins.hivemq.extension)
alias(libs.plugins.defaults)
alias(libs.plugins.oci)
alias(libs.plugins.license)
}
group = "com.hivemq.extensions"
description = "Cluster discovery extension using round-robin DNS A records"
hivemqExtension {
name = "DNS Cluster Discovery Extension"
author = "HiveMQ"
priority = 1000
startPriority = 10000
sdkVersion = libs.versions.hivemq.extensionSdk
resources {
from("LICENSE")
}
}
dependencies {
compileOnly(libs.jetbrains.annotations)
implementation(libs.owner)
implementation(libs.netty.resolver.dns)
implementation(libs.commonsValidator)
}
oci {
registries {
dockerHub {
optionalCredentials()
}
}
imageMapping {
mapModule("com.hivemq", "hivemq-enterprise") {
toImage("hivemq/hivemq4")
}
}
imageDefinitions {
register("main") {
allPlatforms {
dependencies {
runtime("com.hivemq:hivemq-enterprise:latest") { isChanging = true }
}
layers {
layer("hivemqExtension") {
contents {
permissions("opt/hivemq/", 0b111_111_101)
permissions("opt/hivemq/extensions/", 0b111_111_101)
into("opt/hivemq/extensions") {
permissions("*/", 0b111_111_101)
permissions("*/dnsdiscovery.properties", 0b110_110_100)
permissions("*/hivemq-extension.xml", 0b110_110_100)
from(zipTree(tasks.hivemqExtensionZip.flatMap { it.archiveFile }))
}
}
}
}
}
}
register("integrationTest") {
allPlatforms {
dependencies {
runtime(project)
runtime("com.hivemq.extensions:hivemq-prometheus-extension")
}
}
}
}
}
@Suppress("UnstableApiUsage")
testing {
suites {
withType<JvmTestSuite> {
useJUnitJupiter(libs.versions.junit.jupiter)
}
"test"(JvmTestSuite::class) {
dependencies {
compileOnly(libs.jetbrains.annotations)
implementation(libs.mockito)
implementation(libs.mockito.junitJupiter)
runtimeOnly(libs.logback.classic)
}
}
"integrationTest"(JvmTestSuite::class) {
dependencies {
compileOnly(libs.jetbrains.annotations)
implementation(libs.testcontainers)
implementation(libs.testcontainers.hivemq)
implementation(libs.gradleOci.junitJupiter)
implementation(libs.apacheDS.dns)
implementation(libs.okhttp)
runtimeOnly(libs.logback.classic)
}
oci.of(this) {
imageDependencies {
runtime(project) {
capabilities {
requireFeature("integration-test")
}
}.tag("latest")
}
}
}
}
}
license {
header = rootDir.resolve("HEADER")
mapping("java", "SLASHSTAR_STYLE")
exclude("com/hivemq/extensions/cluster/discovery/dns/TestDnsServer.java")
exclude("hivemq-prometheus-extension/**/*")
}