If I need to get kotlin_version value in `build.gr...
# gradle
w
If I need to get kotlin_version value in
build.gradle.kts
from
gradle.properties
file, I can get the value by
Copy code
val kotlin_version: String = property("kotlin_version").toString()
but can’t by
Copy code
val kotlin_version: String by properties
. WHY?😂 , Anybody could tell me?
m
i think i reported an issue for that, but it is... kinda weird i think
Copy code
val kotlin_version: String by project
is what you are supposed to use
i can't find an issue for it, maybe it will be best if you open it?
w
@mkobit Yeah! that’s works, but why
by properties
doesn’t work? any reason or reference material?
Ha.. so, May be a bug?
m
probably. i would expect
by properties
to behave similarly
j
I always preferred to have everything in buildSrc rather than properties so it's reusable in many projects
😮 1
@wuseal an example of a template I'm maintaining for my own sanity when creating a new project: https://github.com/jdiazcano/base-kotlin-project
👍 1
w
@jdiaz I have saw that, It looks like a great way to config project, TKS, I’ll try it😀