Build Files - pford68/gradle-examples GitHub Wiki

buildScript

The buildScript block is used to configure and to fetch 3pty dependencies needed by the build script, but not by the project being compiled: e.g., 3pty Gradle plugins. It has a repositories block for specifying the repositories from which to fetch the plugins, and a dependencies block to add the plugins/dependencies to, say, the classpath.

References

  • http://stackoverflow.com/questions/17773817/purpose-of-buildscript-in-gradle

    Putting [a dependency] in the buildscript closure ensures that the dependencies are available to be used within the gradle build script itself. Not the output program.

  • http://stackoverflow.com/questions/13923766/gradle-buildscript-dependencies

    The repositories in the buildScript block are used to fetch the dependencies of your buildScript dependencies. These are the dependencies that are put on the classpath of your build and that you can refer to from your build file. For instance extra plugins that exist on the internet. The repositories on the root level are used to fetch the dependencies that your project depends on. So all the dependencies you need to compile your project.