2021-05-18 10:39:20 +07:00
|
|
|
import java.io.ByteArrayOutputStream
|
|
|
|
|
|
|
|
plugins {
|
|
|
|
id("org.springframework.boot")
|
|
|
|
id("io.spring.dependency-management")
|
|
|
|
kotlin("jvm")
|
|
|
|
kotlin("plugin.spring")
|
2022-04-11 12:35:47 +07:00
|
|
|
kotlin("plugin.jpa")
|
2021-05-18 10:39:20 +07:00
|
|
|
}
|
|
|
|
|
2022-12-05 20:45:16 +07:00
|
|
|
val kotlinVersion = "1.7.22"
|
|
|
|
val springBootVersion = "3.0.0"
|
2021-05-18 10:39:20 +07:00
|
|
|
|
|
|
|
// find the last commit
|
|
|
|
fun getGitHashLastCommit(): String {
|
|
|
|
val stdout = ByteArrayOutputStream()
|
|
|
|
exec {
|
|
|
|
commandLine("git", "rev-parse", "HEAD")
|
|
|
|
standardOutput = stdout
|
|
|
|
}
|
|
|
|
|
|
|
|
return stdout.toString().trim()
|
|
|
|
}
|
|
|
|
|
|
|
|
springBoot {
|
|
|
|
buildInfo {
|
|
|
|
properties {
|
2022-12-05 20:45:16 +07:00
|
|
|
this.additional.put("commitId", getGitHashLastCommit())
|
|
|
|
this.additional.put("springBootVersion", springBootVersion)
|
|
|
|
this.additional.put("kotlinVersion", kotlinVersion)
|
2021-05-18 10:39:20 +07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2022-04-11 12:35:47 +07:00
|
|
|
// Spring Data JPA (Required for Database Layer)
|
|
|
|
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
|
|
|
|
implementation("org.springframework.boot:spring-boot-starter-data-redis")
|
2022-12-05 20:45:16 +07:00
|
|
|
implementation("org.springframework.boot:spring-boot-starter-validation")
|
2022-04-11 12:35:47 +07:00
|
|
|
|
2022-12-05 20:45:16 +07:00
|
|
|
// Migrating from SpringDoc API (Swagger) for Support Spring Boot 3.x
|
|
|
|
implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.0")
|
2021-05-18 10:39:20 +07:00
|
|
|
|
|
|
|
// SPRING FRAMEWORK AND CORE
|
|
|
|
implementation("org.springframework.boot:spring-boot-starter-web")
|
|
|
|
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
|
|
|
|
|
|
|
|
// Development Runtime
|
|
|
|
developmentOnly("org.springframework.boot:spring-boot-devtools")
|
|
|
|
|
|
|
|
implementation("org.jetbrains.kotlin:kotlin-reflect")
|
|
|
|
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
|
2022-04-11 12:35:47 +07:00
|
|
|
|
|
|
|
runtimeOnly("com.h2database:h2")
|
2022-06-13 19:50:22 +07:00
|
|
|
// runtimeOnly("org.postgresql:postgresql")
|
2022-04-11 12:35:47 +07:00
|
|
|
|
2021-05-18 10:39:20 +07:00
|
|
|
testImplementation("org.springframework.boot:spring-boot-starter-test")
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.withType<Test> {
|
|
|
|
useJUnitPlatform()
|
|
|
|
}
|