Skip to content

Commit

Permalink
Version 0.13.0-eap13 with Kotlin 1.3.0-rc-146
Browse files Browse the repository at this point in the history
  • Loading branch information
gildor committed Oct 9, 2018
1 parent fa118ed commit f583759
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
6 changes: 3 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformJvmPlugin
import org.jetbrains.kotlin.gradle.plugin.KotlinPluginWrapper

plugins {
id("org.jetbrains.kotlin.jvm") version "1.3-M1"
id("org.jetbrains.kotlin.jvm") version "1.3.0-rc-146"
id("com.jfrog.bintray") version "1.8.4"
jacoco
`maven-publish`
Expand All @@ -35,7 +35,7 @@ java {

dependencies {
compile("org.jetbrains.kotlin:kotlin-stdlib")
compile("org.jetbrains.kotlinx:kotlinx-coroutines-core:0.24.0-eap13")
compile("org.jetbrains.kotlinx:kotlinx-coroutines-core:0.30.2-eap13")
compile("com.squareup.retrofit2:retrofit:2.4.0")
testCompile("junit:junit:4.12")
}
Expand Down Expand Up @@ -78,7 +78,7 @@ val releaseTag = "v${project.version}"
val sourcesJar by tasks.creating(Jar::class) {
dependsOn("classes")
classifier = "sources"
from(sourceSets["main"].allSource)
from(sourceSets["main"].allJava)
}

val javadocJar by tasks.creating(Jar::class) {
Expand Down
4 changes: 2 additions & 2 deletions src/main/kotlin/ru/gildor/coroutines/retrofit/CallAwait.kt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public suspend fun <T : Any> Call<T>.await(): T {
return suspendCancellableCoroutine { continuation ->
enqueue(object : Callback<T> {
override fun onResponse(call: Call<T>?, response: Response<T?>) {
continuation.resumeWith(SuccessOrFailure.runCatching {
continuation.resumeWith(runCatching {
if (response.isSuccessful) {
response.body()
?: throw NullPointerException("Response body is null: $response")
Expand Down Expand Up @@ -89,7 +89,7 @@ public suspend fun <T : Any> Call<T>.awaitResult(): Result<T> {
return suspendCancellableCoroutine { continuation ->
enqueue(object : Callback<T> {
override fun onResponse(call: Call<T>?, response: Response<T>) {
continuation.resumeWith(SuccessOrFailure.runCatching {
continuation.resumeWith(runCatching {
if (response.isSuccessful) {
val body = response.body()
if (body == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package ru.gildor.coroutines.retrofit

import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Unconfined
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.async
import kotlinx.coroutines.runBlocking
import org.junit.Assert.assertEquals
Expand All @@ -32,7 +32,6 @@ import retrofit2.HttpException
import ru.gildor.coroutines.retrofit.util.MockedCall
import ru.gildor.coroutines.retrofit.util.NullBodyCall
import ru.gildor.coroutines.retrofit.util.errorResponse
import kotlin.coroutines.coroutineContext

private const val DONE = "Done!"

Expand Down Expand Up @@ -296,6 +295,6 @@ class CallAwaitTest {
}

private fun testBlocking(block: suspend CoroutineScope.() -> Unit) {
runBlocking(Unconfined, block)
runBlocking(Dispatchers.Unconfined, block)
}

0 comments on commit f583759

Please sign in to comment.