-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
140 lines (116 loc) · 4.55 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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
plugins {
kotlin("jvm") version "2.0.10"
kotlin("plugin.spring") version "2.0.10"
id("org.springframework.boot") version "3.1.2"
id("io.spring.dependency-management") version "1.1.2"
id("io.gitlab.arturbosch.detekt") version "1.23.7"
id("org.jlleitschuh.gradle.ktlint") version "12.1.1"
}
group = "camilyed.github.io"
version = "1.0-SNAPSHOT"
repositories {
mavenCentral()
maven {
url = uri("https://repo.spring.io/release")
}
maven {
url = uri("https://repo.spring.io/milestone")
}
maven {
url = uri("https://repo.spring.io/snapshot")
}
}
val integrationTest: SourceSet =
sourceSets.create("integrationTest") {
java {
compileClasspath += sourceSets.main.get().output + sourceSets.test.get().output
runtimeClasspath += sourceSets.main.get().output + sourceSets.test.get().output
srcDir("src/integration-test/java")
}
resources.srcDir("src/integration-test/resources")
}
configurations[integrationTest.implementationConfigurationName].extendsFrom(configurations.testImplementation.get())
configurations[integrationTest.runtimeOnlyConfigurationName].extendsFrom(configurations.testRuntimeOnly.get())
dependencyManagement {
imports {
mavenBom("org.springframework.cloud:spring-cloud-dependencies:2022.0.4") // Dodanie BOM dla Spring Cloud
}
}
dependencies {
implementation("io.github.microutils:kotlin-logging-jvm:3.0.5")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.15.2")
implementation("org.jetbrains.exposed:exposed-core:0.55.0")
implementation("org.jetbrains.exposed:exposed-java-time:0.55.0")
implementation("org.jetbrains.exposed:exposed-jdbc:0.55.0")
implementation("javax.servlet:javax.servlet-api:4.0.1")
// Spring Boot dependencies
implementation("org.springframework.boot:spring-boot-starter")
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("org.springframework.boot:spring-boot-starter-validation")
implementation("org.springframework.boot:spring-boot-starter-jdbc")
implementation("io.github.openfeign:feign-jackson:12.4")
implementation("org.springframework.cloud:spring-cloud-starter-openfeign:3.1.2")
implementation("org.postgresql:postgresql:42.3.1")
implementation("org.flywaydb:flyway-core")
// Spring Boot Test
testImplementation("org.springframework.boot:spring-boot-starter-test")
// Test dependencies
testImplementation("org.junit.jupiter:junit-jupiter-api:5.7.0")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.7.0")
testImplementation("io.strikt:strikt-core:0.34.0")
testImplementation("io.strikt:strikt-jackson:0.34.0")
testImplementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.15.2")
// Integration Test dependencies
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("org.wiremock:wiremock:3.9.1")
testImplementation("org.testcontainers:junit-jupiter:1.20.2")
testImplementation("org.testcontainers:testcontainers:1.20.2")
testImplementation("org.springframework.boot:spring-boot-testcontainers")
testImplementation("org.testcontainers:postgresql:1.20.2")
testRuntimeOnly("org.postgresql:postgresql")
}
tasks.test {
useJUnitPlatform()
}
kotlin {
jvmToolchain(21)
}
tasks.withType<Test> {
useJUnitPlatform()
testLogging {
events("passed", "skipped", "failed")
}
}
val integrationTestTask =
tasks.register<Test>("integrationTest") {
group = "verification"
useJUnitPlatform()
testClassesDirs = integrationTest.output.classesDirs
classpath = sourceSets["integrationTest"].runtimeClasspath
shouldRunAfter("test")
}
tasks.check {
dependsOn(integrationTestTask)
}
apply(plugin = "org.jlleitschuh.gradle.ktlint")
apply(plugin = "io.gitlab.arturbosch.detekt")
ktlint {
version.set("0.49.1")
filter {
exclude("**/test/**")
exclude("**/integrationTest/**")
}
}
tasks.wrapper {
gradleVersion = "8.10.2"
distributionType = Wrapper.DistributionType.ALL
}
tasks.register<JavaExec>("runDev") {
group = "application"
description = "Run the application with DevelopmentTimeConfig and 'test' profile"
mainClass.set("camilyed.github.io.currencyexchangeapi.TestCurrencyExchangeApiApplicationKt")
classpath = sourceSets["main"].runtimeClasspath + sourceSets["integrationTest"].runtimeClasspath
args = listOf()
jvmArgs = listOf()
environment("SPRING_PROFILES_ACTIVE", "test")
}