Skip to content

Conversation

@bohsen
Copy link
Contributor

@bohsen bohsen commented Jun 12, 2018

This update fixes issues caused by breaking changes in kotlin coroutines 0.23.0:

  1. invokeOnCompletion() was deprecated. Using invokeOnCancellation() instead.
  2. CoroutineScope.coroutineContext was deprecated. Using top-level function coroutineContext instead.

build.gradle.kts Outdated
compile("org.jetbrains.kotlinx:kotlinx-coroutines-core:0.22.5")
compile("com.squareup.retrofit2:retrofit:2.4.0")
testCompile("junit:junit:4.12")
implementation("org.jetbrains.kotlin:kotlin-stdlib")
Copy link
Owner

@gildor gildor Jun 12, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, do not use implementation configuration for stdlib and other dependencies. We do not want to hide stdlib from transitive dependencies
Use compile instead (api configuration is not available without java-library Gradle plugin and not a better than compile in this case)

*
* @return Result of request or throw exception
*/
public suspend fun <T : Any> Call<T>.await(): T {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please return back all explicit public modifiers.

import kotlinx.coroutines.experimental.Unconfined
import kotlinx.coroutines.experimental.async
import kotlinx.coroutines.experimental.runBlocking
import kotlinx.coroutines.experimental.*
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not use star import

@gildor
Copy link
Owner

gildor commented Jun 12, 2018

Thanks for your contibution, I added a few comments.
I plan to release a new version soon too, but really appreciate that someone else worries about this %)

If you want to release it soon, please also update README.md and CHANGELOG.md. And I will release it

bohsen added 3 commits June 12, 2018 10:00
….23.0, where CoroutineScope.coroutineContext was deprecated and replaced with top-level function.
…ored code to use invokeOnCancellation instead.
@bohsen bohsen changed the title Updated kotlin to 1.2.41 and coroutines to 0.23.0. Updated kotlin to 1.2.41 and coroutines to 0.23.1. Jun 12, 2018
@bohsen
Copy link
Contributor Author

bohsen commented Jun 12, 2018

Updated pull request based on comments.

@gildor
Copy link
Owner

gildor commented Jun 12, 2018

Thanks, merged, will bump version to 0.11 and publish

@gildor gildor merged commit f44e71f into gildor:master Jun 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants