Fixes & early adoptation to AS 4.0

This commit is contained in:
Melih Aksoy
2019-11-19 17:08:35 +01:00
parent a6fec53b83
commit a68dac7b91
4 changed files with 16 additions and 11 deletions

View File

@@ -1,15 +1,15 @@
// 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.50' ext.kotlin_version = '1.3.60'
ext.nav_version = '2.2.0-beta01' ext.nav_version = '2.2.0-beta01'
repositories { repositories {
google() google()
jcenter() jcenter()
maven { url 'https://dl.bintray.com/kotlin/kotlin-eap' }
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:3.5.1' classpath 'com.android.tools.build:gradle:4.0.0-alpha03'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.dokka:dokka-android-gradle-plugin:0.9.18" 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.5.1.0"
@@ -29,14 +29,10 @@ allprojects {
repositories { repositories {
google() google()
jcenter() jcenter()
maven { url 'https://dl.bintray.com/kotlin/kotlin-eap' }
} }
} }
task clean(type: Delete) {
delete rootProject.buildDir
}
task removeReports(type: Delete) { task removeReports(type: Delete) {
delete fileTree(rootProject.projectDir.path + "/reports") { delete fileTree(rootProject.projectDir.path + "/reports") {
include '**/*.*' include '**/*.*'

View File

@@ -1,13 +1,18 @@
package com.melih.detail package com.melih.detail
import androidx.lifecycle.viewModelScope
import com.melih.detail.ui.DetailViewModel import com.melih.detail.ui.DetailViewModel
import com.melih.interactors.GetLaunchDetails import com.melih.interactors.GetLaunchDetails
import com.melih.launches.data.LaunchDetailItem import com.melih.launches.data.LaunchDetailItem
import io.mockk.every
import io.mockk.mockk import io.mockk.mockk
import io.mockk.slot import io.mockk.slot
import io.mockk.spyk import io.mockk.spyk
import io.mockk.verify import io.mockk.verify
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.test.TestCoroutineScope
import kotlinx.coroutines.test.runBlockingTest import kotlinx.coroutines.test.runBlockingTest
import org.amshove.kluent.shouldEqualTo import org.amshove.kluent.shouldEqualTo
import org.junit.jupiter.api.Test import org.junit.jupiter.api.Test
@@ -34,7 +39,9 @@ class DetailViewModelTest : BaseTestWithMainThread() {
viewModel.loadData() viewModel.loadData()
// init should have called it already due to creation above // init should have called it already due to creation above
verify(exactly = 1) { getLaunchDetails(capture(paramsSlot)) } verify(exactly = 1, timeout = 5000) {
getLaunchDetails(capture(paramsSlot))
}
paramsSlot.captured.id shouldEqualTo 1013 paramsSlot.captured.id shouldEqualTo 1013
} }
} }

View File

@@ -24,3 +24,5 @@ kotlin.incremental=true
kapt.incremental.apt=true kapt.incremental.apt=true
kapt.use.worker.api=true kapt.use.worker.api=true
kapt.include.compile.classpath=false kapt.include.compile.classpath=false
#For incremental databinding
android.databinding.incremental=true

View File

@@ -1,6 +1,6 @@
#Wed Sep 04 15:39:59 CEST 2019 #Mon Nov 18 14:54:51 CET 2019
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.5-all.zip distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.1-all.zip