Groovy string from gradle properties file behaving not as intended

Viewed 588

I am trying to publish a Java library to Bintray and encountered a weird behavior of strings that i get from the gradle.properties file.

Content of properties file:

testString = 'test'

My task for testing the string behavior:

task weirdString {
    println(testString)
    println('test')
    println(testString.class)
    println('test'.class)
    println(testString.equals('test'))
}

Running the task outputs:

'test'
test
class java.lang.String
class java.lang.String
false

I can't wrap my head around this. The difference between the first and the second output makes my deployment task crash. I guess this is some internal Groovy magic. Can someone enlighten me?

1 Answers
Related