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
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-android-extensions'
id 'kotlin-kapt'
}
static def releaseTime() {
return new Date().format("yyyy-MM-dd", TimeZone.getTimeZone("UTC"))
}
android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.ypsx.yppos"
minSdkVersion 21
targetSdkVersion 30
versionCode 100011
versionName "1.00.011"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildFeatures {
dataBinding = true
}
//使用Kotlin实验特性
androidExtensions {
experimental = true
}
signingConfigs {
config {
keyAlias RELEASE_KEY_ALIAS
keyPassword RELEASE_KEY_PASSWORD
storeFile file(RELEASE_STORE_FILE)
storePassword RELEASE_KEY_PASSWORD
}
}
buildTypes {
debug {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.config
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.config
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
lintOptions {
disable 'InvalidPackage'
disable "ResourceType"
abortOnError false
}
dexOptions {
javaMaxHeapSize "4g"
jumboMode = true
preDexLibraries = false
additionalParameters = [
'--multi-dex',//多分包
'--set-max-idx-number=60000'//每个包内方法数上限
]
}
android.applicationVariants.all { variant ->
variant.outputs.all {
outputFileName = "yppos_v${variant.versionCode}-${variant.versionName}-${variant.buildType.name}-${releaseTime()}.apk"
}
}
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.3.2'
implementation project(path: ':base')
implementation files('libs/platform_sdk_v3.1.0326.jar')
implementation project(path: ':common')
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.cardview:cardview:1.0.0'
//微信开源项目,替代SP
implementation 'com.blankj:utilcodex:1.26.0'
//屏幕适配
implementation 'me.jessyan:autosize:1.2.1'
//BaseAdapter
implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:3.0.4'
def room_version = "2.3.0"
implementation("androidx.room:room-runtime:$room_version")
annotationProcessor "androidx.room:room-compiler:$room_version"
// To use Kotlin annotation processing tool (kapt)
kapt("androidx.room:room-compiler:$room_version")
// optional - Kotlin Extensions and Coroutines support for Room
implementation("androidx.room:room-ktx:$room_version")
implementation 'io.github.razerdp:BasePopup:3.1.8'
implementation 'com.github.jenly1314.AppUpdater:app-updater:1.1.0'
implementation 'com.github.getActivity:ToastUtils:9.5'
implementation 'com.aliyun.dpa:oss-android-sdk:2.1.0'
// val work_version = "2.6.0"
// Kotlin + coroutines
// implementation("androidx.work:work-runtime-ktx:$work_version")
//防崩溃
// implementation 'cat.ereza:customactivityoncrash:2.3.0'
}