1 Star 0 Fork 2

JimGw/JetpackOfCainiao

forked from zhuGdu/JetpackOfCainiao 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
dependencies.gradle 5.09 KB
一键复制 编辑 原始数据 按行查看 历史
//统一配置一些共用参数
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'//kotlin语言使用注入框架,dataBinding都需要这个
apply plugin: 'androidx.navigation.safeargs.kotlin'//用于navigation传参的时候一种安全防护
apply plugin: 'koin'
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中的配置
// javaCompileOptions {
// annotationProcessorOptions {
// //生成schema文件,便于查看数据库创建表的详细信息
// 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.txt'), 'proguard-rules.pro'
}
}
//AndroidStudio4.0 以下使用这种配置dataBinding
// dataBinding {
// enabled = true
// }
//AndroidStudio4.0 以上版本使用这个配置dataBinding
buildFeatures {
dataBinding = true
}
compileOptions {
sourceCompatibility 1.8
targetCompatibility 1.8
}
// work-runtime-ktx 2.1.0 and above now requires Java 8
kotlinOptions {
jvmTarget = "1.8"
freeCompilerArgs+=["-Xopt-in=kotlin.RequiresOptIn",] //使用kotlin新特性
}
}
//创建一个dependencies管理的文件,可以在各自module的build.gradle文件里,apply form 该文件的相对路径(包含fileName),如 apply form ../dependencies.gradle
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
//region 平台相关的基础库
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.0"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.0"
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.core:core-ktx:1.3.1'
implementation 'androidx.fragment:fragment-ktx:1.2.4'
implementation 'androidx.activity:activity-ktx:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta8'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'com.google.android.material:material:1.2.1'
implementation 'androidx.viewpager2:viewpager2:1.0.0'
//endregion
//region jetPack libs
// implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0' //已被废弃,详见demo
implementation 'androidx.lifecycle:lifecycle-livedata:2.2.0'
implementation 'androidx.lifecycle:lifecycle-viewmodel:2.2.0'
implementation 'androidx.lifecycle:lifecycle-runtime:2.2.0'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.2.0'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0'
kapt "androidx.lifecycle:lifecycle-common-java8:2.2.0"
implementation 'androidx.room:room-runtime:2.2.5'
implementation 'androidx.room:room-common:2.2.5'
implementation 'androidx.room:room-ktx:2.2.5'
kapt "androidx.room:room-compiler:2.2.5"
implementation 'androidx.paging:paging-runtime:3.0.0-alpha07'
implementation 'androidx.paging:paging-common:3.0.0-alpha07'
implementation 'androidx.work:work-runtime:2.3.4'
implementation 'androidx.work:work-runtime-ktx:2.3.4'
//注意配置navigation版本号的时候,project下的build.gradle的class path也需要同步navigation的版本号配置
implementation "androidx.navigation:navigation-ui:$navigation_version"
implementation "androidx.navigation:navigation-ui-ktx:$navigation_version"
implementation "androidx.navigation:navigation-fragment:$navigation_version"
implementation "androidx.navigation:navigation-fragment-ktx:$navigation_version"
implementation "androidx.navigation:navigation-runtime:$navigation_version"
//endregion
//region test libs
testImplementation 'junit:junit:4.13'
androidTestImplementation 'androidx.test.ext:junit-ktx:1.1.1'
androidTestImplementation 'androidx.test:core:1.2.0'
androidTestImplementation 'androidx.test:core-ktx:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
//endregion
//region koin框架
//koin for kotlin
implementation "org.koin:koin-core:$koin_version"
implementation "org.koin:koin-core-ext:$koin_version"
// Koin for Androidx
implementation "org.koin:koin-androidx-scope:$koin_version"
implementation "org.koin:koin-androidx-viewmodel:$koin_version"
implementation "org.koin:koin-androidx-fragment:$koin_version"
implementation "org.koin:koin-androidx-ext:$koin_version"
testImplementation "org.koin:koin-test:$koin_version"
//endregion
//region ARouter
implementation 'com.alibaba:arouter-api:1.5.0'
kapt 'com.alibaba:arouter-compiler:1.2.2'
//liveData eventBus
implementation 'com.jeremyliao:live-event-bus-x:1.7.2'
//endregion
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/JimGw/jetpack-of-cainiao.git
git@gitee.com:JimGw/jetpack-of-cainiao.git
JimGw
jetpack-of-cainiao
JetpackOfCainiao
master

搜索帮助