generated from telekom/reuse-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
88 lines (74 loc) · 2.47 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
// Copyright 2024 Deutsche Telekom IT GmbH
//
// SPDX-License-Identifier: Apache-2.0
plugins {
id 'org.springframework.boot' version '3.2.3'
id 'io.spring.dependency-management' version '1.1.4'
id 'java'
id "jacoco"
}
def getVersion() {
def version = "0.0.0"
def gitBranch = "develop"
try {
def workingDir = new File("${project.projectDir}")
def result = 'git rev-parse --abbrev-ref HEAD'.execute(null, workingDir)
result.waitFor()
if (result.exitValue() == 0) {
gitBranch = result.text.trim().replace("/", "-")
}
} catch (ignored) {}
if (System.getenv('CI_COMMIT_TAG')) {
version = System.getenv('CI_COMMIT_TAG')
} else if (System.getenv('CI_COMMIT_REF_SLUG')) {
version += ("-" + System.getenv('CI_COMMIT_REF_SLUG'))
} else {
version += ("-" + gitBranch)
}
return version
}
group = 'de.telekom.horizon'
version = getVersion()
repositories {
mavenCentral()
}
dependencies {
//Spring
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-oauth2-client'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.kafka:spring-kafka'
implementation 'org.springframework.boot:spring-boot-starter-data-mongodb'
implementation 'org.springframework.boot:spring-boot-starter-oauth2-resource-server'
implementation 'org.springframework.boot:spring-boot-starter-security'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.kafka:spring-kafka-test'
testImplementation 'org.springframework.security:spring-security-test'
testImplementation "de.bwaldvogel:mongo-java-server:1.44.0"
//3rd party
annotationProcessor "org.projectlombok:lombok"
compileOnly "org.projectlombok:lombok"
testCompileOnly "org.projectlombok:lombok"
testAnnotationProcessor "org.projectlombok:lombok"
// ENI
implementation "de.telekom.eni:horizon-spring-boot-starter:${horizonParentVersion}"
}
java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
test {
useJUnitPlatform()
finalizedBy jacocoTestReport
}
jacocoTestReport {
dependsOn test
reports {
xml.required = true
csv.required = true
html.required = true
}
}
bootJar {
archiveFileName.set("${project.name}.jar")
}