-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
95 lines (84 loc) · 3.71 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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.springframework.boot.gradle.tasks.bundling.BootBuildImage
plugins {
id("org.springframework.boot")
id("io.spring.dependency-management")
kotlin("jvm")
kotlin("kapt")
kotlin("plugin.spring")
}
group = "com.ngenenius.api"
java.sourceCompatibility = JavaVersion.VERSION_17
val springBootVersion: String by project
val springCloudVersion: String by project
val kotlinVersion: String by project
val kotlinLogging: String by project
val caffeineVersion: String by project
val springdocVersion: String by project
val mockitoKotlinVersion: String by project
val assertJVersion: String by project
repositories {
mavenCentral()
}
dependencies {
implementation("org.springframework.boot:spring-boot-starter-actuator")
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("org.springframework.boot:spring-boot-starter-webflux")
implementation("org.springframework.boot:spring-boot-starter-security")
implementation("org.springframework.boot:spring-boot-starter-oauth2-client")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
implementation("org.jetbrains.kotlin:kotlin-reflect")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
implementation("io.github.microutils:kotlin-logging-jvm")
implementation("com.github.ben-manes.caffeine:caffeine")
implementation("org.springdoc:springdoc-openapi-ui")
runtimeOnly("org.springframework.boot:spring-boot-devtools")
kapt("org.springframework.boot:spring-boot-configuration-processor")
// literally only here to make IntelliJ happy - magic happens from the 'kapt' one. May not work with @ConstructorBinding?
compileOnly("org.springframework.boot:spring-boot-configuration-processor")
testImplementation("org.springframework.boot:spring-boot-starter-test") {
exclude(group = "org.junit.vintage", module = "junit-vintage-engine")
}
testImplementation("org.mockito:mockito-inline")
testImplementation("org.mockito.kotlin:mockito-kotlin")
testImplementation("com.squareup.okhttp3:mockwebserver")
testImplementation("org.assertj:assertj-core")
}
dependencyManagement {
imports {
mavenBom("org.springframework.boot:spring-boot-dependencies:$springBootVersion") {
bomProperty("kotlin.version", kotlinVersion)
}
mavenBom("org.springframework.cloud:spring-cloud-dependencies:$springCloudVersion")
dependencies {
dependency("io.github.microutils:kotlin-logging-jvm:$kotlinLogging")
dependency("com.github.ben-manes.caffeine:caffeine:$caffeineVersion")
dependency("org.mockito.kotlin:mockito-kotlin:$mockitoKotlinVersion")
dependency("org.assertj:assertj-core:$assertJVersion")
dependency("org.springdoc:springdoc-openapi-ui:$springdocVersion")
dependency("org.apache.logging.log4j:log4j-api:[2.15.0,)")
dependency("org.apache.logging.log4j:log4j-to-slf4j:[2.15.0,)")
}
}
}
tasks.withType<Test> {
useJUnitPlatform()
}
tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs = listOf("-Xjsr305=strict")
jvmTarget = "17"
}
}
tasks.getByName<BootBuildImage>("bootBuildImage") {
imageName = "ngeniusgaming/ngen-api:${project.findProperty("docker.tag") ?: "latest"}"
isPublish = project.hasProperty("docker.publish")
docker {
publishRegistry {
username = project.findProperty("docker.username")?.toString() ?: "user"
password = project.findProperty("docker.password")?.toString() ?: "secret"
url = "https://registry.hub.docker.com/"
email = "[email protected]"
}
}
}