GildedRose-Refactoring-Kata/Kotlin/build.gradle.kts
2025-04-14 12:53:22 +01:00

49 lines
1.0 KiB
Plaintext

import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("jvm") version "1.9.10"
application
}
group = "com.gildedrose"
version = "1.0-SNAPSHOT"
repositories {
mavenCentral()
}
dependencies {
implementation(kotlin("stdlib"))
testImplementation(kotlin("test"))
testImplementation("org.junit.jupiter:junit-jupiter:5.12.2")
}
tasks.test {
useJUnitPlatform()
testLogging {
events("passed", "skipped", "failed")
}
}
tasks.register<JavaExec>("texttest") {
description = "Allow you to run text-based approval tests with texttest"
group = JavaBasePlugin.BUILD_TASK_NAME
mainClass.set("com.gildedrose.TexttestFixtureKt")
classpath = sourceSets["test"].runtimeClasspath
args("30")
}
// config JVM target to 1.8 for kotlin compilation tasks
tasks.withType<KotlinCompile>().configureEach {
kotlinOptions.jvmTarget = "1.8"
}
// config java extension to same target version, to avoid build failure on Gradle 8.x
java {
targetCompatibility = JavaVersion.VERSION_1_8
}
application {
mainClass.set("com.gildedrose.TexttestFixtureKt")
}