Groovy in apply from: scripts


(ambcloses) #1

If I do

println '${project.projectDir}'

in my build.gradle file, I get the replaced output (i.e. /home/user/project) as intended. However, If I have in my build.gradle file:

apply from: 'myFile.gradle'

and then in myFile.gradle if I have:

println '${project.projectDir}'

I get “${project.projectDir}” as the output string (which is a bit scary that I got that). Can someone tell me how I might get the original Groovy-like behavior when I use apply from?


(Peter Niederwieser) #2

Groovy only supports String interpolation for double-quoted String literals.