https://kotlinlang.org logo
d

dharrigan

12/05/2017, 1:21 PM
Hey, with gradle kotlin scripts, one of the things that I find a bit toooo noisy compared to plain groovy gradle scripts, is the necessity to put in
${property("foo")}
inside dependencies definitions, i.e.,
compile("com.google.protobuf:protobuf-java:${property("protobufVersion")}")
I know there is another way of defining the var inside the kts file,
var foo="1.2"
then using
$foo
inside the dependency definition. The latter being more "groovy" like (without the var definition). Is there no shorter way of expressing this?
c

czyzby

12/05/2017, 1:22 PM
#gradle
d

dharrigan

12/05/2017, 1:22 PM
ta
c

czyzby

12/05/2017, 1:23 PM
Anyway, using `val`s seems the best for now. Unless something changed since I tried Gradle+Kotlin.
You can also make a less verbose utility function like
prop("nameOfProperty")