File tree Expand file tree Collapse file tree 3 files changed +7
-8
lines changed
main/kotlin/ru/gildor/coroutines/retrofit
test/kotlin/ru/gildor/coroutines/retrofit Expand file tree Collapse file tree 3 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformJvmPlugin
1212import org.jetbrains.kotlin.gradle.plugin.KotlinPluginWrapper
1313
1414plugins {
15- id(" org.jetbrains.kotlin.jvm" ) version " 1.3-M1 "
15+ id(" org.jetbrains.kotlin.jvm" ) version " 1.3.0-rc-146 "
1616 id(" com.jfrog.bintray" ) version " 1.8.4"
1717 jacoco
1818 `maven- publish`
3535
3636dependencies {
3737 compile(" org.jetbrains.kotlin:kotlin-stdlib" )
38- compile(" org.jetbrains.kotlinx:kotlinx-coroutines-core:0.24.0 -eap13" )
38+ compile(" org.jetbrains.kotlinx:kotlinx-coroutines-core:0.30.2 -eap13" )
3939 compile(" com.squareup.retrofit2:retrofit:2.4.0" )
4040 testCompile(" junit:junit:4.12" )
4141}
@@ -78,7 +78,7 @@ val releaseTag = "v${project.version}"
7878val sourcesJar by tasks.creating(Jar ::class ) {
7979 dependsOn(" classes" )
8080 classifier = " sources"
81- from(sourceSets[" main" ].allSource )
81+ from(sourceSets[" main" ].allJava )
8282}
8383
8484val javadocJar by tasks.creating(Jar ::class ) {
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ public suspend fun <T : Any> Call<T>.await(): T {
3434 return suspendCancellableCoroutine { continuation ->
3535 enqueue(object : Callback <T > {
3636 override fun onResponse (call : Call <T >? , response : Response <T ?>) {
37- continuation.resumeWith(SuccessOrFailure . runCatching {
37+ continuation.resumeWith(runCatching {
3838 if (response.isSuccessful) {
3939 response.body()
4040 ? : throw NullPointerException (" Response body is null: $response " )
@@ -89,7 +89,7 @@ public suspend fun <T : Any> Call<T>.awaitResult(): Result<T> {
8989 return suspendCancellableCoroutine { continuation ->
9090 enqueue(object : Callback <T > {
9191 override fun onResponse (call : Call <T >? , response : Response <T >) {
92- continuation.resumeWith(SuccessOrFailure . runCatching {
92+ continuation.resumeWith(runCatching {
9393 if (response.isSuccessful) {
9494 val body = response.body()
9595 if (body == null ) {
Original file line number Diff line number Diff line change 1717package ru.gildor.coroutines.retrofit
1818
1919import kotlinx.coroutines.CoroutineScope
20- import kotlinx.coroutines.Unconfined
20+ import kotlinx.coroutines.Dispatchers
2121import kotlinx.coroutines.async
2222import kotlinx.coroutines.runBlocking
2323import org.junit.Assert.assertEquals
@@ -32,7 +32,6 @@ import retrofit2.HttpException
3232import ru.gildor.coroutines.retrofit.util.MockedCall
3333import ru.gildor.coroutines.retrofit.util.NullBodyCall
3434import ru.gildor.coroutines.retrofit.util.errorResponse
35- import kotlin.coroutines.coroutineContext
3635
3736private const val DONE = " Done!"
3837
@@ -296,6 +295,6 @@ class CallAwaitTest {
296295}
297296
298297private fun testBlocking (block : suspend CoroutineScope .() -> Unit ) {
299- runBlocking(Unconfined , block)
298+ runBlocking(Dispatchers . Unconfined , block)
300299}
301300
You can’t perform that action at this time.
0 commit comments