Marcel Overdijk
12/14/2017, 5:31 PMbuild.gradle
I typically define (reusable) ext properties in my build scripts like:
buildscript {
ext {
javaVersion = "1.8"
kotlinVersion = "1.2.0"
springBootVesion = "2.0.0.M7"
querydslVersion = "4.1.4"
querydslGradlePluginVersion = "1.0.8"
}
And the I can refer to these properties when declaring plugins and dependencies.
What is the proper way to this within Kotlin DSL?bamboo
12/14/2017, 5:34 PMext
properties in Kotlin, a better approach for constants might be having something like the following in `buildSrc/src/main/kotlin/Libs.kt`:
kotlin
object Libs {
val javaVersion = “1.8”
...
}
Libs.<...>
Marcel Overdijk
12/14/2017, 6:05 PMbamboo
12/14/2017, 6:06 PMCzar
12/15/2017, 7:50 AM:buildSrc:compileJava NO-SOURCE
:buildSrc:compileGroovy NO-SOURCE
:buildSrc:processResources NO-SOURCE
:buildSrc:classes UP-TO-DATE
:buildSrc:jar UP-TO-DATE
:buildSrc:assemble UP-TO-DATE
:buildSrc:compileTestJava NO-SOURCE
:buildSrc:compileTestGroovy NO-SOURCE
:buildSrc:processTestResources NO-SOURCE
:buildSrc:testClasses UP-TO-DATE
:buildSrc:test NO-SOURCE
:buildSrc:check UP-TO-DATE
:buildSrc:build UP-TO-DATE
eskatos
12/15/2017, 9:13 AMkotlin-dsl
plugin in buildSrc/build.gradle.kts
to get the Kotlin compiler setup properlyCzar
12/15/2017, 11:33 AM