-
Notifications
You must be signed in to change notification settings - Fork 27
/
build.gradle.kts
123 lines (97 loc) · 3.03 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
117
118
119
120
group = "com.hivemq"
plugins {
id("com.hivemq.edge-version-updater")
}
tasks.register("clean") {
group = "build"
gradle.includedBuilds.forEach {
dependsOn(it.task(":$name"))
}
}
tasks.register("build") {
group = "build"
gradle.includedBuilds.forEach {
dependsOn(it.task(":$name"))
}
}
tasks.register("check") {
group = "verification"
gradle.includedBuilds.forEach {
dependsOn(it.task(":$name"))
}
}
tasks.register("test") {
group = "verification"
gradle.includedBuilds.forEach {
dependsOn(it.task(":$name"))
}
}
tasks.register("classes") {
gradle.includedBuilds.forEach {
dependsOn(it.task(":$name"))
}
}
tasks.register("testClasses") {
gradle.includedBuilds.forEach {
dependsOn(it.task(":$name"))
}
}
/* ******************** release tasks ******************** */
val hivemq: Configuration by configurations.creating { isCanBeConsumed = false; isCanBeResolved = false }
val hivemqReleaseBinary: Configuration by configurations.creating {
isCanBeConsumed = false
isCanBeResolved = true
attributes {
attribute(Category.CATEGORY_ATTRIBUTE, objects.named("binary"))
attribute(Usage.USAGE_ATTRIBUTE, objects.named("release"))
}
extendsFrom(hivemq)
}
val edgeModule: Configuration by configurations.creating { isCanBeConsumed = false; isCanBeResolved = false }
val moduleReleaseBinaries: Configuration by configurations.creating {
isCanBeConsumed = false
isCanBeResolved = true
attributes {
attribute(Category.CATEGORY_ATTRIBUTE, objects.named("binary"))
attribute(Usage.USAGE_ATTRIBUTE, objects.named("release"))
}
extendsFrom(edgeModule)
}
dependencies {
hivemq("com.hivemq:hivemq-edge")
// ** module-deps ** //
edgeModule("com.hivemq:hivemq-edge-module-etherip")
edgeModule("com.hivemq:hivemq-edge-module-file")
edgeModule("com.hivemq:hivemq-edge-module-http")
edgeModule("com.hivemq:hivemq-edge-module-plc4x")
edgeModule("com.hivemq:hivemq-edge-module-opcua")
edgeModule("com.hivemq:hivemq-edge-module-modbus")
}
val hivemqEdgeZip by tasks.registering(Zip::class) {
group = "distribution"
description = "Bundles the complete distribution including modules"
archiveFileName.set("hivemq-edge-${project.version}.zip")
destinationDirectory.set(layout.buildDirectory.dir("distributions"))
from(hivemqReleaseBinary.elements.map { zipTree(it.first()) })
into("hivemq-edge-${project.version}") {
into("modules") {
from(moduleReleaseBinaries.elements)
}
}
}
val edgeProjectsToUpdate = setOf(
"hivemq-edge",
"hivemq-edge-module-etherip",
"hivemq-edge-module-file",
"hivemq-edge-module-http",
"hivemq-edge-module-modbus",
"hivemq-edge-module-opcua",
"hivemq-edge-module-plc4x"
)
tasks.register("updateDependantVersions") {
group = "other"
dependsOn(":updateVersion")
edgeProjectsToUpdate.forEach {
dependsOn(gradle.includedBuild(it).task(":updateVersion"))
}
}