Putting single quote(' ') around dependencies while calling extra properties gives error "Illegal entry in Gradle Dependencies"

Hi,

==============================================================================

I have defined an extra property called hibernateVersion like below and trying to use this in my dependencies.

buildscript {
ext {
hibernateVersion = ‘5.1.3.Final’
}
}

when i define my dependency with group, name and version(being called from ext property) sorrunded with double quote, as shown below, it works great.
dependencies{
compile(“org.hibernate:hibernate-validator:${hibernateVersion}”)
}

However, when I declare the same with single quote like
dependencies{
compile(‘org.hibernate:hibernate-validator:${hibernateVersion}’)
}

Illegal entry in Gradle Dependencies: /home/imteyaza/Desktop/eclipse/unresolved dependency - org.hibernate hibernate-validator ${hibernateVersion} Test-persistence Unknown org.springsource.ide.eclipse.gradle.core.classpathcontainer

==============================================================================

My question is “is it an expected behaviour ?”.

thats a Groovy language feature: variable replacement requires double quotes.
see e.g. http://stackoverflow.com/questions/6761498/whats-the-difference-of-strings-within-single-or-double-quotes-in-groovy

Thanks David for the clarification :smile: