-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
153 lines (133 loc) · 4.96 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
apply plugin: 'com.android.application'
apply from: rootProject.file('gradle/resguard.gradle')
def static getBuildTime() {
return new Date().format("yyyyMMddHHmmss")
}
def getAppVersionName() {
return "${versions.versionName}.${versions.versionCode}"
}
android {
compileSdkVersion versions.compileSdkVersion
defaultConfig {
minSdkVersion versions.minSdkVersion
targetSdkVersion versions.targetSdkVersion
applicationId apps.applicationId
versionCode versions.versionCode
versionName getAppVersionName()
buildConfigField 'String', 'BUILD_TIME', '"' + getBuildTime() + '"'
buildConfigField 'String', 'GIT_COMMIT_TIME', '"' + gits.gitCommitTime + '"'
buildConfigField 'String', 'GIT_BRANCH', '"' + gits.gitCommitBranch + '"'
testInstrumentationRunner deps.androidRunner
ndk {
// 设置支持的SO库架构
abiFilters 'armeabi'//, 'arm64-v8a'
}
}
viewBinding {
enabled = true
}
// keystore文件
signingConfigs {
douban {
storeFile file('../data/starry_douban.jks')
storePassword 'starry123456'
keyAlias 'douban'
keyPassword 'douban123456'
}
}
buildTypes {
debug {
versionNameSuffix '_debug'
minifyEnabled false
signingConfig signingConfigs.douban
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
resValue 'string', 'debug', 'true'
}
release {
debuggable false
minifyEnabled true
signingConfig signingConfigs.douban
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
resValue 'string', 'debug', 'false'
}
}
sourceSets {
main.jniLibs.srcDirs = ['libs']
}
}
//Program type already present: javax.annotation.xxx 依赖冲突解决办法
//查看依赖关系: ./gradlew app:dependencies
//以 javax.annotation:javax.annotation-api:1.3.2 冲突为例
//第一种办法简单粗暴排除所有
//configurations {
// all*.exclude module: 'javax.annotation-api'
//}
//第二种办法在引用冲突依赖的时候排除
//dependencies{
// testImplementation('org.robolectric:robolectric:4.4'){
// exclude module: 'javax.annotation-api'
// }
//}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
configurations.all {
// add leakcanary, conflict with dependency 'com.android.support:support-annotations'
// 26.0.2 adn 27.1.1 differ, force used my dependency annotations version(26.0.2)
resolutionStrategy.force deps.annotations
}
//android support
implementation deps.appcompat
implementation deps.support
implementation deps.recyclerview
implementation deps.design
implementation deps.cardview
implementation deps.lifecycleExtensions
implementation deps.constraintLayout
implementation deps.roomRuntime
annotationProcessor deps.roomCompiler
//test
testImplementation deps.junit
androidTestImplementation deps.runner
androidTestImplementation deps.espresso
//others
implementation deps.glide
annotationProcessor deps.glideCompiler
implementation deps.gson
implementation deps.okhttp3
implementation deps.agentweb
implementation deps.jsoup
implementation deps.slidableactivity
// (注:从2.1.5开始要分开Bugly SDK和NDK的配置)
implementation deps.crashreport
implementation deps.nativecrashreport
debugImplementation deps.leakcanaryDebug
releaseImplementation deps.leakcanaryRelease
debugImplementation deps.anrDebug
releaseImplementation deps.anrRelease
implementation 'com.makeramen:roundedimageview:2.3.0'
implementation 'com.github.CarGuo.GSYVideoPlayer:gsyVideoPlayer-java:v6.0.3'
//是否需要ExoPlayer模式
// implementation 'com.github.CarGuo.GSYVideoPlayer:gsyVideoPlayer-exo_player2:v6.0.3'
//根据你的需求ijk模式的so
// implementation 'com.github.CarGuo.GSYVideoPlayer:gsyVideoPlayer-armv64:v6.0.3'
implementation 'com.github.CarGuo.GSYVideoPlayer:gsyVideoPlayer-armv5:v6.0.3'
//module
implementation project(':ProgressIndicator')
implementation project(':XRecyclerView')
implementation project(':SmartTabLayout')
implementation project(':RxJava')
implementation project(':Logger')
implementation project(':Http')
implementation project(':Overscroll')
implementation project(':CoolIndicator')
implementation project(':ParallaxViewPager')
implementation project(':Cropiwa')
implementation project(':SqliteDao')
}
//modify apk output file name, format:db-versionName.versionCode-buildType.apk
android.applicationVariants.all { variant ->
variant.outputs.all {
def apkName = "db-${versions.versionName}.${versions.versionCode}"
outputFileName = "${apkName}-${buildType.name}.apk"
}
}