mirror of
https://github.com/melihaksoy/Android-Kotlin-Modulerized-CleanArchitecture.git
synced 2026-01-11 20:00:32 +01:00
Dependency upgrades, running on AS 4.1
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
package com.melih.rocketscience
|
||||
|
||||
import com.melih.core.di.DaggerCoreComponent
|
||||
import com.melih.launches.data.LaunchDetailItem
|
||||
import com.melih.rocketscience.di.DaggerAppComponent
|
||||
import dagger.android.AndroidInjector
|
||||
import dagger.android.DaggerApplication
|
||||
import timber.log.Timber
|
||||
import javax.inject.Inject
|
||||
|
||||
class App : DaggerApplication() {
|
||||
override fun applicationInjector(): AndroidInjector<out DaggerApplication> =
|
||||
@@ -14,6 +16,8 @@ class App : DaggerApplication() {
|
||||
.create(this)
|
||||
)
|
||||
|
||||
@Inject
|
||||
lateinit var item: LaunchDetailItem
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
package com.melih.rocketscience.di
|
||||
|
||||
import com.melih.detail.di.DetailContributor
|
||||
import com.melih.launches.data.LaunchDetailItem
|
||||
import com.melih.launches.di.LaunchesContributor
|
||||
import com.melih.rocketscience.MainActivity
|
||||
import dagger.Module
|
||||
import dagger.Provides
|
||||
import dagger.android.ContributesAndroidInjector
|
||||
|
||||
@Module
|
||||
@@ -16,4 +18,12 @@ abstract class AppModule {
|
||||
DetailContributor::class]
|
||||
)
|
||||
abstract fun mainActivity(): MainActivity
|
||||
|
||||
@Module
|
||||
companion object {
|
||||
|
||||
@JvmStatic
|
||||
@Provides
|
||||
fun provdeSomeObject() = LaunchDetailItem(10, "", "Rocket", "Desc")
|
||||
}
|
||||
}
|
||||
|
||||
14
build.gradle
14
build.gradle
@@ -1,18 +1,18 @@
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
buildscript {
|
||||
ext.kotlin_version = '1.3.60'
|
||||
ext.nav_version = '2.2.0-beta01'
|
||||
ext.kotlin_version = '1.3.71'
|
||||
ext.nav_version = '2.3.0-alpha04'
|
||||
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
maven { url 'https://dl.bintray.com/kotlin/kotlin-eap' }
|
||||
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:4.0.0-alpha07'
|
||||
classpath 'com.android.tools.build:gradle:4.1.0-alpha04'
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
classpath "org.jetbrains.dokka:dokka-android-gradle-plugin:0.9.18"
|
||||
classpath "de.mannodermaus.gradle.plugins:android-junit5:1.5.1.0"
|
||||
classpath "de.mannodermaus.gradle.plugins:android-junit5:1.6.0.1-SNAPSHOT"
|
||||
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$nav_version"
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
// in the individual module build.gradle files
|
||||
@@ -20,8 +20,8 @@ buildscript {
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'io.gitlab.arturbosch.detekt' version '1.1.1'
|
||||
id 'org.jetbrains.dokka' version '0.9.18'
|
||||
id 'io.gitlab.arturbosch.detekt' version '1.7.2'
|
||||
id 'org.jetbrains.dokka' version '0.10.1'
|
||||
id 'jacoco'
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ import dagger.android.DispatchingAndroidInjector
|
||||
import dagger.android.HasAndroidInjector
|
||||
import dagger.android.support.AndroidSupportInjection
|
||||
import javax.inject.Inject
|
||||
import kotlin.properties.Delegates
|
||||
|
||||
|
||||
/**
|
||||
@@ -24,11 +25,11 @@ abstract class BaseDaggerFragment<T : ViewDataBinding> : BaseFragment<T>(), HasA
|
||||
|
||||
//region Properties
|
||||
|
||||
@get:Inject
|
||||
internal var androidInjector: DispatchingAndroidInjector<Any>? = null
|
||||
@Inject
|
||||
protected lateinit var androidInjector: DispatchingAndroidInjector<Any>
|
||||
|
||||
@Inject
|
||||
lateinit var viewModelFactory: ViewModelFactory
|
||||
protected lateinit var viewModelFactory: ViewModelFactory
|
||||
//endregion
|
||||
|
||||
//region Functions
|
||||
@@ -38,6 +39,6 @@ abstract class BaseDaggerFragment<T : ViewDataBinding> : BaseFragment<T>(), HasA
|
||||
super.onAttach(context)
|
||||
}
|
||||
|
||||
override fun androidInjector(): AndroidInjector<Any>? = androidInjector
|
||||
override fun androidInjector(): AndroidInjector<Any> = androidInjector
|
||||
//endregion
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ const val INITIAL_PAGE = 0
|
||||
* It's cancelled automatically when source factory [invalidates][invalidate] the source.
|
||||
*/
|
||||
|
||||
@UseExperimental(ExperimentalCoroutinesApi::class)
|
||||
@OptIn(ExperimentalCoroutinesApi::class)
|
||||
abstract class BasePagingDataSource<R : ViewEntity> : PageKeyedDataSource<Int, R>() {
|
||||
|
||||
//region Abstractions
|
||||
|
||||
@@ -13,7 +13,7 @@ import org.junit.jupiter.api.AfterEach
|
||||
import org.junit.jupiter.api.BeforeEach
|
||||
import kotlin.coroutines.suspendCoroutine
|
||||
|
||||
@UseExperimental(ExperimentalCoroutinesApi::class)
|
||||
@OptIn(ExperimentalCoroutinesApi::class)
|
||||
abstract class BaseTestWithMainThread {
|
||||
|
||||
private val dispatcher = TestCoroutineDispatcher()
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
@file:UseExperimental(ExperimentalCoroutinesApi::class)
|
||||
|
||||
package com.melih.core.paging
|
||||
|
||||
import androidx.paging.PageKeyedDataSource
|
||||
|
||||
@@ -12,7 +12,7 @@ import kotlinx.coroutines.flow.flowOn
|
||||
/**
|
||||
* Base use case that wraps [suspending][suspend] [run] function with [flow][Flow] and returns it for later usage.
|
||||
*/
|
||||
@UseExperimental(ExperimentalCoroutinesApi::class)
|
||||
@OptIn(ExperimentalCoroutinesApi::class)
|
||||
abstract class BaseInteractor<T, in P : InteractorParameters> {
|
||||
|
||||
//region Abstractions
|
||||
|
||||
@@ -15,7 +15,6 @@ import org.amshove.kluent.shouldEqualTo
|
||||
import org.junit.jupiter.api.Test
|
||||
import java.util.ArrayDeque
|
||||
|
||||
@UseExperimental(ExperimentalCoroutinesApi::class)
|
||||
class BaseInteractorTest {
|
||||
|
||||
val testInteractor = spyk(TestInteractor())
|
||||
|
||||
@@ -20,6 +20,10 @@ class DetailViewModel @Inject constructor(
|
||||
val rocketName = map(successData) {
|
||||
it.rocketName
|
||||
}
|
||||
get() {
|
||||
loadData()
|
||||
return field
|
||||
}
|
||||
|
||||
val description = map(successData) {
|
||||
it.missionDescription
|
||||
@@ -30,10 +34,6 @@ class DetailViewModel @Inject constructor(
|
||||
}
|
||||
//endregion
|
||||
|
||||
init {
|
||||
loadData()
|
||||
}
|
||||
|
||||
//region Functions
|
||||
|
||||
/**
|
||||
|
||||
@@ -8,7 +8,7 @@ import kotlinx.coroutines.test.setMain
|
||||
import org.junit.jupiter.api.AfterEach
|
||||
import org.junit.jupiter.api.BeforeEach
|
||||
|
||||
@UseExperimental(ExperimentalCoroutinesApi::class)
|
||||
@OptIn(ExperimentalCoroutinesApi::class)
|
||||
abstract class BaseTestWithMainThread {
|
||||
|
||||
protected val dispatcher = TestCoroutineDispatcher()
|
||||
|
||||
@@ -22,7 +22,6 @@ import org.junit.jupiter.api.Test
|
||||
*
|
||||
* See [testing documentation](http://d.android.com/tools/testing).
|
||||
*/
|
||||
@UseExperimental(ExperimentalCoroutinesApi::class)
|
||||
class DetailViewModelTest : BaseTestWithMainThread() {
|
||||
|
||||
private val getLaunchDetails: GetLaunchDetails<LaunchDetailItem> = mockk(relaxed = true)
|
||||
|
||||
@@ -14,6 +14,7 @@ import com.melih.launches.data.LaunchItem
|
||||
import com.melih.launches.databinding.LaunchesBinding
|
||||
import com.melih.launches.ui.adapters.LaunchesAdapter
|
||||
import com.melih.launches.ui.vm.LaunchesViewModel
|
||||
import javax.inject.Inject
|
||||
|
||||
class LaunchesFragment : BaseDaggerFragment<LaunchesBinding>(), SwipeRefreshLayout.OnRefreshListener {
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@ class LaunchesPagingSource @Inject constructor(
|
||||
|
||||
//region Functions
|
||||
|
||||
@UseExperimental(ExperimentalCoroutinesApi::class)
|
||||
override fun loadDataForPage(page: Int) =
|
||||
getLaunches(
|
||||
getLaunchesParams.copy(
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
@file:UseExperimental(ExperimentalCoroutinesApi::class)
|
||||
|
||||
package com.melih.launches
|
||||
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
@@ -10,7 +8,7 @@ import kotlinx.coroutines.test.setMain
|
||||
import org.junit.jupiter.api.AfterEach
|
||||
import org.junit.jupiter.api.BeforeEach
|
||||
|
||||
@UseExperimental(ExperimentalCoroutinesApi::class)
|
||||
@OptIn(ExperimentalCoroutinesApi::class)
|
||||
abstract class BaseTestWithMainThread {
|
||||
|
||||
protected val dispatcher = TestCoroutineDispatcher()
|
||||
|
||||
4
gradle/wrapper/gradle-wrapper.properties
vendored
4
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,6 +1,6 @@
|
||||
#Wed Jan 01 15:32:57 CET 2020
|
||||
#Tue Mar 31 10:39:09 CEST 2020
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1-milestone-2-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-rc-1-bin.zip
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
apply plugin: 'io.gitlab.arturbosch.detekt'
|
||||
|
||||
detekt {
|
||||
toolVersion = "1.0.0"
|
||||
failFast = true
|
||||
config = files("$rootProject.projectDir/default-detekt-config.yml")
|
||||
filters = ".*/resources/.*,.*/build/.*"
|
||||
|
||||
reports {
|
||||
html {
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
apply plugin: 'org.jetbrains.dokka-android'
|
||||
apply plugin: 'org.jetbrains.dokka'
|
||||
|
||||
dokka {
|
||||
outputFormat = "html"
|
||||
outputDirectory = "$rootProject.projectDir/reports/javadoc"
|
||||
jdkVersion = 8
|
||||
|
||||
reportUndocumented = true
|
||||
skipEmptyPackages = true
|
||||
configuration {
|
||||
jdkVersion = 8
|
||||
|
||||
reportUndocumented = true
|
||||
skipEmptyPackages = true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,32 +4,32 @@ ext {
|
||||
minSdkVersion : 21,
|
||||
compileSdkVersion : 29,
|
||||
targetSdkVersion : 29,
|
||||
buildToolsVersion : "29.0.2",
|
||||
buildToolsVersion : "29.0.3",
|
||||
appCompatVersion : "1.1.0",
|
||||
lifecycleVersion : "2.2.0-alpha05",
|
||||
fragmentVersion : "1.2.0-rc01",
|
||||
workManagerVersion : "2.3.0-alpha03",
|
||||
constraintLayoutVesion : "2.0.0-beta3",
|
||||
lifecycleVersion : "2.2.0",
|
||||
fragmentVersion : "1.3.0-alpha02",
|
||||
workManagerVersion : "2.4.0-alpha01",
|
||||
constraintLayoutVesion : "2.0.0-beta4",
|
||||
cardViewVersion : "1.0.0",
|
||||
recyclerViewVersion : "1.1.0-rc01",
|
||||
recyclerViewVersion : "1.2.0-alpha01",
|
||||
pagingVersion : "2.1.0",
|
||||
viewPagerVersion : "1.0.0-rc01",
|
||||
materialVersion : "1.1.0-alpha09",
|
||||
swipeRefreshLayoutVersion: "1.1.0-alpha03",
|
||||
viewPagerVersion : "1.0.0",
|
||||
materialVersion : "1.2.0-alpha05",
|
||||
swipeRefreshLayoutVersion: "1.1.0-beta01",
|
||||
collectionVersion : "1.1.0",
|
||||
roomVersion : "2.2.0",
|
||||
daggerVersion : "2.25.2",
|
||||
okHttpVersion : "4.2.1",
|
||||
retrofitVersion : "2.6.2",
|
||||
roomVersion : "2.2.5",
|
||||
daggerVersion : "2.27",
|
||||
okHttpVersion : "4.4.0",
|
||||
retrofitVersion : "2.8.1",
|
||||
picassoVersion : "2.71828",
|
||||
moshiVersion : "1.8.0",
|
||||
coroutinesVersion : "1.3.2",
|
||||
leakCanaryVersion : "2.0-beta-3",
|
||||
moshiVersion : "1.9.2",
|
||||
coroutinesVersion : "1.3.5",
|
||||
leakCanaryVersion : "2.2",
|
||||
timberVersion : "4.7.1",
|
||||
jUnitVersion : "5.5.2",
|
||||
jUnitVersion : "5.6.0",
|
||||
espressoVersion : "3.2.0",
|
||||
mockkVersion : "1.9.3",
|
||||
kluentVersion : "1.53",
|
||||
kluentVersion : "1.60",
|
||||
]
|
||||
|
||||
libraries = [
|
||||
|
||||
Reference in New Issue
Block a user