我创建了一个versions.gradle.kts
这样的:
object Defines {
const val kotlinVersion = "1.2.61"
const val junitVersion = "5.3.0"
}
现在我想像这样导入和使用这些文件:
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
group = "io.github.deglans"
version = "0.0.1-SNAPSHOT"
plugins {
application
kotlin("jvm") version Defines.kotlinVersion
}
application {
mainClassName = "io.github.deglans.polishnotation.MainKt"
}
dependencies {
compile(kotlin("stdlib-jdk8"))
testCompile("org.junit.jupiter", "junit-jupiter-api", Defines.junitVersion)
testRuntime("org.junit.jupiter", "junit-jupiter-engine", Defines.junitVersion)
}
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
}
我怎样才能做到这一点?
注意:我已经看过这篇文章,但并不完全是我搜索的......