-
Notifications
You must be signed in to change notification settings - Fork 64
/
build.gradle
329 lines (272 loc) · 10.2 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
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
buildscript {
ext.mavenRepositories = {
maven {
url artifactoryMavenSnapshotRepo
credentials {
username mavenUser
password mavenPassword
}
}
maven {
url artifactoryMavenRepo
credentials {
username mavenUser
password mavenPassword
}
}
maven {
url "https://talend-update.talend.com/nexus/content/repositories/libraries/"
}
maven {
url "https://plugins.gradle.org/m2/"
}
}
repositories mavenRepositories
dependencies {
classpath libs.gradle.sonar.plugin
classpath libs.gradle.release
classpath libs.gradle.licencer
classpath libs.gradle.jib.plugin
classpath libs.apache.compress
}
}
import org.gradle.plugins.ide.eclipse.model.AbstractClasspathEntry
import org.gradle.plugins.ide.eclipse.model.AccessRule
import org.gradle.plugins.ide.eclipse.model.ClasspathEntry
import java.util.regex.Matcher
//noinspection GroovyAssignabilityCheck
group 'org.zowe.apiml'
apply plugin: 'java-library'
apply from: 'gradle/license.gradle'
apply from: 'gradle/publish.gradle'
apply from: 'gradle/sonar.gradle'
apply from: 'gradle/coverage.gradle'
apply from: 'gradle/code-quality.gradle'
apply from: 'gradle/lite.gradle'
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
allprojects {
apply plugin: 'idea'
apply plugin: 'org.cadixdev.licenser'
apply plugin: 'eclipse'
repositories mavenRepositories
version = version
eclipse {
classpath {
file {
whenMerged { classpath ->
for (ClasspathEntry entry : classpath.getEntries()) {
if (entry instanceof AbstractClasspathEntry) {
AbstractClasspathEntry theEntry = (AbstractClasspathEntry) entry
if (theEntry.path != null && theEntry.path.contains('org.eclipse.jdt.launching.JRE_CONTAINER')) {
theEntry.accessRules.add(new AccessRule('accessible', 'com/sun/net/httpserver/**'))
}
}
}
}
}
downloadJavadoc = true
downloadSources = true
}
}
idea {
module {
//noinspection GroovyAssignabilityCheck
outputDir file('build/classes/main')
//noinspection GroovyAssignabilityCheck
testOutputDir file('build/classes/test')
downloadJavadoc = true
downloadSources = true
}
}
configurations.all {
resolutionStrategy.dependencySubstitution {
substitute(module('javax.servlet:servlet-api')).using(module('javax.servlet:javax.servlet-api:4.0.1'))
}
}
}
configure(subprojects.findAll { it.name in [
'apiml-common-lib-package',
'api-catalog-services',
'caching-service',
'discovery-service',
'gateway-service',
'zaas-service'
]}) {
configurations.all {
// it has been replaced by spring-jcl
exclude group: "commons-logging", module: "commons-logging"
}
}
configure(subprojects.findAll {it.name != 'platform'}) {
apply plugin: 'java-library'
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
test {
useJUnitPlatform()
jvmArgs '--add-opens=java.base/java.nio.channels.spi=ALL-UNNAMED'
jvmArgs '--add-opens=java.base/sun.nio.ch=ALL-UNNAMED'
jvmArgs '--add-opens=java.base/java.io=ALL-UNNAMED'
jvmArgs '--add-opens=java.base/java.util=ALL-UNNAMED'
jvmArgs '--add-opens=java.base/java.util.concurrent=ALL-UNNAMED'
jvmArgs '--add-opens=java.base/java.lang=ALL-UNNAMED'
jvmArgs '--add-opens=java.base/java.lang.invoke=ALL-UNNAMED'
jvmArgs '--add-opens=java.base/java.lang.reflect=ALL-UNNAMED'
jvmArgs '--add-opens=java.base/javax.net.ssl=ALL-UNNAMED'
jvmArgs '--add-opens=java.base/java.net=ALL-UNNAMED'
}
dependencies {
api(platform(project(":platform")))
testImplementation libs.junit.jupiter
testImplementation libs.junit.platform.launcher
//For Idea
testImplementation libs.junit.platform.commons
testImplementation libs.junit.platform.engine
}
}
subprojects {
license {
header = rootProject.file('.licence/EPL-2.0-licence-header.txt')
exclude '**/*.yml', '**/*.yaml', '**/*.json', '**/static', '**/*.sh', '**/*.txt', '**/*.p12', '**/*.xml', '**/*.jsp', '**/*.html', '**/*.jks', '**/*.properties'
}
tasks.withType(Test) {
maxParallelForks = 1
}
}
task buildCore(dependsOn: [':discovery-service:build', ':api-catalog-services:build', ':api-catalog-ui:build',
':discoverable-client:build', ':zaas-client:build', ':apiml-sample-extension:build', ':gateway-service:build']) {
description "Build core components"
group "build"
}
task runAllIntegrationTests(dependsOn: ":integration-tests:runAllIntegrationTests") {
description "Run all integration tests"
group "Integration tests"
}
task environmentCheck(dependsOn: ":integration-tests:environmentCheck") {
description "Environment check"
group "Integration tests"
}
task runCITests(dependsOn: [":integration-tests:runCITests"]) {
description "Run Integration Test Without MF Dependencies"
group "Integration tests"
}
task runStartUpCheck(dependsOn: [":integration-tests:runStartUpCheck"]) {
description "Run Startup check"
group "Integration tests"
}
task runContainerTests(dependsOn: [":integration-tests:runContainerTests"]) {
description "Run Integration Test Without MF Dependencies"
group "Integration tests"
}
task runRegistrationTests(dependsOn: [":integration-tests:runRegistrationTests"]) {
description "Run Integration Test verifying registration and deregistration"
group "Integration tests"
}
task runGatewayProxyTest(dependsOn: [":integration-tests:runGatewayProxyTest"]) {
description "Run tests verifying central gateway can route to correct gateway"
group "Integration tests"
}
task runGatewayServiceRoutingTest(dependsOn: [":integration-tests:runGatewayServiceRoutingTest"]) {
description "Run tests verifying gateway can locate service and translate auth scheme"
group "Integration tests"
}
task runOidcTests(dependsOn: [":integration-tests:runOidcTests"]) {
description "Run tests verifying integration with oidc provider(okta)"
group "Integration tests"
}
task runIdPrefixReplacerTests(dependsOn: [":integration-tests:runIdPrefixReplacerTests"]) {
description "Run Integration Test verifying the service ID prefix replacer mechanism"
group "Integration tests"
}
task publishAllVersions {
group 'Zowe Publishing'
description 'Publish ZIP file and SDK libraries to Zowe Artifactory'
doLast {
println 'Published ZIP file and libraries'
}
}
task nodejsClean(type: Delete) {
group = 'npm'
if (cleanNode == 'true') {
delete 'api-catalog-ui/tools/nodejs', 'api-catalog-ui/tools/npm', 'api-catalog-ui/tools/yarn'
delete 'onboarding-enabler-nodejs-sample-app/tools/nodejs', 'onboarding-enabler-nodejs-sample-app/tools/npm', 'onboarding-enabler-nodejs-sample-app/tools/yarn'
}
}
task runBaseTests(dependsOn: ":integration-tests:runBaseTests") {
description "Run base tests"
group "Integration tests"
}
task runZosmfAuthTest(dependsOn: ":integration-tests:runZosmfAuthTest") {
description "Run zOSMF dependant authentication tests only"
group "Integration tests"
}
task runZaasTest(dependsOn: ":integration-tests:runZaasTest") {
description "Run Zaas dependant authentication tests only"
group "Integration tests"
}
task runCachingServiceTests(dependsOn: ":integration-tests:runCachingServiceTests") {
description "Run caching service tests"
group "Integration tests"
}
task runInfinispanServiceTests(dependsOn: ":integration-tests:runInfinispanServiceTests") {
description "Run tests for caching service with infinispan storage option"
group "Integration tests"
}
task runHATests(dependsOn: ":integration-tests:runHATests") {
description "Run HA tests only"
group "Integration tests"
}
task runChaoticHATests(dependsOn: ":integration-tests:runChaoticHATests") {
description "Run Chaotic HA tests tests only"
group "Integration tests"
}
clean.dependsOn nodejsClean
publishAllVersions.dependsOn publishSdkArtifacts
//-----------Release part start
apply plugin: 'net.researchgate.release'
ext.releaseScope = project.hasProperty('release.scope') ? project.getProperty('release.scope') : 'patch'
release {
failOnCommitNeeded = true
failOnPublishNeeded = true
failOnSnapshotDependencies = true
failOnUnversionedFiles = false
failOnUpdateNeeded = true
revertOnFail = true
preCommitText = '[Gradle Release plugin]'
preTagCommitMessage = '[skip ci] Before tag commit'
tagCommitMessage = 'Release:'
tagTemplate = 'v${version}'
newVersionCommitMessage = 'Create new version:'
versionPropertyFile = 'gradle.properties'
if (releaseScope == 'minor') {
versionPatterns = [
/[.]*\.(\d+)\.(\d+)[.]*/: { Matcher m, Project p -> m.replaceAll(".${(m[0][1] as int) + 1}.0") }
]
} else if (releaseScope == 'major') {
versionPatterns = [
/(\d+)\.(\d+)\.(\d+)[.]*/: { Matcher m, Project p -> m.replaceAll("${(m[0][1] as int) + 1}.0.0") }
]
} else {
versionPatterns = [
/(\d+)([^\d]*$)/: { Matcher m, Project p -> m.replaceAll("${(m[0][1] as int) + 1}${m[0][2]}") }
]
}
scmAdapters = [
net.researchgate.release.GitAdapter
]
git {
requireBranch.set('')
pushToRemote.set('origin')
pushToBranchPrefix.set('')
commitVersionFileOnly.set(true)
signTag.set(false)
}
}
afterReleaseBuild.dependsOn publishAllVersions
//-----------Release part end
if (hasProperty('buildScan')) {
buildScan {
termsOfServiceUrl = 'https://gradle.com/terms-of-service'
termsOfServiceAgree = 'yes'
}
}