-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.gradle
199 lines (168 loc) · 6.17 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
/*
* *******************************************************************************
* Copyright (c) 2024 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Apache License, Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* SPDX-License-Identifier: Apache-2.0
* ******************************************************************************
*/
plugins {
id 'java'
id 'org.springframework.boot' version "${springBootVersion}"
id 'io.spring.dependency-management' version "${springDependencyVersion}"
id "de.undercouch.download" version "5.6.0"
id 'project-report'
id "jacoco"
id "org.sonarqube" version "5.1.0.4882"
}
group = "${group}"
version = "${version}"
java {
sourceCompatibility = JavaVersion.VERSION_21
}
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
//Spring
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.cloud:spring-cloud-starter-openfeign:4.1.3'
//swagger
implementation "org.springdoc:springdoc-openapi-starter-common:${openApiVersion}"
implementation "org.springdoc:springdoc-openapi-starter-webmvc-ui:${openApiVersion}"
//utils
implementation 'org.apache.commons:commons-lang3:3.15.0'
implementation("org.apache.commons:commons-text:1.12.0")
//Edc
implementation "org.eclipse.edc:crypto-common-lib:${edcLibVersion}"
implementation "org.eclipse.edc:identity-trust-sts-api:${edcLibVersion}"
implementation "org.eclipse.edc:verifiable-credentials-api:${edcLibVersion}"
//keycloak
implementation 'org.keycloak:keycloak-admin-client:25.0.2'
compileOnly 'org.projectlombok:lombok'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
testCompileOnly 'org.projectlombok:lombok'
testAnnotationProcessor 'org.projectlombok:lombok'
testImplementation group: 'com.github.curious-odd-man', name: 'rgxgen', version: '2.0'
// added for test cases to support patch method
testImplementation 'org.apache.httpcomponents.client5:httpclient5:5.3.1'
}
test {
useJUnitPlatform()
finalizedBy jacocoTestReport
testLogging {
events("passed", "skipped", "failed")
}
}
jacoco {
toolVersion = "${jacocoVersion}"
}
jacocoTestReport {
reports {
xml.required = true
csv.required = false
html.required = true
}
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
fileTree(dir: it, exclude: [
"org/eclipse/tractusx/wallet/stub/apidoc/*"
])
}))
}
}
jacocoTestCoverageVerification {
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
fileTree(dir: it, exclude: [
"org/eclipse/tractusx/wallet/stub/apidoc/*"
])
}))
}
violationRules {
rule {
limit {
minimum = 0.80
}
}
}
}
check.dependsOn jacocoTestCoverageVerification
build {
archivesBaseName = "wallet"
version = "latest"
}
tasks.register('dashDownload', Download) {
description = 'Download the Dash License Tool standalone jar'
group = 'License'
src 'https://repo.eclipse.org/service/local/artifact/maven/redirect?r=dash-licenses&g=org.eclipse.dash&a=org.eclipse.dash.licenses&v=LATEST'
dest layout.projectDirectory.file('dash.jar')
// will not replace an existing file. If you know you need a new version
// then manually delete the file yourself, or run `dashClean`
overwrite false
}
tasks.register('dashClean') {
description = "Clean all files used by the 'License' group"
group = 'License'
logger.lifecycle("Removing 'dash.jar'")
file('dash.jar').delete()
logger.lifecycle("Removing 'deps.txt'")
file('deps.txt').delete()
}
tasks.register('dashDependencies') { dashDependencies ->
description = "Output all project dependencies as a flat list and save an intermediate file 'deps.txt'."
group = 'License'
dashDependencies.dependsOn('dashDownload')
doLast {
def deps = []
project.configurations.each { conf ->
if (conf.canBeResolved && conf.getName() != 'archives' && conf.getName() != 'default') {
deps.addAll(conf.incoming.resolutionResult.allDependencies
.findAll({ it instanceof ResolvedDependencyResult })
.collect { ResolvedDependencyResult dep ->
"${dep.selected}"
})
}
}
def uniqueSorted = deps.unique().sort()
uniqueSorted.each { logger.quiet("{}", it) }
file("deps.txt").write(uniqueSorted.join('\n'))
}
}
tasks.register('dashLicenseCheck', JavaExec) { dashLicenseCheck ->
description = "Run the Dash License Tool and save the summary in the 'DEPENDENCIES' file"
group = 'License'
dashLicenseCheck.dependsOn('dashDownload')
dashLicenseCheck.dependsOn('dashDependencies')
doFirst {
classpath = files('dash.jar')
// docs: https://eclipse-tractusx.github.io/docs/release/trg-7/trg-7-04
args('-project', 'automotive.tractusx', '-summary', 'DEPENDENCIES', 'deps.txt')
}
doLast {
logger.lifecycle("Removing 'deps.txt' now.")
file('deps.txt').delete()
}
}