classpath - Purpose of buildScript in Gradle -


i new gradle , reading documentation don't understand parts of it. 1 of these parts connected buildscript block. purpose?

if build script needs use external libraries, can add them script's classpath in build script itself. using buildscript() method, passing in closure declares build script classpath.

buildscript {   repositories {     mavencentral()   }   dependencies {     classpath group: 'commons-codec', name: 'commons-codec', version: '1.2'   } } 

ok difference with:

repositories {   mavencentral() } dependencies {   compile group: 'commons-codec', name: 'commons-codec', version: '1.2' } 

for example, why necessary use buildscript?

the buildscript block determines plugins, task classes, , other classes available use in rest of build script. without buildscript block, can use ships gradle out-of-the-box. if additionally want use third-party plugins, task classes, or other classes (in build script!), have specify corresponding dependencies in buildscript block.


Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

html - Unable to style the color of bullets in a list -

c# - must be a non-abstract type with a public parameterless constructor in redis -