-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathbuild.gradle
69 lines (59 loc) · 1.95 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
//plugins {
// id 'com.android.application' // -> apk
//}
if(isRelease){
apply plugin: 'com.android.library' // -> arr
}else {
apply plugin: 'com.android.application' // -> apk
}
android {
compileSdkVersion app_android.compileSdkVersion
buildToolsVersion app_android.buildToolsVersion
defaultConfig {
// 组件化模式下才需要applicationId
if(!isRelease){
applicationId app_id.order
}
minSdkVersion app_android.minSdkVersion
targetSdkVersion app_android.targetSdkVersion
versionCode app_android.versionCode
versionName app_android.versionName
testInstrumentationRunner app_android.testInstrumentationRunner
javaCompileOptions {
annotationProcessorOptions{
arguments = [moduleName: this.project.getName(), packageNameForAPT: packageNameForAPT]
}
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
// 源集 —— 用来设置Java目录或者资源目录
sourceSets {
main {
if(!isRelease){
// 如果是组件化模式,需要单独运行时
manifest.srcFile 'src/main/debug/AndroidManifest.xml'
}else {
// 集成化模式,整个项目打包
manifest.srcFile 'src/main/AndroidManifest.xml'
java {
// release 时 debug 目录下文件不需要合并到主工程
exclude '**/debug/**'
}
}
}
}
}
dependencies {
implementation project(':common')
implementation project(':annotation')
annotationProcessor project(':annotation-processor')
}