-
Notifications
You must be signed in to change notification settings - Fork 433
/
Copy pathbuild.gradle
160 lines (136 loc) · 5.79 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
apply plugin: 'com.android.application'
android {
//compileSdkVersion 29
//buildToolsVersion '29.0.1'
signingConfigs {
release {
storeFile file(rootProject.ext.signing_storeFile)
storePassword rootProject.ext.signing_storePassword
keyAlias = rootProject.ext.signing_keyAlias
keyPassword rootProject.ext.signing_keyPassword
}
debug {
storeFile file(rootProject.ext.signing_storeFile)
storePassword rootProject.ext.signing_storePassword
keyAlias = rootProject.ext.signing_keyAlias
keyPassword rootProject.ext.signing_keyPassword
}
}
defaultConfig {
applicationId rootProject.ext.PACKAGE_NAME
//minSdkVersion 15
//targetSdkVersion 32
versionCode rootProject.ext.VA_VERSION_CODE
versionName rootProject.ext.VA_VERSION
//renderscriptTargetApi 19
//renderscriptSupportModeEnabled true
multiDexEnabled true
vectorDrawables.useSupportLibrary = true
buildConfigField 'String', 'PACKAGE_NAME', '"' + rootProject.ext.PACKAGE_NAME + '"'
buildConfigField 'String', 'EXT_PACKAGE_NAME', '"' + rootProject.ext.EXT_PACKAGE_NAME + '"'
buildConfigField 'String', 'VA_VERSION_NAME', '"V' + rootProject.ext.VA_VERSION + '"'
//buildConfigField 'String', 'PACKAGE_NAME_ARM64', '"' + rootProject.ext.EXT_PACKAGE_NAME + '"'
manifestPlaceholders = [
PACKAGE_NAME_32BIT: rootProject.ext.PACKAGE_NAME,
PACKAGE_NAME_ARM64: rootProject.ext.EXT_PACKAGE_NAME,
VA_ACCESS_PERMISSION_NAME: rootProject.ext.VA_ACCESS_PERMISSION_NAME,
]
//ndk {
//abiFilters rootProject.ext.VA_VERSION_64?"arm64-v8a":"armeabi-v7a"//"arm64-v8a","armeabi", "armeabi-v7a", "x86" //兼容Android 10
//abiFilters "armeabi-v7a", "x86" , "x86_64"
//}
if (rootProject.ext.VA_MAIN_PACKAGE_32BIT) {
ndk.abiFilters = ["armeabi-v7a"]
} else {
ndk.abiFilters = ["arm64-v8a"]
}
signingConfig signingConfigs.release
}
sourceSets {
main {
jniLibs.srcDirs = ['libs']
}
}
buildTypes {
debug {
//debuggable true
jniDebuggable false
minifyEnabled false
zipAlignEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), '../security/proguard-rules.pro' //'proguard-rules.pro', 'virtualapp-proguard-rules.pro','../security/proguard-rules.pro' //
}
release {
jniDebuggable true
minifyEnabled true
zipAlignEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), '../security/proguard-rules.pro' //'proguard-rules.pro', 'virtualapp-proguard-rules.pro','../security/proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
lintOptions {
abortOnError false // 如果发现 lint 错误,不中止编译
checkReleaseBuilds false // 禁用发布版本的 lint 检查
xmlReport true // 生成 XML 格式的报告
htmlReport true // 生成 HTML 格式的报告
}
lintOptions {
abortOnError false
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
// 解决资源冲突
// exclude 'META-INF/metadata.jvm.kotlin_module'
//exclude 'META-INF/*.kotlin_module' // 也可以尝试排除所有相关的kotlin_module文件
}
}
repositories {
flatDir {
dirs 'sdk'
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation(name:'lib-release', ext:'aar')
//Android Lib
implementation 'androidx.percentlayout:percentlayout:1.0.0'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'com.google.android.material:material:1.2.1'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.2'
//Lifecycles, LiveData, and ViewModel
implementation 'androidx.lifecycle:lifecycle-runtime:2.2.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
implementation "androidx.lifecycle:lifecycle-common-java8:2.2.0"
//Room
implementation 'androidx.room:room-runtime:2.2.5'
annotationProcessor 'androidx.room:room-compiler:2.2.5'
implementation 'io.reactivex.rxjava2:rxjava:2.2.21'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
//Retrofit
implementation "com.squareup.retrofit2:retrofit:2.9.0"//导入Retrofit
implementation "com.squareup.retrofit2:converter-gson:2.9.0"//转换器,请求结果转换成VO
implementation "com.squareup.retrofit2:converter-scalars:2.9.0"//转换器,请求结果转换成原始json字符串
implementation "com.squareup.retrofit2:adapter-rxjava2:2.9.0"//配合Rxjava使用,将retofit的call映射成Observable
/*okhttp 网络 请求封装包*/
implementation 'com.squareup.okhttp3:okhttp:3.4.1'
implementation 'com.squareup.okhttp3:logging-interceptor:4.9.0'
//google 的gson 库
implementation 'com.google.code.gson:gson:2.8.4'
//Promise Support
implementation 'org.jdeferred:jdeferred-android-aar:1.2.4'
//StringFog
implementation 'com.github.megatronking.stringfog:xor:1.1.0'
//fastjson
implementation 'com.alibaba:fastjson:1.2.59'
//Glide
implementation 'com.github.bumptech.glide:glide:4.7.1'
implementation files('libs/pinyin4j-2.5.0.jar')
}