Thread
#build-tools
    d

    dharrigan

    4 years ago
    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?
    czyzby

    czyzby

    4 years ago
    #gradle
    d

    dharrigan

    4 years ago
    ta
    czyzby

    czyzby

    4 years ago
    Anyway, using vals 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")