generated from leanix/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
119 lines (101 loc) · 3.58 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
import com.expediagroup.graphql.plugin.gradle.tasks.GraphQLGenerateClientTask
plugins {
id("org.springframework.boot") version "3.2.11"
id("io.spring.dependency-management") version "1.1.5"
id("com.expediagroup.graphql") version "7.0.2"
id("io.gitlab.arturbosch.detekt") version "1.23.4"
kotlin("jvm") version "1.9.21"
kotlin("plugin.spring") version "1.9.21"
jacoco
}
group = "net.leanix"
version = "v0.0.2"
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}
repositories {
mavenCentral()
}
extra["springCloudVersion"] = "2023.0.1"
dependencyManagement {
imports {
mavenBom("org.springframework.cloud:spring-cloud-dependencies:${property("springCloudVersion")}")
}
}
dependencies {
implementation("org.springframework.boot:spring-boot-starter")
implementation("org.springframework.boot:spring-boot-starter-actuator")
implementation("org.springframework.boot:spring-boot-starter-cache")
implementation("com.github.ben-manes.caffeine:caffeine:2.8.8")
implementation("org.springframework.cloud:spring-cloud-starter-openfeign")
implementation("org.springframework.boot:spring-boot-starter-websocket")
implementation("io.github.resilience4j:resilience4j-spring-boot3:2.1.0")
implementation("org.jetbrains.kotlin:kotlin-reflect")
implementation("com.fasterxml.jackson.core:jackson-annotations:2.17.1")
implementation("com.expediagroup:graphql-kotlin-spring-client:7.0.2")
developmentOnly("io.netty:netty-resolver-dns-native-macos:4.1.85.Final") {
artifact {
classifier = "osx-aarch_64"
}
}
// Dependencies for generating JWT token
implementation("io.jsonwebtoken:jjwt-impl:0.11.2")
implementation("io.jsonwebtoken:jjwt-jackson:0.11.2")
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("com.ninja-squad:springmockk:4.0.2"){
exclude(module = "mockito-core")
}
}
val generateGitHubGraphQLClient by tasks.creating(GraphQLGenerateClientTask::class) {
packageName.set("net.leanix.githubagent.graphql.data")
schemaFile = file("${project.projectDir}/src/main/resources/schemas/schema.docs-enterprise.graphql")
queryFileDirectory = file("${project.projectDir}/src/main/resources/graphql")
}
configurations.all {
resolutionStrategy {
eachDependency {
when (requested.module.toString()) {
"org.bouncycastle:bcprov-jdk18on" -> useVersion("1.78")
"org.springframework:spring-webflux" -> useVersion("6.1.14")
"io.netty:netty-common" -> useVersion("4.1.115.Final")
"com.google.protobuf:protobuf-java" -> useVersion("4.28.2")
"commons-io:commons-io" -> useVersion("2.14.0")
"io.ktor:ktor-client-core" -> useVersion("3.0.0-rc-2")
}
}
}
}
detekt {
autoCorrect = true
parallel = true
buildUponDefaultConfig = true
dependencies {
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.23.4")
}
}
kotlin {
compilerOptions {
freeCompilerArgs.addAll("-Xjsr305=strict")
}
}
tasks.withType<Test> {
useJUnitPlatform()
}
tasks.test {
useJUnitPlatform()
finalizedBy(tasks.jacocoTestReport)
}
tasks.jacocoTestReport {
dependsOn(tasks.test)
reports {
xml.required.set(true)
xml.outputLocation.set(File("${projectDir}/build/jacocoXml/jacocoTestReport.xml"))
}
}
tasks.processResources {
doLast {
file("build/resources/main/gradle.properties").writeText("version=${project.version}")
}
}