Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to read a dotted Gradle property in Kotlin DSL?

I can read from gradle.properties with val myProperty by settings, and that's nice! But what if the property name contains dots? Consider the next gradle.properties file:

kotlin.incremental=true
kotlin.incremental.js=true
kotlin.incremental.multiplatform=true

How can I read those properties above in a settings.gradle.kts script?

like image 564
sedovav Avatar asked Apr 22 '19 18:04

sedovav


1 Answers

Here is what I found:

val myProperty: Boolean 
    get() = settings.extra["kotlin.incremental"]?.toString()?.toBoolean() ?: false
like image 107
sedovav Avatar answered Sep 20 '22 15:09

sedovav