Kotlinx.coroutines: Update for Gradle Metadata 1.0

Created on 15 Apr 2019  路  13Comments  路  Source: Kotlin/kotlinx.coroutines

Now that metadata is stable, some libraries have begun releasing updates with 1.0 support. It鈥檇 be great to do a small release to update metadata to the new stable format, to ease upgrading for those of us using kotlinx libs mixed with others.

Most helpful comment

Adding org.jetbrains.kotlinx:kotlinx-coroutines-core-native:$version works for JVM-JS project, too. The name of this artefact ends with -native for historical reason. We'll change/update it in the future.

All 13 comments

Gradle metadata is stable, but is there a stable version of Android toolchain the supports the version of Gradle that support stable metadata?

agp 3.3.2 is compatible with gradle 5.3.X which has metadata stable

I asked, and apparently it will work until it doesn't (no guarantees). So, this is more of a nice-to-have _soon_ (but sooner in case someone finds whatever combination of 1.0 and < 1.0 metadata that breaks). In my current setup, I'm able to install the latest SQLDelight (1.0) with kotlinx.coroutines (0.4). I have also verified building our Android app with gradle 5.3.1 works well.

I too would like gradle metadata support,
I just want to add a single dependency, i.e.
commonMainImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$version_coroutines")

and let the gradle figure out which is needed for jvm, js, etc.
other kotlin-multiplatform libs now do this!

Ops. We've forgot to close this issue, as kotlinx.coroutines was released with stable 1.0 gradle metadata as of version 1.3.1.

@dhakehurst A single dependency is a whole another issue, not directly related to gradle metadata. That is going to be supported by Kotlin MPP in the future.

@elizarov Other kotlin mpp libraries only require one dependency already?
why is this a problem for coroutines?

It is just a question of backwards compatibility. You can already use org.jetbrains.kotlinx:kotlinx-coroutines-core-native:$version as single dependency -- it has all the metadata and resolves to proper binaries on every platform.

It's regarding Gradle < 5.3, right?

If you use JVM or JS only modules you can use any version of Gradle. For native you shall use Gradle >= 5.3.

It'd be great that upcoming versions of the Kotlin Gradle plugin warn users about migrating to Gradle 6+ (or at least 5.3+), so that Kotlin 1.4 can finally require Gradle 5.3+ and allow for simpler dependency management for multiplatform projects, where everyone would be able to replace JVM only or Android only artifacts with MPP artifacts as support for other platforms is added.

I'm using gradle 6.0.1.
@elizarov why would I add a dependency to " org.jetbrains.kotlinx:kotlinx-coroutines-core-native:$version" unless I want native support in my mpp build. Sometimes yes, but not always.
my particular use case at present is just JVM and JS.
so I want do

commonMainImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-core::$version")

just like I can for other mpp libs. (though not ktor, this has the same problem!)

Adding org.jetbrains.kotlinx:kotlinx-coroutines-core-native:$version works for JVM-JS project, too. The name of this artefact ends with -native for historical reason. We'll change/update it in the future.

ah...thanks..odd situation, but history does funny things ;-)
.. thanks for explaining

Was this page helpful?
0 / 5 - 0 ratings