Setting文件
Setting文件可以说是子项目(也可以说是Module)的配置文件,大多数setting.gradle的作用是为了配置子工程,再Gradle多工程是通过工程树表示的,如在Android studio中我们指定相应的module能在主工程当中使用,需要这样
include ':example'
Build文件
Build是Project的配置文件,我们可以配置版本,插件,依赖库等等的信息,比较常见的就是Jcenter仓库的配置
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
本文详细介绍了Gradle项目中的两种核心配置文件:Setting文件和Build文件。Setting文件主要用于配置子项目,而Build文件则用于配置项目的版本、插件及依赖等信息。通过具体的配置示例,帮助读者更好地理解如何在多模块项目中运用这些配置。


被折叠的 条评论
为什么被折叠?



