-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommon_module.gradle
More file actions
115 lines (95 loc) · 3.41 KB
/
common_module.gradle
File metadata and controls
115 lines (95 loc) · 3.41 KB
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
if (isBuildModule.toBoolean()) {
apply plugin: 'com.android.application'
} else {
apply plugin: 'com.android.library'
}
apply plugin: 'com.jakewharton.butterknife'
android {
compileSdkVersion rootProject.ext.android["compileSdkVersion"]
buildToolsVersion rootProject.ext.android["buildToolsVersion"]
defaultConfig {
if (isBuildModule.toBoolean()) {
applicationId rootProject.ext.frame["applicationId"]
}
minSdkVersion rootProject.ext.android["minSdkVersion"]
targetSdkVersion rootProject.ext.android["targetSdkVersion"]
versionCode rootProject.ext.android["versionCode"]
versionName rootProject.ext.android["versionName"]
javaCompileOptions {
annotationProcessorOptions {
arguments = [AROUTER_MODULE_NAME: project.getName()]
includeCompileClasspath true
}
}
ndk {
abiFilters 'arm64-v8a', 'armeabi', 'armeabi-v7a', 'x86', 'x86_64'
}
}
buildTypes {
debug {
buildConfigField "boolean", "IS_BUILD_MODULE", "${isBuildModule}"
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
release {
buildConfigField "boolean", "IS_BUILD_MODULE", "${isBuildModule}"
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
disable 'InvalidPackage'
disable "ResourceType"
disable 'MissingTranslation'
abortOnError false
checkReleaseBuilds false
}
sourceSets {
main {
jniLibs.srcDirs = ['libs']
if (isBuildModule.toBoolean()) {
manifest.srcFile 'src/main/debug/AndroidManifest.xml'
} else {
manifest.srcFile 'src/main/release/AndroidManifest.xml'
}
}
}
flavorDimensions "ComponentFrames"
// 多渠道打包
productFlavors {
// 默认渠道
DefaultChannel {
manifestPlaceholders = [Channel: "ComponentFrames"]
dimension "ComponentFrames"
}
}
allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
maven { url 'http://dl.bintray.com/dev-fingerlinks/maven' }
mavenCentral()
}
}
}
dependencies {
if (isBuildModule.toBoolean()) {
annotationProcessor rootProject.ext.dependencies["arouter-compiler"]
// Tools
annotationProcessor rootProject.ext.dependencies["butterknife-compiler"]
// Test
testImplementation rootProject.ext.dependencies["junit"]
debugImplementation rootProject.ext.dependencies["canary-debug"]
releaseImplementation rootProject.ext.dependencies["canary-release"]
testImplementation rootProject.ext.dependencies["canary-release"]
} else {
compileOnly rootProject.ext.dependencies["arouter-compiler"]
// Tools
compileOnly rootProject.ext.dependencies["butterknife-compiler"]
// Test
compileOnly rootProject.ext.dependencies["junit"]
compileOnly rootProject.ext.dependencies["canary-debug"]
compileOnly rootProject.ext.dependencies["canary-release"]
compileOnly rootProject.ext.dependencies["canary-release"]
}
}