Skip to content

Commit

Permalink
update gradle.
Browse files Browse the repository at this point in the history
  • Loading branch information
qingmei2 committed Mar 6, 2020
1 parent a4d07c1 commit 661733d
Show file tree
Hide file tree
Showing 7 changed files with 195 additions and 190 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,7 @@
/build
/captures
.externalNativeBuild
app/schemas
app/schemas

buildSrc/build
buildSrc/*.iml
38 changes: 19 additions & 19 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'

android {
compileSdkVersion build_version.compileSdkVersion
compileSdkVersion BuildVersions.compileSdkVersion

defaultConfig {
applicationId "com.qingmei2.sample"
minSdkVersion build_version.minSdkVersion
targetSdkVersion build_version.targetSdkVersion
versionCode build_version.versionCode
versionName build_version.versionName
minSdkVersion BuildVersions.minSdkVersion
targetSdkVersion BuildVersions.targetSdkVersion
versionCode BuildVersions.versionCode
versionName BuildVersions.versionName

multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand Down Expand Up @@ -42,29 +42,29 @@ dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation project(':architecture-core')

implementation libs.appcompat
implementation libs.recyclerview
implementation libs.design
implementation libs.constraint
implementation libs.flexbox
implementation libs.swiperefreshlayout
implementation Dependencies.appcompat
implementation Dependencies.recyclerview
implementation Dependencies.materialDesign
implementation Dependencies.constraintlayout
implementation Dependencies.flexbox
implementation Dependencies.swiperefreshlayout

implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.cpacm:floatingmusicmenu:1.0.0'

implementation 'com.facebook.stetho:stetho:1.5.1'

debugImplementation libs.leak_canary_debug
debugImplementation libs.leak_canary_debug_support
releaseImplementation libs.leak_canary_release
debugImplementation Dependencies.leakCanaryDebug
debugImplementation Dependencies.leakCanaryDebugSupport
releaseImplementation Dependencies.leakCanaryRelease

kapt libs.glide_compiler
kapt libs.jetpack_room_compiler
kapt libs.jetpack_lifecycle_compiler
kapt Dependencies.glideCompiler
kapt Dependencies.roomCompiler
kapt Dependencies.lifecycleCompiler

testImplementation libs.junit
testImplementation Dependencies.junit4

androidTestImplementation libs.espresso_core
androidTestImplementation Dependencies.espresso
}

kapt {
Expand Down
67 changes: 34 additions & 33 deletions architecture-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'

android {
compileSdkVersion build_version.compileSdkVersion
compileSdkVersion BuildVersions.compileSdkVersion

defaultConfig {
minSdkVersion build_version.minSdkVersion
targetSdkVersion build_version.targetSdkVersion
versionCode build_version.versionCode
versionName build_version.versionName
minSdkVersion BuildVersions.minSdkVersion
targetSdkVersion BuildVersions.targetSdkVersion
versionCode BuildVersions.versionCode
versionName BuildVersions.versionName

multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand Down Expand Up @@ -42,50 +42,51 @@ dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

// support
implementation libs.appcompat
implementation libs.design
implementation libs.recyclerview
implementation Dependencies.appcompat
implementation Dependencies.materialDesign
implementation Dependencies.recyclerview

api libs.kotlin_stdlib
api libs.kotlin_coroutines
api Dependencies.kotlinLibrary
api Dependencies.kotlinCoroutinesLibrary

api libs.jetpack_lifecycle_extensions
api libs.jetpack_lifecycle_java8
api libs.jetpack_lifecycle_ktx
api Dependencies.lifecycleExtension
api Dependencies.lifecycleJava8
api Dependencies.lifecycleKtx

api libs.jetpack_livedata_ktx
api Dependencies.livedataKtx

api libs.jetpack_viewmodel
api libs.jetpack_viewmodel_ktx
api Dependencies.viewModel
api Dependencies.viewModelKtx

api libs.jetpack_room
api libs.jetpack_room_ktx
api Dependencies.room
api Dependencies.roomKtx

api libs.jetpack_navigation
api libs.jetpack_navigation_ui
api Dependencies.navigation
api Dependencies.navigationUi

api libs.jetpack_paging
api Dependencies.paging

// retrofit
api libs.retrofit
api libs.retrofit_gson
api Dependencies.retrofit
api Dependencies.retrofitGson
api Dependencies.retrofitRx

// kodein
api libs.kodein
api libs.kodein_android
api libs.kodein_androidx
api Dependencies.kodein
api Dependencies.kodeinAndroid
api Dependencies.kodeinAndroidX

// okhttp
api libs.okhttp
api libs.okhttp_logging
api Dependencies.okhttp
api Dependencies.okhttpLogging

// glide
api libs.glide
kapt libs.glide_compiler
api Dependencies.glide
kapt Dependencies.glideCompiler

// logger
api libs.timber
api Dependencies.timber

testImplementation libs.junit
androidTestImplementation libs.espresso_core
testImplementation Dependencies.junit4
androidTestImplementation Dependencies.espresso
}
6 changes: 2 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
buildscript {
apply from: 'dependencies.gradle'

repositories {
jcenter()
google()
}
dependencies {
classpath build_plugins.android_gradle
classpath build_plugins.kotlin_gradle
classpath BuildPlugins.androidGradle
classpath BuildPlugins.kotlinGradle
}
}

Expand Down
9 changes: 9 additions & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import org.gradle.kotlin.dsl.`kotlin-dsl`

plugins {
`kotlin-dsl`
}

repositories {
jcenter()
}
127 changes: 127 additions & 0 deletions buildSrc/src/main/java/Dependencies.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
object Versions {
const val android_plugin = "3.5.2"
const val kotlin = "1.3.61"
const val kotlin_coroutines = "1.3.3"

const val appcompat = "1.1.0"
const val jetpack_lifecycle = "2.2.0-rc03"
const val jetpack_viewModel = "2.2.0-rc03"
const val jetpack_room = "2.2.3"
const val jetpack_navigation = "2.2.0-rc04"
const val jetpack_paging = "2.1.1"

const val retrofit = "2.7.1"
const val kodein = "6.0.1"
const val glide = "4.10.0"

const val rxjava = "2.2.4"
const val rxkotlin = "2.2.0"
const val rxandroid = "2.1.0"
const val rxbinding = "3.1.0"
const val autodispose = "1.2.0"

const val leakcanary = "1.6.2"

const val espresso = "3.2.0"
const val robolectric = "3.3.2"
}

object BuildVersions {
const val compileSdkVersion = 29
const val minSdkVersion = 21
const val targetSdkVersion = 29
const val versionCode = 8
const val versionName = "0.6.0"
}

object BuildPlugins {
const val androidGradle = "com.android.tools.build:gradle:${Versions.android_plugin}"
const val kotlinGradle = "org.jetbrains.kotlin:kotlin-gradle-plugin:${Versions.kotlin}"
}

object Dependencies {
const val kotlinLibrary = "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${Versions.kotlin}"
const val kotlinCoroutinesLibrary = "org.jetbrains.kotlinx:kotlinx-coroutines-android:${Versions.kotlin_coroutines}"

const val appcompatV4 = "androidx.legacy:legacy-support-v4:${Versions.appcompat}"
const val appcompat = "androidx.appcompat:appcompat:${Versions.appcompat}"
const val appcompatV13 = "androidx.legacy:legacy-support-v13:${Versions.appcompat}"
const val materialDesign = "com.google.android.material:material:1.2.0-alpha03"
const val recyclerview = "androidx.recyclerview:recyclerview:${Versions.appcompat}"
const val cardview = "androidx.cardview:cardview:${Versions.appcompat}"
const val annotations = "androidx.annotation:annotation:${Versions.appcompat}"
const val swiperefreshlayout = "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0-alpha03"
const val constraintlayout = "androidx.constraintlayout:constraintlayout:1.1.3"
const val flexbox = "com.google.android:flexbox:1.1.0"

const val lifecycleExtension = "androidx.lifecycle:lifecycle-extensions:${Versions.jetpack_lifecycle}"
const val lifecycleJava8 = "androidx.lifecycle:lifecycle-common-java8:${Versions.jetpack_lifecycle}"
const val lifecycleCompiler = "androidx.lifecycle:lifecycle-compiler:${Versions.jetpack_lifecycle}"
const val lifecycleKtx = "androidx.lifecycle:lifecycle-runtime-ktx:${Versions.jetpack_lifecycle}"

const val viewModel = "androidx.lifecycle:lifecycle-viewmodel:${Versions.jetpack_viewModel}"
const val viewModelKtx = "androidx.lifecycle:lifecycle-viewmodel-ktx:${Versions.jetpack_viewModel}"

const val livedata = "androidx.lifecycle:lifecycle-livedata:${Versions.jetpack_lifecycle}"
const val livedataRx = "androidx.lifecycle:lifecycle-reactivestreams:${Versions.jetpack_lifecycle}"
const val livedataKtx = "androidx.lifecycle:lifecycle-livedata-ktx:${Versions.jetpack_lifecycle}"

const val navigation = "androidx.navigation:navigation-fragment:${Versions.jetpack_navigation}"
const val navigationUi = "androidx.navigation:navigation-ui:${Versions.jetpack_navigation}"

const val paging = "androidx.paging:paging-runtime:${Versions.jetpack_paging}"
const val pagingRx = "androidx.paging:paging-rxjava2:${Versions.jetpack_paging}"

const val room = "androidx.room:room-runtime:${Versions.jetpack_room}"
const val roomCompiler = "androidx.room:room-compiler:${Versions.jetpack_room}"
const val roomKtx = "androidx.room:room-ktx:${Versions.jetpack_room}"
const val roomRx = "androidx.room:room-rxjava2:${Versions.jetpack_room}"
const val roomTesting = "androidx.room:room-testing:${Versions.jetpack_room}"

const val okhttp = "com.squareup.okhttp3:okhttp:4.3.0"
const val okhttpLogging = "com.squareup.okhttp3:logging-interceptor:4.3.0"

const val retrofit = "com.squareup.retrofit2:retrofit:${Versions.retrofit}"
const val retrofitGson = "com.squareup.retrofit2:converter-gson:${Versions.retrofit}"
const val retrofitRx = "com.squareup.retrofit2:adapter-rxjava2:${Versions.retrofit}"

const val rxjava = "io.reactivex.rxjava2:rxjava:${Versions.rxjava}"
const val rxandroid = "com.squareup.retrofit2:rxandroid:${Versions.rxandroid}"
const val rxkotlin = "com.squareup.retrofit2:rxkotlin:${Versions.rxkotlin}"

const val rxbinding = "com.jakewharton.rxbinding3:rxbinding-core:${Versions.rxbinding}"
const val rxbindingAppcompat = "com.jakewharton.rxbinding3:rxbinding-appcompat:${Versions.rxbinding}"
const val rxbindingRecyclerview = "com.jakewharton.rxbinding3:rxbinding-recyclerview:${Versions.rxbinding}"
const val rxbindingSwipeRefresh = "com.jakewharton.rxbinding3:rxbinding-swiperefreshlayout:${Versions.rxbinding}"

const val autoDispose = "com.uber.autodispose:autodispose-android:${Versions.autodispose}"
const val autoDisposeKtx = "com.uber.autodispose:autodispose-ktx:${Versions.autodispose}"
const val autoDisposeAndroidKtx = "com.uber.autodispose:autodispose-android-ktx:${Versions.autodispose}"
const val autoDisposeArchsKtx = "com.uber.autodispose:autodispose-android-archcomponents-ktx:${Versions.autodispose}"

const val kodein = "org.kodein.di:kodein-di-generic-jvm:${Versions.kodein}"
const val kodeinAndroid = "org.kodein.di:kodein-di-framework-android-core:${Versions.kodein}"
const val kodeinAndroidX = "org.kodein.di:kodein-di-framework-android-x:${Versions.kodein}"

const val glide = "com.github.bumptech.glide:glide:${Versions.glide}"
const val glideCompiler = "com.github.bumptech.glide:compiler:${Versions.glide}"

const val timber = "com.jakewharton.timber:timber:4.7.1"

const val leakCanaryDebug = "com.squareup.leakcanary:leakcanary-android:${Versions.leakcanary}"
const val leakCanaryDebugSupport = "com.squareup.leakcanary:leakcanary-support-fragment:${Versions.leakcanary}"
const val leakCanaryRelease = "com.squareup.leakcanary:leakcanary-android-no-op:${Versions.leakcanary}"

const val junit4 = "junit:junit:4.13"

const val mockito_kotlin = "com.nhaarman:mockito-kotlin:1.5.0"

const val robolectric = "org.robolectric:robolectric:${Versions.robolectric}"
const val robolectricV4 = "org.robolectric:shadows-support-v4:${Versions.robolectric}"

const val espresso = "androidx.test.espresso:espresso-core:3.2.0"
const val espressoContrib = "androidx.test.espresso:espresso-contrib:3.2.0"
const val espressoIdlingResource = "androidx.test.espresso:espresso-idling-resource:3.2.0"
const val testRunner = "androidx.test:runner:1.1.0"
const val testRules = "androidx.test:rules:1.1.0"
}
Loading

0 comments on commit 661733d

Please sign in to comment.