-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
184 lines (173 loc) · 6.15 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
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
plugins {
id 'com.android.application'
}
def config = rootProject.ext
configurations.all {
resolutionStrategy {
//force "com.google.android.material:material:${config.dependencies.material_version}"//1.3.0
//force 'androidx.core:core-ktx:1.3.2'
//force 'androidx.core:core:1.3.2'
force "androidx.core:core-ktx:${config.dependencies.androidx_core_version}"
force "androidx.core:core:${config.dependencies.androidx_core_version}"
force "androidx.appcompat:appcompat:${config.dependencies.appcompat_version}"//1.3.0
force "androidx.activity:activity:${config.dependencies.appcompat_version}"
force "androidx.fragment:fragment:${config.dependencies.appcompat_version}"
}
}
android {
compileSdkVersion config.android.compileSdkVersion
buildToolsVersion config.android.buildToolsVersion
defaultConfig {
applicationId "com.example.app"
minSdkVersion config.android.minSdkVersion
targetSdkVersion config.android.targetSdkVersion
versionCode config.android.versionCode
versionName config.android.versionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true
javaCompileOptions {
annotationProcessorOptions {
arguments = [AROUTER_MODULE_NAME: project.getName()]
}
}
}
buildTypes {
debug {
minifyEnabled false
// zipAlignEnabled true
// shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
buildConfigField("Boolean", "MOULDE_TO_APPLICATION", "${mouldeToApplication}")
// resValue("string", "ia_mnumstring", "demo")//xml使用方式@string/app_key
// resValue("dimen", "ia_mpx", "4px")
// resValue("integer", "ia_mnum", "4")
}
release {
minifyEnabled true
zipAlignEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
buildConfigField("Boolean", "MOULDE_TO_APPLICATION", "${mouldeToApplication}")
// signingConfig signingConfigs.release
// resValue("integer", "iamnum", "4")
// resValue("dimen", "iampx", "4px")
}
}
signingConfigs {
debug {
storeFile file('templete.keystore')
storePassword '000000'
keyAlias '000000'
keyPassword '000000'
}
release {
storeFile file('templete.keystore')
storePassword '000000'
keyAlias '000000'
keyPassword '000000'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
sourceSets {
main {
jniLibs.srcDirs = ['libs']
}
}
viewBinding {
enabled = true
}
dataBinding {
enabled = true
}
repositories {
flatDir {
dirs 'libs', '../library/lib_base/libs'
}
}
// greendao {
// //版本号
// schemaVersion 1
// //工程路径
// targetGenDir 'src/main/java'
// //包名
// daoPackage 'com.datouma.newproject.db.dao'
// }
build {
applicationVariants.all { variant ->
variant.outputs.all {
outputFileName = "xsm_${variant.productFlavors[0].name}_${variant.versionCode}_v${variant.versionName}.apk"
}
}
flavorDimensions("channel")
productFlavors {
guanfang {
dimension "channel"
manifestPlaceholders = [UMENG_CHANNEL_VALUE: "官方-老版本"]
}
qh360 {
dimension "channel"
manifestPlaceholders = [UMENG_CHANNEL_VALUE: "qh360"]
}
xiaomi {
dimension "channel"
manifestPlaceholders = [UMENG_CHANNEL_VALUE: "小米"]
}
oppo {
dimension "channel"
manifestPlaceholders = [UMENG_CHANNEL_VALUE: "oppo"]
}
huawei {
dimension "channel"
manifestPlaceholders = [UMENG_CHANNEL_VALUE: "华为"]
}
vivo {
dimension "channel"
manifestPlaceholders = [UMENG_CHANNEL_VALUE: "vivo"]
}
anzhi {
dimension "channel"
manifestPlaceholders = [UMENG_CHANNEL_VALUE: "安智"]
}
baidu {
dimension "channel"
manifestPlaceholders = [UMENG_CHANNEL_VALUE: "百度"]
}
anzhuozhushou {
dimension "channel"
manifestPlaceholders = [UMENG_CHANNEL_VALUE: "安卓市场"]
}
zhushou91 {
dimension "channel"
manifestPlaceholders = [UMENG_CHANNEL_VALUE: "91助手"]
}
yingyongbao {
dimension "channel"
manifestPlaceholders = [UMENG_CHANNEL_VALUE: "应用宝"]
}
h5 {
dimension "channel"
manifestPlaceholders = [UMENG_CHANNEL_VALUE: "官方"]
}
}
}
}
dependencies {
implementation project(path: ':library:lib_base')
annotationProcessor "com.alibaba:arouter-compiler:${config.dependencies.route_version}"
implementation "androidx.multidex:multidex:${config.dependencies.multidex_version}"
//oaid
implementation(name: 'oaid_sdk_1.0.25', ext: 'aar')
//业务模块
if (!mouldeToApplication.toBoolean()) {
implementation project(path: ':module_a')
implementation project(path: ':module_b')
implementation project(path: ':module_login')
}
//test
testImplementation "junit:junit:${config.dependencies.junit_version}"
androidTestImplementation "androidx.test.ext:junit:${config.dependencies.ext_junit_version}"
androidTestImplementation "androidx.test.espresso:espresso-core:${config.dependencies.espresso_core_version}"
}