libp2p / libp2p/jvm-libp2p

Upgrade Kotlin from 1.6.21 to 2.x

Open
#458 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Kotlin
Stars
366
Forks
85
Avg merge
2d 39m
Merged PRs (30d)
6

Description

## Context

During a dependency update pass (see PR #424 and related work), several dependencies could not be upgraded because they require Kotlin 2.x:

| Dependency | Blocked version | Reason |
|---|---|---|
| `io.mockk:mockk` | 1.14.x | Transitively requires `kotlin-stdlib:2.1.20` |
| `com.github.ben-manes.versions` Gradle plugin | 0.54.0 | Requires Kotlin 2.x compiler |
| `io.gitlab.arturbosch.detekt` | 1.23.x | Uses Kotlin 1.9 compiler API |
| `org.jetbrains.kotlinx:kotlinx-coroutines-core` | 1.10.x | Requires Kotlin 1.8+ |

## What needs to happen

- Upgrade `org.jetbrains.kotlin.jvm` plugin from `1.6.21` to `2.x` (latest stable: `2.1.20`)
- Update `languageVersion` in `KotlinCompile` options (currently `"1.6"`)
- Upgrade `kotlinx-coroutines-core` to `1.10.x`
- Verify `allWarningsAsErrors = true` still passes (new compiler warnings are expected)
- Re-test all modules after the upgrade
- Unblock the deferred dependency upgrades listed above

## Notes

- The Kotlin 2.x migration guide should be consulted: https://kotlinlang.org/docs/k2-compiler-migration-guide.html
- Android example module (`examples/android-chatter`) may need separate attention given its AGP version constraint

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the org.jetbrains.kotlin.jvm plugin version and KotlinCompile languageVersion configuration, then consult the Kotlin 2.x migration guide. Run tests across all modules, including examples/android-chatter, and verify allWarningsAsErrors passes while the listed dependency upgrades are unblocked.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
build-system, mobile-dev
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.