Make sure you have Gradle installed and in your path, so you can run it from command line. Otherwise, you should copy a bootstrapper and the gradle jar into your project.
Use this template build.gradle (for the MC 1.8 unstable branch) for your gradle script: