Skip to content

Commit

Permalink
Update gradle & dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
skydoves committed Sep 1, 2019
1 parent 8a9ba12 commit 77d46c2
Show file tree
Hide file tree
Showing 9 changed files with 71 additions and 65 deletions.
8 changes: 2 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,10 @@ android {
dependencies {
// support library
implementation "androidx.appcompat:appcompat:$accompatVersion"
implementation "androidx.activity:activity:$androidActivity"
implementation "androidx.activity:activity-ktx:$androidActivity"
implementation "androidx.fragment:fragment:$androidFragment"
implementation "androidx.fragment:fragment-ktx:$androidFragment"
implementation "com.google.android.material:material:$materialVersion"
implementation "androidx.palette:palette:$androidxVersion"
implementation "androidx.cardview:cardview:$androidxVersion"
implementation "androidx.recyclerview:recyclerview:$recyclerVersion"
implementation "com.google.android.material:material:$materialVersion"

// kotlin
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion"
Expand All @@ -78,7 +74,7 @@ dependencies {
kapt "androidx.room:room-compiler:$roomVersion"
testImplementation "androidx.arch.core:core-testing:$archCompomentVersion"

// Koin for Android
// koin
implementation "org.koin:koin-android:$koinVersion"
implementation "org.koin:koin-android-scope:$koinVersion"
implementation "org.koin:koin-android-viewmodel:$koinVersion"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ package com.skydoves.themovies2.api
import okhttp3.ResponseBody
import retrofit2.Response

@Suppress("unused", "HasPlatformType", "SpellCheckingInspection", "MemberVisibilityCanBePrivate")
@Suppress("unused")
sealed class ApiResponse<out T> {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import okhttp3.Response
internal class RequestInterceptor : Interceptor {
override fun intercept(chain: Interceptor.Chain): Response {
val originalRequest = chain.request()
val originalUrl = originalRequest.url()
val originalUrl = originalRequest.url
val url = originalUrl.newBuilder()
.addQueryParameter("api_key", BuildConfig.TMDB_API_KEY)
.build()
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class MovieListFragment : ViewModelFragment(), MovieListViewHolder.Delegate {
loadMore = { loadMore(it) },
onLast = { false }
).apply {
threshold = 0
threshold = 4
currentPage = 1
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class PersonListFragment : ViewModelFragment(), PeopleViewHolder.Delegate {
loadMore = { loadMore(it) },
onLast = { false }
).apply {
threshold = 0
threshold = 4
currentPage = 1
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class TvListFragment : ViewModelFragment(), TvListViewHolder.Delegate {
loadMore = { loadMore(it) },
onLast = { false }
).apply {
threshold = 0
threshold = 4
currentPage = 1
}
}
Expand Down
73 changes: 50 additions & 23 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,54 +1,81 @@

apply from: './versionsPlugin.gradle'

buildscript {
repositories {
google()
jcenter()
}

ext {
// sdk and tools
compileSdkVersion = 29
minSdkVersion = 16
targetSdkVersion = 29

// application dependencies
// build tool
gradleBuildTool = '3.5.0'

// support library
androidxVersion = '1.0.0'
accompatVersion = '1.1.0-rc01'
androidActivity = '1.1.0-alpha02'
androidFragment = '1.2.0-alpha02'
materialVersion = '1.1.0-alpha09'
recyclerVersion = '1.1.0-beta03'
materialVersion = '1.1.0-alpha09'

// kotlin
kotlinVersion = '1.3.50'
ankoVersion = '0.10.8'
coroutinesVersion = '1.3.0'

// architecture components
archCompomentVersion = '2.0.0'
roomVersion = '2.2.0-beta01'
lifecycleVersion = '2.2.0-alpha03'
roomVersion = '2.2.0-beta01'

// koin
koinVersion = '2.0.1'
retrofitVersion = '2.3.0'
okhttpVersion = '3.11.0'
gsonVersion = '2.8.2'
timberVersion = '4.7.1'
stethoVersion = '1.5.1'

// coroutines
coroutinesVersion = '1.3.0'

// network
retrofitVersion = '2.6.0'
okhttpVersion = '4.1.0'
gsonVersion = '2.8.5'

// glide
glideVersion = '4.9.0'
glidePaletteVersion = '2.1.2'

// adapter
baseAdapterVersion = '0.1.3'
androidTagViewVersion = '1.1.4'

// debugging
timberVersion = '4.7.1'
stethoVersion = '1.5.1'

// custom view
androidTagViewVersion = '1.1.7'
expandableTextViewVersion = '0.1.4'
mockWebServerVersion = '3.9.0'
mockitoKotlinVersion = '2.0.0-RC1'

// unit test
junitVersion = '4.12'
espressoVersion = '3.1.1'
jacocoVersion = '0.8.1'
androidxTest = '1.1.0'
androidxTest = '1.1.1'
androidxTestRules = '1.2.0-alpha04'
spotlessVersion = '3.24.2'
}
mockWebServerVersion = '3.9.0'
mockitoKotlinVersion = '2.1.0'
espressoVersion = '3.2.0'
jacocoVersion = '0.8.4'

repositories {
google()
jcenter()
// plugins
spotlessVersion = '3.24.2'
versionPlugin = '0.23.0'
}

dependencies {
classpath "com.android.tools.build:gradle:3.5.0"
classpath "com.android.tools.build:gradle:$gradleBuildTool"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath "com.diffplug.spotless:spotless-plugin-gradle:$spotlessVersion"
classpath "com.github.ben-manes:gradle-versions-plugin:$versionPlugin"
classpath "org.jacoco:org.jacoco.core:$jacocoVersion"
}
}
Expand Down
14 changes: 14 additions & 0 deletions versionsPlugin.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apply plugin: "com.github.ben-manes.versions"

dependencyUpdates.resolutionStrategy {
componentSelection { rules ->
rules.all { ComponentSelection selection ->
boolean rejected = ['alpha', 'beta', 'rc', 'cr', 'm'].any { qualifier ->
selection.candidate.version ==~ /(?i).*[.-]${qualifier}[.\d-]*/
}
if (rejected) {
selection.reject('Not stable')
}
}
}
}

0 comments on commit 77d46c2

Please sign in to comment.