-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathbuild.gradle
59 lines (55 loc) · 2.55 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// Top-level build file where you can add configuration options common to all sub-projects/modules.
apply from: "config.gradle"
// buildscript该闭包用于给该脚本本身的配置
buildscript {
// buildScript块的repositories主要是为了Gradle脚本自身的执行,获取脚本依赖插件
repositories {
/** 声明使用Google和jcenter的代码托管仓库
大部分的Android开源项目都会将代码托管到这两个仓库
声明这两个仓库之后,需要引入开源项目而本地缓存没有的情况下
便会按照先后顺序去这些仓库寻找,从仓库将相关项目下载到本地**/
// 但是因为网络原因,这两个仓库对于国内来说不太友好,所以通常使用阿里云等镜像站代替使用
// 按需求添加如下几行即可
//方式一
maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://maven.aliyun.com/repository/jcenter' }
//方式二
// maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' }
// maven { url 'https://maven.aliyun.com/nexus/content/repositories/jcenter' }
google()
mavenCentral()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.2.1'
// classpath 'com.novoda:bintray-release:0.9.2'//此仓库暂不支持gradle6.0以上版本,使用下面仓库代替
// classpath 'com.github.panpf.bintray-publish:bintray-publish:1.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
options.addStringOption('encoding', 'UTF-8')
}
repositories {
//方式一
maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://maven.aliyun.com/repository/jcenter' }
//方式二
// maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' }
// maven { url 'https://maven.aliyun.com/nexus/content/repositories/jcenter' }
google()
mavenCentral()
jcenter()
maven { url "https://jitpack.io" }
}
}
// 运行gradle clean时,执行此处定义的task
// 该任务继承自Delete,删除根目录中的build目录
// 相当于执行Delete.delete(rootProject.buildDir)
// gradle使用groovy语言,调用method时可以不用加()
//task clean(type: Delete) {
// delete rootProject.buildDir
//}