-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy pathbuild.gradle
70 lines (65 loc) · 2.61 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
60
61
62
63
64
65
66
67
68
69
// Top-level build file where you can add configuration options common to all sub-projects/modules.
apply from: 'config.gradle'
buildscript {
repositories {
google()
jcenter()
maven{ url 'https://maven.aliyun.com/repository/jcenter'}
maven{ url 'https://maven.aliyun.com/repository/google'}
maven { url 'https://jitpack.io' }
maven {
url uri('repo')
}
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.0'
classpath "io.objectbox:objectbox-gradle-plugin:2.9.1"
classpath 'com.github.VcStrong:ConstantPlugin:0.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven{ url 'https://maven.aliyun.com/repository/jcenter'}
maven{ url 'https://maven.aliyun.com/repository/google'}
maven { url 'https://jitpack.io' }
maven {
url uri('repo')
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
def modules = getSubprojects()
//def modules = getAllprojects()
// app 是主工程模块名,组件化打包,如果后续使用了拆分aar后,可视情况删除,参考README.md中的日志说明
project('app') { p ->
p.afterEvaluate {
println "==============================================================="
println "打包分支:"+active.branch + " 包名:" +active.applicationId + " 版本:" + active.versionName
println "==============================================================="
modules.each() { module ->
if (!ignorePackage.contains(module.name)) {
if (allPackage) {//所有模块都打包
if (module != p) {
println p.name + "全功能打包,已添加模块:" + module.name
p.dependencies.add("implementation", project(':' + module.name))
} else {
println p.name + "全模块打包,重复或者不添加的模块:" + module.name
}
} else {
if (needPackage.contains(module.name)) {
if (module != p) {
println p.name + "组件化打包,清单文件默认采用src/test/AndroidManifest.xml...加载模块:" + module.name
p.dependencies.add("implementation", project(':' + module.name))
}
}
}
}
}
}
}