Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a way to check library version at runtime #2941

Closed
PierfrancescoSoffritti opened this issue Sep 20, 2021 · 0 comments
Closed

Add a way to check library version at runtime #2941

PierfrancescoSoffritti opened this issue Sep 20, 2021 · 0 comments

Comments

@PierfrancescoSoffritti
Copy link

We are in the process of enabling coroutine debugging on Android Studio. In order to make it work we had to fix some performance issues on the coroutine debugger.

As these improvements are available only to devs using kotlinx-coroutine-core version 1.6+, we decided to disable the debugger for devs using older versions of the lib, as the debugger is not usable there.

In order to do this we have two options:

  1. Check version of the lib at build time. This will require adding a dependency to the build system, which we want to avoid because it's not reliable and a common source of bugs.
  2. Check version of the lib at runtime. This will require adding some versioning info to the lib's jar. In Androidx libs we add a META-INF/some_file.version file to the jar, containing the version number. Something similar could be done for coroutines, to allow our agent to check it at runtime.
qwwdfsad added a commit that referenced this issue Sep 24, 2021
    * The approach with "Specification-Version" in Manifest doesn't work because Android merges all JARs into a single resource, trimming all the manifests

Fixes #2941
yorickhenning pushed a commit to yorickhenning/kotlinx.coroutines that referenced this issue Oct 14, 2021
* Add version file to each module resources
* The approach with "Specification-Version" in Manifest doesn't work because Android merges all JARs into a single resource, trimming all the manifests

Fixes Kotlin#2941
pablobaxter pushed a commit to pablobaxter/kotlinx.coroutines that referenced this issue Sep 14, 2022
* Add version file to each module resources
* The approach with "Specification-Version" in Manifest doesn't work because Android merges all JARs into a single resource, trimming all the manifests

Fixes Kotlin#2941
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants