forked from linxiangcheer/Cainiaowo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dependencies.gradle
140 lines (113 loc) · 5.15 KB
/
dependencies.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
//配置各个module共用的参数
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: "androidx.navigation.safeargs.kotlin" //用于navigation传参时候的一种安全防护
apply plugin: "kotlin-parcelize" //parcelize插件,有@Parcelize注解
android {
compileSdkVersion compile_sdk_version
buildToolsVersion build_tools_version
defaultConfig {
minSdkVersion min_sdk_version
targetSdkVersion target_sdk_version
versionCode lib_version_code
versionName lib_version_name
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
//java中Arouter配置方式 生成schema文件,便于查看数据库创建表的详细信息
javaCompileOptions {
annotationProcessorOptions {
arguments = ["room.schemaLocation": "$projectDir/schemas".toString()]
//ARouter需要配置
arguments = [AROUTER_MODULE_NAME: project.getName()]
}
}
//kotlin ARouter 配置方式
kapt {
arguments {
arg("AROUTER_MODULE_NAME", project.getName())
arg("room.schemaLocation": "$projectDir/schemas".toString())
}
}
}
buildTypes {
release {
minifyEnabled false //混淆与否
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
//混淆脚本
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
//NetRspKtx 使用了实验特性
freeCompilerArgs += ["-Xopt-in=kotlin.RequiresOptIn"]
}
buildFeatures {
dataBinding true
}
}
dependencies {
//region 平台相关基础库
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.3.2'
implementation 'androidx.appcompat:appcompat:1.2.0'
//官方材料组件
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.0-alpha2'
//viewpager2 可以滑动的格式显示视图或fragment
implementation "androidx.viewpager2:viewpager2:1.0.0"
//recyclerview 在界面中显示大量数据的时候可以减少内存用量
implementation "androidx.recyclerview:recyclerview:1.1.0"
//endregion
def activity_version = "1.2.0"
implementation "androidx.activity:activity-ktx:$activity_version"
def fragment_version = "1.2.5"
implementation "androidx.fragment:fragment-ktx:$fragment_version"
//region 协程
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.9'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.1'
//endregion
//region jetpack libs
def lifecycle_version = "2.3.0"
def arch_version = "2.1.0"
implementation "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version"
//endregion
//room数据库
implementation "androidx.room:room-runtime:2.2.6"
kapt "androidx.room:room-compiler:2.2.6"
//region jetpack组件分页,上拉加载平滑过渡效果
def paging_version = "3.0.0-beta01"
implementation "androidx.paging:paging-runtime:$paging_version"
testImplementation "androidx.paging:paging-common:$paging_version"
//endregion
//region Description 注意配置navigetion版本号的时候,project下的build.gradle的class path也需要同步navigation的版本号配置
implementation "androidx.navigation:navigation-fragment-ktx:$navigation_version"
implementation "androidx.navigation:navigation-ui-ktx:$navigation_version"
//endregion
//region koin依赖注入框架
implementation "org.koin:koin-core:$koin_version" // Koin for Kotlin
implementation "org.koin:koin-core-ext:$koin_version" // Koin extended & experimental features
implementation "org.koin:koin-androidx-scope:$koin_version" // Koin AndroidX Scope features
implementation "org.koin:koin-androidx-viewmodel:$koin_version" // Koin AndroidX ViewModel features
implementation "org.koin:koin-androidx-fragment:$koin_version" // Koin AndroidX Fragment features
implementation "org.koin:koin-androidx-workmanager:$koin_version" // Koin AndroidX WorkManager
implementation "org.koin:koin-androidx-compose:$koin_version" // Koin AndroidX Jetpack Compose
implementation "org.koin:koin-androidx-ext:$koin_version" // Koin AndroidX Experimental features
//endregion
//ARouter 路由框架
implementation 'com.alibaba:arouter-api:1.5.1'
kapt 'com.alibaba:arouter-compiler:1.5.1'
//liveData eventBus
implementation 'com.jeremyliao:live-event-bus-x:1.7.3'
//工具包
implementation 'com.blankj:utilcodex:1.29.0'
//region test libs
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
//endregion
}