Update Gradle build to use the Kotlin DSL
Fix gh-33
This commit is contained in:
55
build.gradle.kts
Normal file
55
build.gradle.kts
Normal file
@@ -0,0 +1,55 @@
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
|
||||
plugins {
|
||||
kotlin("plugin.jpa") version "1.2.71"
|
||||
id("org.springframework.boot") version "2.1.5.RELEASE"
|
||||
id("io.spring.dependency-management") version "1.0.7.RELEASE"
|
||||
kotlin("jvm") version "1.2.71"
|
||||
kotlin("plugin.spring") version "1.2.71"
|
||||
kotlin("plugin.allopen") version "1.2.71"
|
||||
kotlin("kapt") version "1.2.71"
|
||||
}
|
||||
|
||||
group = "com.example"
|
||||
version = "0.0.1-SNAPSHOT"
|
||||
java.sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
|
||||
implementation("org.springframework.boot:spring-boot-starter-mustache")
|
||||
implementation("org.springframework.boot:spring-boot-starter-web")
|
||||
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
|
||||
implementation("org.jetbrains.kotlin:kotlin-reflect")
|
||||
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
|
||||
runtimeOnly("com.h2database:h2:1.4.197") // Fixed version as a workaround for https://github.com/h2database/h2database/issues/1841
|
||||
runtimeOnly("org.springframework.boot:spring-boot-devtools")
|
||||
kapt("org.springframework.boot:spring-boot-configuration-processor")
|
||||
testImplementation("org.springframework.boot:spring-boot-starter-test") {
|
||||
exclude(module = "junit")
|
||||
exclude(module = "mockito-core")
|
||||
}
|
||||
testImplementation("org.junit.jupiter:junit-jupiter-api")
|
||||
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
|
||||
testImplementation("com.ninja-squad:springmockk:1.1.2")
|
||||
}
|
||||
|
||||
tasks.withType<KotlinCompile> {
|
||||
kotlinOptions {
|
||||
freeCompilerArgs = listOf("-Xjsr305=strict")
|
||||
jvmTarget = "1.8"
|
||||
}
|
||||
}
|
||||
|
||||
allOpen {
|
||||
annotation("javax.persistence.Entity")
|
||||
annotation("javax.persistence.Embeddable")
|
||||
annotation("javax.persistence.MappedSuperclass")
|
||||
}
|
||||
|
||||
tasks.withType<Test> {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
Reference in New Issue
Block a user