mirror of
https://github.com/melihaksoy/Android-Kotlin-Modulerized-CleanArchitecture.git
synced 2026-03-22 17:39:58 +01:00
Library versions bumped. Closes #27.
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||||
buildscript {
|
buildscript {
|
||||||
ext.kotlin_version = '1.3.41'
|
ext.kotlin_version = '1.3.41'
|
||||||
ext.nav_version = '2.1.0-alpha06'
|
ext.nav_version = '2.2.0-alpha01'
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
google()
|
google()
|
||||||
@@ -20,7 +20,7 @@ buildscript {
|
|||||||
}
|
}
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id "io.gitlab.arturbosch.detekt" version "1.0.0-RC14"
|
id "io.gitlab.arturbosch.detekt" version "1.0.0"
|
||||||
id "org.jetbrains.dokka" version "0.9.18"
|
id "org.jetbrains.dokka" version "0.9.18"
|
||||||
id "jacoco"
|
id "jacoco"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,12 +2,11 @@ package com.melih.core.base.lifecycle
|
|||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import androidx.databinding.ViewDataBinding
|
import androidx.databinding.ViewDataBinding
|
||||||
import androidx.fragment.app.Fragment
|
|
||||||
import com.melih.core.di.ViewModelFactory
|
import com.melih.core.di.ViewModelFactory
|
||||||
import dagger.android.AndroidInjector
|
import dagger.android.AndroidInjector
|
||||||
import dagger.android.DispatchingAndroidInjector
|
import dagger.android.DispatchingAndroidInjector
|
||||||
|
import dagger.android.HasAndroidInjector
|
||||||
import dagger.android.support.AndroidSupportInjection
|
import dagger.android.support.AndroidSupportInjection
|
||||||
import dagger.android.support.HasSupportFragmentInjector
|
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
|
|
||||||
@@ -21,12 +20,12 @@ import javax.inject.Inject
|
|||||||
* in the project. It's injected by map of view models that this app is serving. Check [ViewModelFactory]
|
* in the project. It's injected by map of view models that this app is serving. Check [ViewModelFactory]
|
||||||
* to see how it works.
|
* to see how it works.
|
||||||
*/
|
*/
|
||||||
abstract class BaseDaggerFragment<T : ViewDataBinding> : BaseFragment<T>(), HasSupportFragmentInjector {
|
abstract class BaseDaggerFragment<T : ViewDataBinding> : BaseFragment<T>(), HasAndroidInjector {
|
||||||
|
|
||||||
// region Properties
|
// region Properties
|
||||||
|
|
||||||
@get:Inject
|
@get:Inject
|
||||||
internal var childFragmentInjector: DispatchingAndroidInjector<Fragment>? = null
|
internal var androidInjector: DispatchingAndroidInjector<Any>? = null
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
lateinit var viewModelFactory: ViewModelFactory
|
lateinit var viewModelFactory: ViewModelFactory
|
||||||
@@ -39,6 +38,6 @@ abstract class BaseDaggerFragment<T : ViewDataBinding> : BaseFragment<T>(), HasS
|
|||||||
super.onAttach(context)
|
super.onAttach(context)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun supportFragmentInjector(): AndroidInjector<Fragment>? = childFragmentInjector
|
override fun androidInjector(): AndroidInjector<Any>? = androidInjector
|
||||||
// endregion
|
// endregion
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package com.melih.detail.di
|
package com.melih.detail.di
|
||||||
|
|
||||||
import com.melih.detail.di.modules.DetailBinds
|
import com.melih.detail.di.modules.DetailFragmentModule
|
||||||
import com.melih.detail.di.modules.DetailProvides
|
|
||||||
import com.melih.detail.ui.DetailFragment
|
import com.melih.detail.ui.DetailFragment
|
||||||
import com.melih.list.di.scopes.DetailFragmentScope
|
import com.melih.list.di.scopes.DetailFragmentScope
|
||||||
import dagger.Module
|
import dagger.Module
|
||||||
@@ -16,10 +15,7 @@ abstract class DetailContributor {
|
|||||||
// region Contributes
|
// region Contributes
|
||||||
|
|
||||||
@ContributesAndroidInjector(
|
@ContributesAndroidInjector(
|
||||||
modules = [
|
modules = [DetailFragmentModule::class]
|
||||||
DetailBinds::class,
|
|
||||||
DetailProvides::class
|
|
||||||
]
|
|
||||||
)
|
)
|
||||||
@DetailFragmentScope
|
@DetailFragmentScope
|
||||||
abstract fun detailFragment(): DetailFragment
|
abstract fun detailFragment(): DetailFragment
|
||||||
|
|||||||
@@ -1,20 +0,0 @@
|
|||||||
package com.melih.detail.di.modules
|
|
||||||
|
|
||||||
import androidx.lifecycle.ViewModel
|
|
||||||
import com.melih.core.di.keys.ViewModelKey
|
|
||||||
import com.melih.detail.ui.DetailViewModel
|
|
||||||
import dagger.Binds
|
|
||||||
import dagger.Module
|
|
||||||
import dagger.multibindings.IntoMap
|
|
||||||
|
|
||||||
@Module
|
|
||||||
abstract class DetailBinds {
|
|
||||||
|
|
||||||
// region ViewModels
|
|
||||||
|
|
||||||
@Binds
|
|
||||||
@IntoMap
|
|
||||||
@ViewModelKey(DetailViewModel::class)
|
|
||||||
abstract fun detailViewModel(detailViewModel: DetailViewModel): ViewModel
|
|
||||||
// endregion
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
package com.melih.detail.di.modules
|
||||||
|
|
||||||
|
import androidx.lifecycle.ViewModel
|
||||||
|
import androidx.navigation.fragment.navArgs
|
||||||
|
import com.melih.core.di.keys.ViewModelKey
|
||||||
|
import com.melih.detail.ui.DetailFragment
|
||||||
|
import com.melih.detail.ui.DetailFragmentArgs
|
||||||
|
import com.melih.detail.ui.DetailViewModel
|
||||||
|
import com.melih.repository.interactors.GetLaunchDetails
|
||||||
|
import dagger.Binds
|
||||||
|
import dagger.Module
|
||||||
|
import dagger.Provides
|
||||||
|
import dagger.multibindings.IntoMap
|
||||||
|
|
||||||
|
@Module
|
||||||
|
abstract class DetailFragmentModule {
|
||||||
|
|
||||||
|
// region ViewModels
|
||||||
|
|
||||||
|
@Binds
|
||||||
|
@IntoMap
|
||||||
|
@ViewModelKey(DetailViewModel::class)
|
||||||
|
abstract fun detailViewModel(detailViewModel: DetailViewModel): ViewModel
|
||||||
|
// endregion
|
||||||
|
|
||||||
|
@Module
|
||||||
|
companion object {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Provides launch detail params
|
||||||
|
*/
|
||||||
|
@Provides
|
||||||
|
@JvmStatic
|
||||||
|
fun provideGetLaunchDetailParams(fragment: DetailFragment): GetLaunchDetails.Params {
|
||||||
|
val args: DetailFragmentArgs by fragment.navArgs()
|
||||||
|
return GetLaunchDetails.Params(args.launchId)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
package com.melih.detail.di.modules
|
|
||||||
|
|
||||||
import androidx.navigation.fragment.navArgs
|
|
||||||
import com.melih.detail.ui.DetailFragment
|
|
||||||
import com.melih.detail.ui.DetailFragmentArgs
|
|
||||||
import com.melih.repository.interactors.GetLaunchDetails
|
|
||||||
import dagger.Module
|
|
||||||
import dagger.Provides
|
|
||||||
|
|
||||||
@Module
|
|
||||||
class DetailProvides {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Provides launch detail params
|
|
||||||
*/
|
|
||||||
@Provides
|
|
||||||
fun provideGetLaunchDetailParams(fragment: DetailFragment): GetLaunchDetails.Params {
|
|
||||||
val args: DetailFragmentArgs by fragment.navArgs()
|
|
||||||
return GetLaunchDetails.Params(args.launchId)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
package com.melih.list.di
|
package com.melih.list.di
|
||||||
|
|
||||||
import com.melih.list.di.modules.LaunchesBinds
|
import com.melih.list.di.modules.LaunchesFragmentModule
|
||||||
import com.melih.list.di.modules.LaunchesProvides
|
|
||||||
import com.melih.list.di.scopes.LaunchesFragmentScope
|
import com.melih.list.di.scopes.LaunchesFragmentScope
|
||||||
import com.melih.list.ui.LaunchesFragment
|
import com.melih.list.ui.LaunchesFragment
|
||||||
import dagger.Module
|
import dagger.Module
|
||||||
@@ -16,10 +15,7 @@ abstract class LaunchesContributor {
|
|||||||
// region Contributes
|
// region Contributes
|
||||||
|
|
||||||
@ContributesAndroidInjector(
|
@ContributesAndroidInjector(
|
||||||
modules = [
|
modules = [LaunchesFragmentModule::class]
|
||||||
LaunchesProvides::class,
|
|
||||||
LaunchesBinds::class
|
|
||||||
]
|
|
||||||
)
|
)
|
||||||
@LaunchesFragmentScope
|
@LaunchesFragmentScope
|
||||||
abstract fun launchesFragment(): LaunchesFragment
|
abstract fun launchesFragment(): LaunchesFragment
|
||||||
|
|||||||
@@ -1,20 +0,0 @@
|
|||||||
package com.melih.list.di.modules
|
|
||||||
|
|
||||||
import androidx.lifecycle.ViewModel
|
|
||||||
import com.melih.core.di.keys.ViewModelKey
|
|
||||||
import com.melih.list.ui.vm.LaunchesViewModel
|
|
||||||
import dagger.Binds
|
|
||||||
import dagger.Module
|
|
||||||
import dagger.multibindings.IntoMap
|
|
||||||
|
|
||||||
@Module
|
|
||||||
abstract class LaunchesBinds {
|
|
||||||
|
|
||||||
// region ViewModels
|
|
||||||
|
|
||||||
@Binds
|
|
||||||
@IntoMap
|
|
||||||
@ViewModelKey(LaunchesViewModel::class)
|
|
||||||
abstract fun listViewModel(listViewModel: LaunchesViewModel): ViewModel
|
|
||||||
// endregion
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
package com.melih.list.di.modules
|
||||||
|
|
||||||
|
import androidx.lifecycle.ViewModel
|
||||||
|
import androidx.paging.Config
|
||||||
|
import com.melih.core.di.keys.ViewModelKey
|
||||||
|
import com.melih.list.ui.vm.LaunchesViewModel
|
||||||
|
import com.melih.repository.interactors.DEFAULT_LAUNCHES_AMOUNT
|
||||||
|
import com.melih.repository.interactors.GetLaunches
|
||||||
|
import dagger.Binds
|
||||||
|
import dagger.Module
|
||||||
|
import dagger.Provides
|
||||||
|
import dagger.multibindings.IntoMap
|
||||||
|
|
||||||
|
@Module
|
||||||
|
abstract class LaunchesFragmentModule {
|
||||||
|
|
||||||
|
// region ViewModels
|
||||||
|
|
||||||
|
@Binds
|
||||||
|
@IntoMap
|
||||||
|
@ViewModelKey(LaunchesViewModel::class)
|
||||||
|
abstract fun listViewModel(listViewModel: LaunchesViewModel): ViewModel
|
||||||
|
// endregion
|
||||||
|
|
||||||
|
@Module
|
||||||
|
companion object {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Provides lauches, using default value of 15
|
||||||
|
*/
|
||||||
|
@Provides
|
||||||
|
@JvmStatic
|
||||||
|
fun provideGetLaunchesParams() = GetLaunches.Params(page = 0)
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
@JvmStatic
|
||||||
|
fun getPagingConfig() = Config(
|
||||||
|
DEFAULT_LAUNCHES_AMOUNT,
|
||||||
|
prefetchDistance = 2,
|
||||||
|
enablePlaceholders = false
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
package com.melih.list.di.modules
|
|
||||||
|
|
||||||
import androidx.paging.Config
|
|
||||||
import com.melih.repository.interactors.DEFAULT_LAUNCHES_AMOUNT
|
|
||||||
import com.melih.repository.interactors.GetLaunches
|
|
||||||
import dagger.Module
|
|
||||||
import dagger.Provides
|
|
||||||
|
|
||||||
@Module
|
|
||||||
class LaunchesProvides {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Provides lauches, using default value of 15
|
|
||||||
*/
|
|
||||||
@Provides
|
|
||||||
fun provideGetLaunchesParams() = GetLaunches.Params(page = 0)
|
|
||||||
|
|
||||||
@Provides
|
|
||||||
fun getPagingConfig() = Config(
|
|
||||||
DEFAULT_LAUNCHES_AMOUNT,
|
|
||||||
prefetchDistance = 2,
|
|
||||||
enablePlaceholders = false
|
|
||||||
)
|
|
||||||
}
|
|
||||||
@@ -9,26 +9,26 @@ ext {
|
|||||||
appCompatVersion : "1.1.0-alpha04",
|
appCompatVersion : "1.1.0-alpha04",
|
||||||
lifecycleVersion : "2.2.0-alpha02",
|
lifecycleVersion : "2.2.0-alpha02",
|
||||||
fragmentVersion : "1.2.0-alpha01",
|
fragmentVersion : "1.2.0-alpha01",
|
||||||
workManagerVersion : "2.1.0-alpha03",
|
workManagerVersion : "2.2.0-rc01",
|
||||||
constraintLayoutVesion: "2.0.0-beta1",
|
constraintLayoutVesion: "2.0.0-beta1",
|
||||||
cardViewVersion : "1.0.0",
|
cardViewVersion : "1.0.0",
|
||||||
recyclerViewVersion : "1.1.0-alpha06",
|
recyclerViewVersion : "1.1.0-beta02",
|
||||||
pagingVersion : "2.1.0",
|
pagingVersion : "2.1.0",
|
||||||
viewPagerVersion : "1.0.0-alpha05",
|
viewPagerVersion : "1.0.0-beta03",
|
||||||
collectionVersion : "1.1.0",
|
collectionVersion : "1.1.0",
|
||||||
roomVersion : "2.1.0",
|
roomVersion : "2.2.0-alpha02",
|
||||||
daggerVersion : "2.22.1",
|
daggerVersion : "2.24",
|
||||||
okHttpVersion : "4.0.0",
|
okHttpVersion : "4.0.1",
|
||||||
retrofitVersion : "2.6.0",
|
retrofitVersion : "2.6.1",
|
||||||
picassoVersion : "2.71828",
|
picassoVersion : "2.71828",
|
||||||
moshiVersion : "1.8.0",
|
moshiVersion : "1.8.0",
|
||||||
coroutinesVersion : "1.3.0-M2",
|
coroutinesVersion : "1.3.0-RC2",
|
||||||
leakCanaryVersion : "2.0-alpha-2",
|
leakCanaryVersion : "2.0-beta-2",
|
||||||
timberVersion : "4.7.1",
|
timberVersion : "4.7.1",
|
||||||
jUnitVersion : "5.5.0",
|
jUnitVersion : "5.5.1",
|
||||||
espressoVersion : "3.2.0",
|
espressoVersion : "3.2.0",
|
||||||
mockkVersion : "1.9.3",
|
mockkVersion : "1.9.3",
|
||||||
kluentVersion : "1.49",
|
kluentVersion : "1.53",
|
||||||
]
|
]
|
||||||
|
|
||||||
libraries = [
|
libraries = [
|
||||||
@@ -56,11 +56,11 @@ ext {
|
|||||||
],
|
],
|
||||||
|
|
||||||
lifecycle : "androidx.lifecycle:lifecycle-extensions:${versions.lifecycleVersion}",
|
lifecycle : "androidx.lifecycle:lifecycle-extensions:${versions.lifecycleVersion}",
|
||||||
liveDataKTX : "androidx.lifecycle:lifecycle-livedata-ktx:${versions.lifecycleVersion}",
|
liveDataKTX : "androidx.lifecycle:lifecycle-livedata-ktx:${versions.lifecycleVersion}",
|
||||||
workManager : "androidx.work:work-runtime-ktx:${versions.workManagerVersion}",
|
workManager : "androidx.work:work-runtime-ktx:${versions.workManagerVersion}",
|
||||||
paging : "androidx.paging:paging-runtime-ktx:${versions.pagingVersion}",
|
paging : "androidx.paging:paging-runtime-ktx:${versions.pagingVersion}",
|
||||||
viewPager : "androidx.viewpager2:viewpager2:${versions.viewPagerVersion}",
|
viewPager : "androidx.viewpager2:viewpager2:${versions.viewPagerVersion}",
|
||||||
collection : "androidx.collection:collection:${versions.collectionVersion}",
|
collection : "androidx.collection:collection-ktx:${versions.collectionVersion}",
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Kotlin
|
* Kotlin
|
||||||
@@ -127,7 +127,7 @@ ext {
|
|||||||
"com.google.dagger:dagger-compiler:${versions.daggerVersion}",
|
"com.google.dagger:dagger-compiler:${versions.daggerVersion}",
|
||||||
"com.google.dagger:dagger-android-processor:${versions.daggerVersion}"
|
"com.google.dagger:dagger-android-processor:${versions.daggerVersion}"
|
||||||
],
|
],
|
||||||
moshi : "com.squareup.moshi:moshi-kotlin-codegen:${versions.moshiVersion}"
|
moshi : "com.squareup.moshi:moshi-kotlin-codegen:${versions.moshiVersion}"
|
||||||
]
|
]
|
||||||
|
|
||||||
testLibraries = [
|
testLibraries = [
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
apply plugin: 'io.gitlab.arturbosch.detekt'
|
apply plugin: 'io.gitlab.arturbosch.detekt'
|
||||||
|
|
||||||
detekt {
|
detekt {
|
||||||
toolVersion = "1.0.0-RC14"
|
toolVersion = "1.0.0"
|
||||||
config = files("$rootProject.projectDir/default-detekt-config.yml")
|
config = files("$rootProject.projectDir/default-detekt-config.yml")
|
||||||
filters = ".*/resources/.*,.*/build/.*"
|
filters = ".*/resources/.*,.*/build/.*"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user