build.gradle
6.96 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
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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
// Top-level build file where you can add configuration options common to all sub-projects/modules.
apply from: "config.gradle"
static void imput(String type, Project project, Object dependencyNotation) {
if (project != dependencyNotation) project.dependencies.add(type, dependencyNotation)
}
buildscript {
repositories {
//关联微博
maven { url "https://dl.bintray.com/thelasterstar/maven/" }
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath "com.alibaba:arouter-register:1.0.2"
classpath 'org.greenrobot:greendao-gradle-plugin:3.2.2'
}
}
allprojects {
// configurations.all {
////// resolutionStrategy.force 'androidx.appcompat:appcompat:1.1.0'
// }
//添加java编译指令,防止引用时,形参变成var1
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs.add('-parameters')
}
}
afterEvaluate {
if (project.parent == null || project.parent == rootProject) return
android {
compileSdkVersion 29
buildToolsVersion "29.0.0"
// defaultConfig 闭包:默认配置、应用程序包名、最小sdk版本、目标sdk版本、版本号、版本名称;
defaultConfig {
if (minSdkVersion == null) minSdkVersion 21
if (targetSdkVersion == null) targetSdkVersion 29
if (versionCode == null) versionCode 1
if (versionName == null) versionName "1.2"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
javaCompileOptions {
annotationProcessorOptions {
arguments = [
AROUTER_MODULE_NAME: project.getName()
// ,
// AROUTER_GENERATE_DOC: "enable"
]
}
}
//解决引用glide-transformations冲突问题
packagingOptions {
exclude "lib/armeabi-v7a/libRSSupport.so"
exclude "lib/arm64-v8a/librsjni.so"
exclude "lib/arm64-v8a/libRSSupport.so"
exclude "lib/x86_64/libRSSupport.so"
exclude "lib/x86/librsjni.so"
exclude "lib/x86_64/librsjni.so"
exclude "lib/armeabi-v7a/librsjni.so"
exclude "lib/x86/libRSSupport.so"
exclude "lib/x86_64/librsjni_androidx.so"
exclude "lib/x86/librsjni_androidx.so"
exclude "lib/arm64-v8a/librsjni_androidx.so"
exclude "lib/armeabi-v7a/librsjni_androidx.so"
}
ndk {
abiFilters(
"armeabi-v7a"
// , "x86"
)
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
dataBinding {
enabled true
}
// multiDex的一些相关配置,这样配置可以让你的编译速度更快
dexOptions {
// 让它不要对Lib做preDexing
preDexLibraries = false
// 开启incremental dexing,优化编译效率,这个功能android studio默认是关闭的。
// incremental true
javaMaxHeapSize "4g" // 增加java堆内存大小
}
//signingConfigs 闭包:签名信息配置;
signingConfigs {
debugConfig {
storeFile file("www.cnlive.com.key")
storePassword "www.cnlive.comPassw0rd"
keyAlias "strike-debug"
keyPassword "www.cnlive.com"
}
releaseConfig {
// if (store_file != null) storeFile file(store_file)
// if (store_password != null) storePassword store_password
// if (key_alias != null) keyAlias key_alias
// if (key_password != null) keyPassword key_password
storeFile file("www.cnlive.com.key")
storePassword "www.cnlive.comPassw0rd"
keyAlias "strike"
keyPassword "www.cnlive.com"
}
}
}
//核心库
imput("implementation", project, moudle.core_base)
//Tripartite Base
for (String moudle : base_librarys) imput('implementation', project, moudle)
// for (String moudle : base_librarys) imput('api', project, moudle)
for (String moudle : base_compilers) imput('annotationProcessor', project, moudle)
}
repositories {
google()
jcenter()
maven {
url maven.mixedUrl
credentials { username = nexusId; password = nexusPw }
}
maven {
url 'http://android.nexus.cnlive.com/repository/cnlive-shop/'
credentials { username = 'shop'; password = 'ShangHa1' }
}
// 技术2部仓库地址
maven {
url 'http://wjjshop.cnlive.com:9188/repository/cnlive-modules/'
credentials { username = "cnlive-android"; password = "cnlive123" }
}
maven { url 'https://dl.bintray.com/granzon/cnliveLibs' }// 技术2部幸福中国依赖
//------------------ 资源库配置 recyclerviewAnimatorsEND------------------
maven { url 'https://dl.bintray.com/umsdk/release' }
//关联微博
maven { url "https://dl.bintray.com/thelasterstar/maven/" }
maven {
url 'https://dl.bintray.com/granzon/cnlive'
}
maven {
url 'https://dl.bintray.com/granzon/cnliveLibs'
}
maven {
url "https://jitpack.io"
}
maven {
url 'http://developer.huawei.com/repo'
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
//配置全局变量
ext {
compileSdkVersion = 29
libMediaPicker = '1.6.0'
// loading动画
avi = "2.1.3"
//蓝牙
BleLib = "2.3.4"
//动画大全
viewAnimationsEasing = '2.0@aar'
viewAnimationsAndroid = '2.3@aar'
libEmoj = '2.1.0'
libLargeImage = '1.0.1'
//SmartRefresh
SmartRefreshLayout = '1.1.0-alpha-1'
SmartRefreshHeader = '1.1.0-alpha-1'
TimePickerDialog = '1.0.1'
// libVideoQiniu = '1.0.6'
//七牛
qiniuAndroidSdk = '7.3.11'
libUpload = '2.0.6'
circleimageview = '3.0.1'
libMenu = '1.0.8'
appArch = '1.2.8'
imsdk = '3.3.2.14394.14395'
recyclerviewAnimators = '2.2.6'
//视讯云相关
libCnUtil = '3.1.5'
}