Make the plugin compatible with Gradle 1.x

- Update the code to be compatible with Gradle 1.x, while remaining
  compatible with 2.0.
- Make it possible to test the plugin against Gradle 1.x and Gradle 2.0.
  Gradle 2.0 uses Groovy 2.3.x, whereas Gradle 1.x uses Groovy 1.8.x.
  Different versions of Spock are required for the different versions
  of Groovy. The Spock version has been parameterised, allowing it to
  be specified on the command line when the build’s being run with
  Gradle 2.0.