diff --git a/app/build.gradle b/app/build.gradle index f26fd33..a11207e 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -44,7 +44,7 @@ dependencies { implementation "com.google.code.gson:gson:${libraryVersion.gson}" implementation "com.google.dagger:dagger-android-support:${libraryVersion.dagger}" implementation "com.google.dagger:dagger:${libraryVersion.dagger}" - implementation "com.jakewharton.retrofit:retrofit2-kotlin-coroutines-experimental-adapter:${libraryVersion.kotlinCoroutinesRetrofitAdapter}" + implementation "com.jakewharton.retrofit:retrofit2-kotlin-coroutines-adapter:${libraryVersion.kotlinCoroutinesRetrofitAdapter}" implementation "com.jakewharton.timber:timber:${libraryVersion.timber}" implementation "com.squareup.okhttp3:logging-interceptor:${libraryVersion.okHttp}" implementation "com.squareup.okhttp3:okhttp:${libraryVersion.okHttp}" diff --git a/app/src/main/java/com/xmartlabs/sample/di/AppModule.kt b/app/src/main/java/com/xmartlabs/sample/di/AppModule.kt index 0306493..18b9938 100644 --- a/app/src/main/java/com/xmartlabs/sample/di/AppModule.kt +++ b/app/src/main/java/com/xmartlabs/sample/di/AppModule.kt @@ -6,7 +6,7 @@ import com.facebook.stetho.okhttp3.StethoInterceptor import com.google.gson.FieldNamingPolicy import com.google.gson.Gson import com.google.gson.GsonBuilder -import com.jakewharton.retrofit2.adapter.kotlin.coroutines.experimental.CoroutineCallAdapterFactory +import com.jakewharton.retrofit2.adapter.kotlin.coroutines.CoroutineCallAdapterFactory import com.xmartlabs.sample.db.AppDb import com.xmartlabs.sample.service.UserService import dagger.Module @@ -32,7 +32,7 @@ class AppModule { @Singleton @Provides fun provideOkHttpClient(): OkHttpClient { - val loggingInterceptor = HttpLoggingInterceptor { message -> Timber.tag("OkHttp").d(message) } + val loggingInterceptor = HttpLoggingInterceptor { Timber.tag("OkHttp").d(it) } loggingInterceptor.level = HttpLoggingInterceptor.Level.BODY return OkHttpClient.Builder() diff --git a/app/src/main/java/com/xmartlabs/sample/repository/user/UserRepositoryUsingCoroutines.kt b/app/src/main/java/com/xmartlabs/sample/repository/user/UserRepositoryUsingCoroutines.kt index a94d73a..0203ea6 100644 --- a/app/src/main/java/com/xmartlabs/sample/repository/user/UserRepositoryUsingCoroutines.kt +++ b/app/src/main/java/com/xmartlabs/sample/repository/user/UserRepositoryUsingCoroutines.kt @@ -11,7 +11,7 @@ import com.xmartlabs.sample.db.UserDao import com.xmartlabs.sample.model.User import com.xmartlabs.sample.model.service.GhListResponse import com.xmartlabs.sample.service.UserService -import kotlinx.coroutines.experimental.Deferred +import kotlinx.coroutines.Deferred import javax.inject.Inject import javax.inject.Singleton diff --git a/app/src/main/java/com/xmartlabs/sample/service/UserService.kt b/app/src/main/java/com/xmartlabs/sample/service/UserService.kt index 1afa86a..ccdbe6c 100644 --- a/app/src/main/java/com/xmartlabs/sample/service/UserService.kt +++ b/app/src/main/java/com/xmartlabs/sample/service/UserService.kt @@ -3,7 +3,7 @@ package com.xmartlabs.sample.service import com.xmartlabs.sample.model.User import com.xmartlabs.sample.model.service.GhListResponse import io.reactivex.Single -import kotlinx.coroutines.experimental.Deferred +import kotlinx.coroutines.Deferred import retrofit2.Call import retrofit2.http.GET import retrofit2.http.Query diff --git a/fountain-coroutines/build.gradle b/fountain-coroutines/build.gradle index 27c4b6d..bf650b7 100644 --- a/fountain-coroutines/build.gradle +++ b/fountain-coroutines/build.gradle @@ -44,12 +44,6 @@ dependencies { testImplementation project(':fountain-testutils') } -kotlin { - experimental { - coroutines "enable" - } -} - dokka { outputDirectory = "$buildDir/docs" } diff --git a/fountain-coroutines/src/main/java/com/xmartlabs/fountain/coroutines/FountainCoroutines.kt b/fountain-coroutines/src/main/java/com/xmartlabs/fountain/coroutines/FountainCoroutines.kt index 95d3c2b..bb81723 100644 --- a/fountain-coroutines/src/main/java/com/xmartlabs/fountain/coroutines/FountainCoroutines.kt +++ b/fountain-coroutines/src/main/java/com/xmartlabs/fountain/coroutines/FountainCoroutines.kt @@ -12,12 +12,11 @@ import com.xmartlabs.fountain.coroutines.adapter.toBaseNetworkDataSourceAdapter import com.xmartlabs.fountain.coroutines.common.toExecutor import com.xmartlabs.fountain.feature.cachednetwork.CachedNetworkListingCreator import com.xmartlabs.fountain.feature.network.NetworkPagedListingCreator -import kotlinx.coroutines.experimental.CoroutineDispatcher -import kotlinx.coroutines.experimental.CoroutineScope -import kotlinx.coroutines.experimental.Dispatchers -import kotlinx.coroutines.experimental.GlobalScope -import kotlinx.coroutines.experimental.IO -import kotlinx.coroutines.experimental.asCoroutineDispatcher +import kotlinx.coroutines.CoroutineDispatcher +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.asCoroutineDispatcher /** A [Listing] factory */ object FountainCoroutines { diff --git a/fountain-coroutines/src/main/java/com/xmartlabs/fountain/coroutines/adapter/CoroutineNetworkDataSourceAdapterFactory.kt b/fountain-coroutines/src/main/java/com/xmartlabs/fountain/coroutines/adapter/CoroutineNetworkDataSourceAdapterFactory.kt index 6985954..e28c734 100644 --- a/fountain-coroutines/src/main/java/com/xmartlabs/fountain/coroutines/adapter/CoroutineNetworkDataSourceAdapterFactory.kt +++ b/fountain-coroutines/src/main/java/com/xmartlabs/fountain/coroutines/adapter/CoroutineNetworkDataSourceAdapterFactory.kt @@ -4,9 +4,9 @@ import com.xmartlabs.fountain.ListResponseWithEntityCount import com.xmartlabs.fountain.ListResponseWithPageCount import com.xmartlabs.fountain.common.FountainConstants import com.xmartlabs.fountain.common.KnownSizeResponseManager -import kotlinx.coroutines.experimental.CompletableDeferred -import kotlinx.coroutines.experimental.Deferred -import kotlinx.coroutines.experimental.runBlocking +import kotlinx.coroutines.CompletableDeferred +import kotlinx.coroutines.Deferred +import kotlinx.coroutines.runBlocking /** A [CoroutineNetworkDataSourceAdapter] factory */ object CoroutineNetworkDataSourceAdapterFactory { diff --git a/fountain-coroutines/src/main/java/com/xmartlabs/fountain/coroutines/adapter/NetworkDataSourceAdapter.kt b/fountain-coroutines/src/main/java/com/xmartlabs/fountain/coroutines/adapter/NetworkDataSourceAdapter.kt index 12a5620..bd0e488 100644 --- a/fountain-coroutines/src/main/java/com/xmartlabs/fountain/coroutines/adapter/NetworkDataSourceAdapter.kt +++ b/fountain-coroutines/src/main/java/com/xmartlabs/fountain/coroutines/adapter/NetworkDataSourceAdapter.kt @@ -2,7 +2,7 @@ package com.xmartlabs.fountain.coroutines.adapter import com.xmartlabs.fountain.ListResponse import com.xmartlabs.fountain.adapter.NetworkDataSourceAdapter -import kotlinx.coroutines.experimental.Deferred +import kotlinx.coroutines.Deferred /** * It's used to fetch each page from the service. diff --git a/fountain-coroutines/src/main/java/com/xmartlabs/fountain/coroutines/adapter/NetworkDataSourceExtensions.kt b/fountain-coroutines/src/main/java/com/xmartlabs/fountain/coroutines/adapter/NetworkDataSourceExtensions.kt index 61b0b77..5830d7a 100644 --- a/fountain-coroutines/src/main/java/com/xmartlabs/fountain/coroutines/adapter/NetworkDataSourceExtensions.kt +++ b/fountain-coroutines/src/main/java/com/xmartlabs/fountain/coroutines/adapter/NetworkDataSourceExtensions.kt @@ -6,7 +6,7 @@ import com.xmartlabs.fountain.adapter.BasePageFetcher import com.xmartlabs.fountain.adapter.NetworkResultListener import com.xmartlabs.fountain.common.BaseNetworkDataSourceAdapterFactory import com.xmartlabs.fountain.common.notifyFromCallable -import kotlinx.coroutines.experimental.runBlocking +import kotlinx.coroutines.runBlocking private fun > CoroutinePageFetcher.toBasePageFetcher(): BasePageFetcher { return object : BasePageFetcher { diff --git a/fountain-coroutines/src/main/java/com/xmartlabs/fountain/coroutines/common/ExecutorExtensions.kt b/fountain-coroutines/src/main/java/com/xmartlabs/fountain/coroutines/common/ExecutorExtensions.kt index c59fe56..5b9432d 100644 --- a/fountain-coroutines/src/main/java/com/xmartlabs/fountain/coroutines/common/ExecutorExtensions.kt +++ b/fountain-coroutines/src/main/java/com/xmartlabs/fountain/coroutines/common/ExecutorExtensions.kt @@ -1,8 +1,8 @@ package com.xmartlabs.fountain.coroutines.common -import kotlinx.coroutines.experimental.CoroutineDispatcher -import kotlinx.coroutines.experimental.CoroutineScope -import kotlinx.coroutines.experimental.launch +import kotlinx.coroutines.CoroutineDispatcher +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.launch import java.util.concurrent.Executor internal fun CoroutineDispatcher.toExecutor(coroutineScope: CoroutineScope) = Executor { diff --git a/fountain-coroutines/src/test/java/com/xmartlabs/fountain/coroutines/common/IntMockedListingCreator.kt b/fountain-coroutines/src/test/java/com/xmartlabs/fountain/coroutines/common/IntMockedListingCreator.kt index d748734..93d6c4b 100644 --- a/fountain-coroutines/src/test/java/com/xmartlabs/fountain/coroutines/common/IntMockedListingCreator.kt +++ b/fountain-coroutines/src/test/java/com/xmartlabs/fountain/coroutines/common/IntMockedListingCreator.kt @@ -7,7 +7,7 @@ import com.xmartlabs.fountain.coroutines.adapter.NotPagedCoroutinePageFetcher import com.xmartlabs.fountain.testutils.InstantExecutor import com.xmartlabs.fountain.testutils.IntMockedCachedDataSourceAdapter import com.xmartlabs.fountain.testutils.TestConstants -import kotlinx.coroutines.experimental.asCoroutineDispatcher +import kotlinx.coroutines.asCoroutineDispatcher object IntMockedListingCreator { fun createNetworkListing( diff --git a/fountain-coroutines/src/test/java/com/xmartlabs/fountain/coroutines/common/MockedPageFetchers.kt b/fountain-coroutines/src/test/java/com/xmartlabs/fountain/coroutines/common/MockedPageFetchers.kt index 860c660..7650d1b 100644 --- a/fountain-coroutines/src/test/java/com/xmartlabs/fountain/coroutines/common/MockedPageFetchers.kt +++ b/fountain-coroutines/src/test/java/com/xmartlabs/fountain/coroutines/common/MockedPageFetchers.kt @@ -11,8 +11,8 @@ import com.xmartlabs.fountain.testutils.extensions.generateSpecificIntPageRespon import com.xmartlabs.fountain.testutils.extensions.toListResponse import com.xmartlabs.fountain.testutils.extensions.toListResponseEntityCount import com.xmartlabs.fountain.testutils.extensions.toListResponsePageCount -import kotlinx.coroutines.experimental.CompletableDeferred -import kotlinx.coroutines.experimental.Deferred +import kotlinx.coroutines.CompletableDeferred +import kotlinx.coroutines.Deferred class MockedPageFetcher(var error: Boolean = false) : CoroutinePageFetcher> { override fun fetchPage(page: Int, pageSize: Int) = diff --git a/versions.gradle b/versions.gradle index 57f3665..0d754d1 100644 --- a/versions.gradle +++ b/versions.gradle @@ -18,9 +18,9 @@ ext { gson : '2.8.5', jacoco : '0.12.0', junit : '4.12', - kotlin : '1.2.71', - kotlinCoroutines : '0.26.0', - kotlinCoroutinesRetrofitAdapter: '1.0.0', + kotlin : '1.3.0', + kotlinCoroutines : '1.0.1', + kotlinCoroutinesRetrofitAdapter: '0.9.2', mavenPlugin : '2.0', mockito : '2.16.0', okHttp : '3.10.0',