I am on page 78 of the gradle userguide: Example 14.5. Configuring arbitrary objects using a script.
I have copied all of the code in the example:
build.gradle
task configure << {
pos = java.text.FieldPosition( ) new 10
// Apply the script
apply from: ‘other.gradle’, to: pos
println pos.beginIndex
println pos.endIndex
}
other.gradle
beginIndex = 1;
endIndex = 5;
Output of gradle -q configure D:\Gradle\ThisAndThat>gradle -q configure
FAILURE: Build failed with an exception.
-
Where: Build file ‘D:\Gradle\ThisAndThat\build.gradle’ line: 1
-
What went wrong:
Could not compile build file ‘D:\Gradle\ThisAndThat\build.gradle’.
startup failed:
build file ‘D:\Gradle\ThisAndThat\build.gradle’: 1: expecting EOF, found ‘configure’ @ line 1, column 6.
task configure << {
^
1 error
I cannot figure out why I am getting this error. Any help would be appreciated. Thanks!