码迷,mamicode.com
首页 > 其他好文 > 详细

Gradle buildscript block

时间:2015-09-24 13:05:17      阅读:271      评论:0      收藏:0      [点我收藏+]

标签:

Gradle buildscript block

在build.gradle文件中有如下的配置,

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath ‘com.google.protobuf:protobuf-gradle-plugin:0.6.1‘
    }
}

但在buildscript block外面有时还需要repositories block,这是为什么呢?

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.

Gradle buildscript block

标签:

原文地址:http://my.oschina.net/xinxingegeya/blog/510604

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!