-
Notifications
You must be signed in to change notification settings - Fork 23
/
configuration.gradle
186 lines (155 loc) · 6.19 KB
/
configuration.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
project.ext {
cfgVersion = "0.19.2"
cfgGroup = "org.openmuc.framework"
cfgCopyDependencies = false
cfgSignPom = false
cfgSnapshotPattern = ~/\d+\.\d+\.\d+.*SNAPSHOT.*/
cfgRepository = project.properties.sonatypeRepository
cfgRepositoryUser = project.properties.sonatypeUser
cfgRepositoryPass = project.properties.sonatypePass
javaProjects = subprojects
jarDefaultImportPackageVersion = ";version=0"
// versions of commonly used libraries
assertjVersion = '3.20.2'
distributionProjects = javaProjects.findAll {
it.getPath() == ":openmuc-app-simpledemo" ||
it.getPath() == ":openmuc-core-api" ||
it.getPath() == ":openmuc-core-datamanager" ||
it.getPath() == ":openmuc-core-spi" ||
it.getPath() == ":openmuc-datalogger-amqp" ||
it.getPath() == ":openmuc-datalogger-ascii" ||
it.getPath() == ":openmuc-datalogger-mqtt" ||
it.getPath() == ":openmuc-datalogger-slotsdb" ||
it.getPath() == ":openmuc-datalogger-sql" ||
it.getPath() == ":openmuc-driver-aggregator" ||
it.getPath() == ":openmuc-driver-amqp" ||
it.getPath() == ":openmuc-driver-csv" ||
it.getPath() == ":openmuc-driver-dlms" ||
it.getPath() == ":openmuc-driver-ehz" ||
it.getPath() == ":openmuc-driver-iec60870" ||
it.getPath() == ":openmuc-driver-iec61850" ||
it.getPath() == ":openmuc-driver-iec62056p21" ||
it.getPath() == ":openmuc-driver-knx" ||
it.getPath() == ":openmuc-driver-mbus" ||
it.getPath() == ":openmuc-driver-modbus" ||
it.getPath() == ":openmuc-driver-mqtt" ||
it.getPath() == ":openmuc-driver-rest" ||
it.getPath() == ":openmuc-driver-snmp" ||
it.getPath() == ":openmuc-driver-wmbus" ||
it.getPath() == ":openmuc-lib-amqp" ||
it.getPath() == ":openmuc-lib-filePersistence" ||
it.getPath() == ":openmuc-lib-mqtt" ||
it.getPath() == ":openmuc-lib-osgi" ||
it.getPath() == ":openmuc-lib-parser-openmuc" ||
it.getPath() == ":openmuc-lib-rest1" ||
it.getPath() == ":openmuc-lib-ssl" ||
it.getPath() == ":openmuc-server-modbus" ||
it.getPath() == ":openmuc-server-restws" ||
it.getPath() == ":openmuc-webui-base" ||
it.getPath() == ":openmuc-webui-channelaccesstool" ||
it.getPath() == ":openmuc-webui-channelconfigurator" ||
it.getPath() == ":openmuc-webui-dataexporter" ||
it.getPath() == ":openmuc-webui-dataplotter" ||
it.getPath() == ":openmuc-webui-mediaviewer" ||
it.getPath() == ":openmuc-webui-simpledemovisualisation" ||
it.getPath() == ":openmuc-webui-spi" ||
it.getPath() == ":openmuc-webui-userconfigurator"
}
docProjects = distributionProjects.findAll {
it.getPath() == ":openmuc-core-api" ||
it.getPath() == ":openmuc-core-spi" ||
it.getPath() == ":openmuc-webui-spi"
}
if (cfgVersion.matches(cfgSnapshotPattern)) {
repositoryProjects = javaProjects
isReleaseVersion = false
} else {
repositoryProjects = distributionProjects
isReleaseVersion = true
cfgSignPom = true
}
}
configure(javaProjects) {
version = cfgVersion
if (project.hasProperty('argBranchName')) {
version += '-' + argBranchName
}
if (project.hasProperty('argCommitDate')) {
version += '-' + argCommitDate
}
apply plugin: "java"
apply plugin: "maven-publish"
publishing {
publications {
mavenJava(MavenPublication) {
pom {
licenses {
license {
name = "GNU General Public License"
url = "http://www.gnu.org/copyleft/gpl-3.0.html"
distribution = "repo"
}
}
}
}
}
}
}
task updateBundles(type: Exec) {
dependsOn(distributionProjects.build)
commandLine "./framework/bin/openmuc", "update-bundles"
}
tasks.withType(Tar) {
dependsOn(updateBundles)
into(project.name) {
from("./") {
include "build.gradle"
include "configuration.gradle"
include "license/**"
include "doc/CHANGELOG.txt"
include "gradle/wrapper/**"
include "gradlew"
include "gradlew.bat"
include "build/libs-all/**"
include "dependencies/**"
include "framework/felix/**"
include "framework/bundle"
include "framework/conf/**"
include "framework/bin/"
include "framework/media/README.txt/"
include "framework/log/README.txt"
include "framework/dependencies/**"
include "framework/csv-driver/**"
include "framework/README.txt"
exclude "**/projects/**/bin"
exclude "**/projects/**/build"
exclude "**/projects/**/.settings"
exclude "**/projects/**/.project"
exclude "**/projects/**/.classpath"
exclude "**/projects/**/.gradle"
exclude "gradle/develop"
for (Project myproject : distributionProjects) {
include myproject.getProjectDir().toString().substring((int) (getProjectDir().toString().size() + 1)) + "/**";
}
}
if (name.equals("tar")) {
exclude "**/dependencies/**/src"
}
from("./build/") {
include "settings.gradle"
}
}
into(project.name + "/doc/user-guide/") {
from("./build/docs/asciidoc/") {
include "**"
}
from("./build/docs/asciidocPdf/") {
include "*.pdf"
}
}
into(project.name + "/doc/") {
from("./build/docs/") {
include "javadoc/**"
}
}
}