-
Notifications
You must be signed in to change notification settings - Fork 20
/
build.gradle
64 lines (56 loc) · 2.19 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
// Top-level build file where you can add configuration options common to all sub-projects/modules.
apply from: "config.gradle"
buildscript {
ext.kotlin_version = "1.5.21"
repositories {
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
maven { url 'https://maven.aliyun.com/repository/google' }
google()
jcenter()
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:4.0.2"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.dagger:hilt-android-gradle-plugin:2.38.1'
classpath 'com.didichuxing.doraemonkit:dokitx-plugin:3.3.5'
}
}
allprojects {
repositories {
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
maven { url 'https://maven.aliyun.com/repository/google' }
google()
jcenter()
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
//子工程模块通用配置信息
subprojects { subproject ->
if (subproject.getName().startsWith("biz_")) {
apply from: "../common_module_config.gradle"
apply from: "../arouter.gradle"
android {
//自定义自模块资源命名前缀,防止资源重复
resourcePrefix subproject.getName().substring(subproject.getName().indexOf("_") + 1) + "_"
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
testImplementation rootProject.ext.androidx["junit"]
androidTestImplementation rootProject.ext.androidx["androidx.test.espresso:espresso-core"]
if (subproject.getName() != "biz_provider") {
api project(path: ':biz_provider')
//组件化使用hilt时,目前需要在每一个module中都以下配置
implementation rootProject.ext.dependencies["hilt-android"]
kapt rootProject.ext.dependencies["hilt-android-compiler"]
kapt rootProject.ext.androidx["hilt-compiler"]
}else{
api project(path: ':lib_common')
}
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}