On Mountain Lion, I’ve tried both Gradle 1.4 and 1.5-rc-1 and cannot successfully execute even the simplest tutorial build. I looked for my error messages in these fora and on Google and have found nothing that helps. For each version, I grabbed a fresh download from http://www.gradle.org/downloads. I unzipped it with tar to silence the useless suggestion that the Mac archive utility doesn’t maintain the correct file permissions. I unset my Java CLASSPATH to prevent any chance of conflicting jars. I deleted the leftover .gradle directory from each previous attempt so that my gradle commands appeared to be the very first one ever. I’m at a loss. Here’s my console
[kaffn8ed ~]$ echo $CLASSPATH [kaffn8ed ~]$ cat build.gradle task hello {
doLast {
println ‘Hello, World!’
} }
[kaffn8ed ~]$ /Users/kaffn8ed/Downloads/gradle-1.5-rc-1/bin/gradle hello
FAILURE: Build failed with an exception.
-
Where: Build file ‘/Users/kaffn8ed/build.gradle’ line: 1
-
What went wrong: A problem occurred evaluating root project ‘kaffn8ed’. > Could not find property ‘task’ on root project ‘kaffn8ed’.
-
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 2.771 secs [kaffn8ed ~]$ cd other [kaffn8ed ~/other]$ cat build.gradle task hello << {
println ‘Hello, World!’ }
[kaffn8ed ~/other]$ /Users/kaffn8ed/Downloads/gradle-1.5-rc-1/bin/gradle hello
If there’s any help out there, I sure do need it.
FAILURE: Build failed with an exception.
-
Where: Build file ‘/Users/kaffn8ed/other/build.gradle’ line: 1
-
What went wrong: Could not compile build file ‘/Users/kaffn8ed/other/build.gradle’. > startup failed:
build file ‘/Users/kaffn8ed/other/build.gradle’: 1: expecting EOF, found ‘hello’ @ line 1, column 6.
task hello << {
^
1 error
- Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 3.231 secs