Expand properties issue with Gradle-Kotlin DSL

Hi,

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.

Ex:
tasks.processResources {
expand(project.properties)
}

//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.

project.dir=${project.projectDir}

scripts project directory

project.scripts.dir=${project.dir}/…/scripts

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