Expand properties issue with Gradle-Kotlin DSL


I am migrating project build from ant to gradle. As part of this I have renamed my build.properties to “gradle.properties”. When I tried to access properties its values are not getting resolved and returning as plain string. I have tried below steps to expand properties but it still didn’t help.

Please let me know if I miss anything here.

tasks.processResources {

//Base Initialize task to initialize the directory structure
tasks.register(“initDist”) {
doLast {
val buildDir = project.properties[“project.dir”]
println("{buildDir}") println(buildDir) mkdir("{buildDir}")

Sample entries from “gradle.properties”:

Project directory.


scripts project directory


I fixed my problem currently by iterating over the project.properties map and replace values of place holders manually using pattern matching.