task norris << { println(“hello john norris”) \ def mojo = new my.company.program.assemble() }
and running it gives C:\Temp\gradle_play>gradle -q norris hello john norris
but if I uncomment the def then I get * What went wrong: Could not compile build file ‘C:\Temp\gradle_play\build.gradle’. > startup failed:
build file ‘C:\Temp\gradle_play\build.gradle’: 1: expecting EOF, found ‘norris’ @ line 1, column 6.
task norris << {
I would have expected that it had no idea how to get my.company.program as the buildscript is not set. But it is complaining about end of file at a line that previously was OK. So it is the def mojo line that is wrong but no idea why.
I have the following code based onthe example in the Gradle 2.0 documentation. Based on the above discussion, I think the problem is the two colons in the loadfile task, however, I do not know of a legitimate way to eliminate these from the example code(?)