I hope this is the right place to post this
I am totally new to gradle and was going through the gradle guide (Creating Multi-project Builds) from @Schalk_Cronje .
I ran into a problem which at first confused the heck out of me as someone who has never used Gradle or Groovy before. So I thought I would mention it here in case Schalk wants to add a hint to his guide
Following the documentation on my Windows machine I set up the GreetingFormatter/Greeter#main (Java) and the GreeterSpec (Groovy). The specification test kept blowing up on me on the simple string test-comparison:
class GreeterSpec extends Specification {
def 'Calling the entry point'() {
...
then: 'The correct greeting is output'
buf.toString() == "Hello, Gradlephant\n"
}
}
When the test failed and I compared the result with the expected I noticed that a CRLF linefeed was making the difference.
Java was using the System.lineSeparator Property from Windows (CRLF) and Groovy was just using the โ\nโ (not โ\r\nโ) in the test-string literal which lead to the two strings being unequal. I assume if this guide was followed on a Unix-Variant there would be no problem.
To get it to work I had to make one small change and add a โ.denormalize()โ to the Groovy String literal.
then: 'The correct greeting is output'
buf.toString() == 'Hello, Gradlephant\n'.denormalize()
Once I did that the specification test ran through.