-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
126 lines (106 loc) · 3.62 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
120
121
122
123
124
125
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id("org.springframework.boot") version "3.2.2"
id("io.spring.dependency-management") version "1.1.4"
kotlin("jvm") version "1.9.22"
kotlin("plugin.spring") version "1.9.22"
kotlin("plugin.jpa") version "1.9.22"
kotlin("kapt") version "1.9.22"
id("com.diffplug.spotless") version "6.12.0"
id ("org.flywaydb.flyway") version "7.7.0"
id("jacoco")
id("idea")
id("java")
}
group = "io.rafaelribeiro"
java.sourceCompatibility = JavaVersion.VERSION_17
java.targetCompatibility = JavaVersion.VERSION_17
repositories {
mavenCentral()
}
dependencies {
// -- Kotlin
implementation("org.jetbrains.kotlin:kotlin-reflect")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
// -- Spring
kapt("org.springframework.boot:spring-boot-configuration-processor")
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
implementation("org.springframework.boot:spring-boot-starter-cache")
implementation("org.springframework.boot:spring-boot-starter-security")
implementation("org.springframework.boot:spring-boot-starter-actuator")
implementation("org.springframework.boot:spring-boot-starter-graphql")
developmentOnly("org.springframework.boot:spring-boot-devtools")
// -- Others
implementation("jakarta.xml.bind:jakarta.xml.bind-api:4.0.0")
implementation("org.springdoc:springdoc-openapi-ui:1.7.0")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
implementation("javax.validation:validation-api:2.0.1.Final")
implementation("me.paulschwarz:spring-dotenv:3.0.0")
// -- JWT
implementation("io.jsonwebtoken:jjwt-api:0.11.5")
runtimeOnly("io.jsonwebtoken:jjwt-impl:0.12.5")
runtimeOnly("io.jsonwebtoken:jjwt-jackson:0.12.5")
// -- Tracing
implementation("com.datadoghq:dd-trace-api:1.29.0")
implementation("io.opentracing:opentracing-api:0.33.0")
implementation("io.opentracing:opentracing-util:0.33.0")
// -- Database
runtimeOnly("org.flywaydb:flyway-core")
runtimeOnly("org.postgresql:postgresql")
runtimeOnly("com.h2database:h2")
implementation("org.hibernate:hibernate-jpamodelgen:6.4.4.Final")
implementation("org.hibernate:hibernate-validator:8.0.0.Final")
// -- Support for different file types
implementation("com.openhtmltopdf:openhtmltopdf-pdfbox:1.0.10")
implementation("org.jsoup:jsoup:1.17.2")
// -- Testing
testImplementation("io.rest-assured:rest-assured")
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("org.springframework.graphql:spring-graphql-test")
testImplementation("io.mockk:mockk:1.13.9")
testImplementation("com.ninja-squad:springmockk:4.0.2")
}
tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs = listOf("-Xjsr305=strict")
jvmTarget = "17"
}
}
tasks.withType<Test> {
useJUnitPlatform()
}
jacoco {
toolVersion = "0.8.7"
}
tasks.jacocoTestReport {
group = "Reporting"
reports {
xml.required.set(true)
csv.required.set(false)
html.required.set(false)
}
}
tasks.register("jacocoFixForCodeClimate", Copy::class.java) {
from("build/reports/jacoco/test/jacocoTestReport.xml")
into("build/reports/jacoco/test/")
filter { line ->
line.replace("io/rafaelribeiro/", "src/main/kotlin/io/rafaelribeiro/")
}
rename { fileName ->
fileName.replace("jacocoTestReport.xml", "jacoco.xml")
}
}
spotless {
format("misc") {
target(".gitignore", "*.md", "*.yml", "*.properties")
trimTrailingWhitespace()
indentWithSpaces()
endWithNewline()
}
kotlin {
ktlint("0.43.2").userData(mapOf("disabled_rules" to "no-wildcard-imports"))
trimTrailingWhitespace()
endWithNewline()
}
}