Skip to content

Modernize toolchain: Kotlin 2.3.10 + KSP2, sora-editor 0.24.6, drop abandoned deps#59

Merged
hawkff merged 2 commits into
mainfrom
kotlin23-ksp-editor-fastscroll
Jun 23, 2026
Merged

Modernize toolchain: Kotlin 2.3.10 + KSP2, sora-editor 0.24.6, drop abandoned deps#59
hawkff merged 2 commits into
mainfrom
kotlin23-ksp-editor-fastscroll

Conversation

@hawkff

@hawkff hawkff commented Jun 22, 2026

Copy link
Copy Markdown
Owner

Summary

Lifts the toolchain to the current Kotlin/KSP line, moves the code editor to the latest sora-editor, and removes two abandoned dependencies. All changes verified locally on JDK 17 (oss debug compile + full minified release build).

Changes

Toolchain: Kotlin 2.1.21 → 2.3.10, KSP 2.1.21-2.0.2 → 2.3.9

  • KSP 2.3.x is KSP2-only (KSP1 was removed in Kotlin 2.3). Migrated buildSrc/Helpers.kt off the now-removed kotlinOptions / KotlinJvmOptions API (a hard compile error under Kotlin 2.3) to the compilerOptions DSL: jvmTarget = JvmTarget.JVM_17.
  • Moved the ksp { } Room schema config to a top-level block — it's a project-level extension registered by the KSP plugin, not part of the Android DSL.
  • AGP stays 8.13.2 and Gradle stays 8.14.5 (verified compatible in practice; not bumping AGP to 9.x, which bundles built-in Kotlin and conflicts with kotlin-android under Kotlin 2.3).

sora-editor: editor-bom 0.23.7 → 0.24.6

Previously pinned to 0.23.7 because 0.24.x ships Kotlin 2.3 metadata the old toolchain couldn't read. The Kotlin bump unblocks it. (0.24.6 is the current release; verified resolved + built under R8.)

Remove Roomigrant (abandoned JitPack dep)

Investigation showed it was already dead code: the only consumer of its generated migrations was a commented-out addMigrations(*SagerDatabase_Migrations.build()) call. The real migration strategy is Room-native autoMigrations + fallbackToDestructiveMigration(), which is unchanged.

  • Removed RoomigrantLib + RoomigrantCompiler, the @GenerateRoomMigrations annotations/imports, and the now-unused jitpack.io repository (it was the only JitPack consumer).
  • No migration behavior change. Room codegen verified under KSP2: DAO/database/auto-migration impls still generated, app/schemas/*.json intact.

Replace recyclerview-fastscroll (abandoned) → me.zhanghai.android.fastscroll 1.3.0

AndroidX-native, Apache-2.0 (Google-authored), de-facto standard. No old transitive excludes needed.

  • 6 layouts: FastScrollRecyclerViewandroidx.recyclerview.widget.RecyclerView.
  • Attach FastScrollerBuilder(...).useMd2Style().build() per list (app list, app manager, groups, routes, chain settings, profile list).
  • App list / manager: FastScrollRecyclerView.SectionedAdapter.getSectionNamePopupTextProvider.getPopupText (keeps the section-index popup).
  • Dropped now-unused app: namespaces; removed a pre-existing no-op app:layout_behavior on the chain-settings list (its parent is a LinearLayout, not CoordinatorLayout).

Dependency audit notes

  • AGP 8.13.2 / Gradle 8.14.5: kept; modern and compatible. AGP 9.x intentionally avoided.
  • Room 2.7.2: already current and KSP2-compatible; unchanged.

Testing

  • Local JDK 17: :app:compileOssDebugKotlin (KSP2 + Room codegen) ✅
  • Local JDK 17: :app:assembleOssRelease — full minified build incl. minifyOssReleaseWithR8, lintVitalOssRelease, l8DexDesugarLib ✅ (validates R8/ProGuard against sora's TextMate reflection + the new fastscroll lib)
  • Pending: NAMESPACE CI build; on-device smoke test (config JSON editor, app proxy lists with fast-scroll, group/route lists, DB CRUD).

Not merging until verified end-to-end on device.

Greptile Summary

This PR modernizes the toolchain to Kotlin 2.3.10 + KSP 2.3.9 (KSP2-only), bumps sora-editor to 0.24.6, removes the abandoned Roomigrant annotation processor (which was already dead code), and swaps the archived recyclerview-fastscroll for me.zhanghai.android.fastscroll 1.3.0.

  • Toolchain: migrates kotlinOptions/KotlinJvmOptions (removed in Kotlin 2.3) to the compilerOptions DSL and relocates the ksp {} Room schema config from inside the Android DSL to the correct project-level scope.
  • fastscroll replacement: six layout files are updated from FastScrollRecyclerView to RecyclerView, FastScrollerBuilder(...).useMd2Style().build() is added programmatically in each activity/fragment, and the two app-list adapters migrate SectionedAdapter.getSectionNamePopupTextProvider.getPopupText.
  • Cleanup: removes the now-sole JitPack consumer (Roomigrant), the @GenerateRoomMigrations annotations, and a pre-existing no-op app:layout_behavior on the chain-settings list whose parent is a LinearLayout.

Confidence Score: 5/5

Clean toolchain upgrade and library swap with no functional regressions; safe to merge pending the noted on-device smoke test.

Every changed file was verified: KSP 2.3.9 is correct under KSP2's new independent versioning, the ksp{} relocation and compilerOptions migration are textbook Kotlin 2.3 adaptations, Roomigrant removal touches only dead code, and the fastscroll migration correctly sets LayoutManager before FastScrollerBuilder in all six sites with PopupTextProvider properly implemented in the two adapters that need it. Layout namespace handling is accurate for each parent container type. No logic errors, missing guards, or data-path changes found.

No files require special attention.

Important Files Changed

Filename Overview
buildSrc/src/main/kotlin/Helpers.kt Migrates Kotlin JVM target config from the removed KotlinJvmOptions API to compilerOptions DSL; the tasks.withType block is correctly placed outside android.apply{}.
app/build.gradle.kts ksp{} block moved to project level (correct scope), sora-editor bumped to 0.24.6, fastscroll and Roomigrant deps replaced/removed.
build.gradle.kts KSP version updated to 2.3.9; valid under KSP2's new independent versioning scheme (decoupled from Kotlin version since 2.3.0).
buildSrc/build.gradle.kts Kotlin Gradle plugin bumped from 2.1.21 to 2.3.10; straightforward single-line change.
app/src/main/java/io/nekohasekai/sagernet/ui/AppListActivity.kt Migrates to PopupTextProvider (correct View import present), adds FastScrollerBuilder after LayoutManager and adapter are set.
app/src/main/java/io/nekohasekai/sagernet/ui/AppManagerActivity.kt Same PopupTextProvider migration as AppListActivity; View is imported, adapter set before FastScrollerBuilder.
app/src/main/java/io/nekohasekai/sagernet/database/SagerDatabase.kt Removes @GenerateRoomMigrations annotation and the already-commented-out addMigrations call; migration strategy unchanged.
repositories.gradle.kts JitPack repository removed (last consumer, Roomigrant, is gone); trailing newline added.
app/src/main/java/io/nekohasekai/sagernet/ui/GroupFragment.kt FastScrollerBuilder added after LayoutManager and adapter are already set; no popup provider needed for group list.
app/src/main/res/layout/layout_app_list.xml FastScrollRecyclerView replaced with RecyclerView; xmlns:app retained because app:layout_behavior on this direct CoordinatorLayout child is still used.
app/src/main/res/layout/layout_chain_settings.xml FastScrollRecyclerView replaced with RecyclerView; xmlns:app and no-op app:layout_behavior removed (parent is LinearLayout, not CoordinatorLayout).

Class Diagram

%%{init: {'theme': 'neutral'}}%%
classDiagram
    class RecyclerView {
        +adapter: Adapter
        +layoutManager: LayoutManager
    }
    class FastScrollerBuilder {
        +FastScrollerBuilder(recyclerView)
        +useMd2Style()
        +build()
    }
    class PopupTextProvider {
        <<interface>>
        +getPopupText(view: View, position: Int): CharSequence
    }
    class AppsAdapter_AppList {
        +filteredApps: List
        +getPopupText(view, position): CharSequence
    }
    class AppsAdapter_AppManager {
        +filteredApps: List
        +getPopupText(view, position): CharSequence
    }
    class RecyclerView_Adapter {
        <<abstract>>
    }
    FastScrollerBuilder --> RecyclerView : wraps
    FastScrollerBuilder ..> PopupTextProvider : detects on adapter
    AppsAdapter_AppList --|> RecyclerView_Adapter
    AppsAdapter_AppList ..|> PopupTextProvider
    AppsAdapter_AppManager --|> RecyclerView_Adapter
    AppsAdapter_AppManager ..|> PopupTextProvider
    RecyclerView o-- RecyclerView_Adapter
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
classDiagram
    class RecyclerView {
        +adapter: Adapter
        +layoutManager: LayoutManager
    }
    class FastScrollerBuilder {
        +FastScrollerBuilder(recyclerView)
        +useMd2Style()
        +build()
    }
    class PopupTextProvider {
        <<interface>>
        +getPopupText(view: View, position: Int): CharSequence
    }
    class AppsAdapter_AppList {
        +filteredApps: List
        +getPopupText(view, position): CharSequence
    }
    class AppsAdapter_AppManager {
        +filteredApps: List
        +getPopupText(view, position): CharSequence
    }
    class RecyclerView_Adapter {
        <<abstract>>
    }
    FastScrollerBuilder --> RecyclerView : wraps
    FastScrollerBuilder ..> PopupTextProvider : detects on adapter
    AppsAdapter_AppList --|> RecyclerView_Adapter
    AppsAdapter_AppList ..|> PopupTextProvider
    AppsAdapter_AppManager --|> RecyclerView_Adapter
    AppsAdapter_AppManager ..|> PopupTextProvider
    RecyclerView o-- RecyclerView_Adapter
Loading

Reviews (2): Last reviewed commit: "Address Greptile review: move jvmTarget ..." | Re-trigger Greptile

…bandoned deps

Toolchain (Kotlin 2.1.21 -> 2.3.10, KSP 2.1.21-2.0.2 -> 2.3.9):
- KSP 2.3.x is KSP2-only; migrated Helpers.kt off the removed
  kotlinOptions/KotlinJvmOptions API to the compilerOptions DSL
  (jvmTarget = JvmTarget.JVM_17), which is a hard error under Kotlin 2.3.
- Moved the `ksp { }` room schema config to a top-level block (it is a
  project-level extension, not part of the Android DSL).
- AGP stays 8.13.2, Gradle stays 8.14.5 (verified compatible in practice).

sora-editor: editor-bom 0.23.7 -> 0.24.6 (now unblocked by Kotlin 2.3).

Remove Roomigrant (com.github.MatrixDev.Roomigrant, abandoned JitPack):
- It was already dead code: the only consumer of its generated migrations
  was a commented-out addMigrations() call. Real migration strategy is
  Room-native autoMigrations + fallbackToDestructiveMigration(), unchanged.
- Dropped both deps, the @GenerateRoomMigrations annotations/imports, and the
  now-unused jitpack repository. Room codegen verified under KSP2 (DAO/db/
  auto-migration impls still generated; schemas intact).

Replace recyclerview-fastscroll (com.simplecityapps, abandoned) with
me.zhanghai.android.fastscroll:library:1.3.0 (AndroidX-native):
- 6 layouts: FastScrollRecyclerView -> RecyclerView.
- Attach FastScrollerBuilder(...).useMd2Style().build() per list.
- App list/manager: SectionedAdapter.getSectionName -> PopupTextProvider.getPopupText.
- Dropped unused app: namespaces; removed a pre-existing no-op
  app:layout_behavior on the chain settings list (LinearLayout parent).

Verified locally on JDK 17: oss debug compile + full assembleOssRelease
(R8/minify, lintVital, desugaring) pass.
@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The PR migrates the fast-scroll library from com.simplecityapps:recyclerview-fastscroll to me.zhanghai.android.fastscroll:library:1.3.0, removes the Roomigrant migration code generator, bumps Kotlin/KSP plugin versions, migrates the Kotlin JVM target configuration to the compilerOptions DSL, and removes JitPack from the repository list.

Changes

Dependency & Toolchain Modernization

Layer / File(s) Summary
Build toolchain version bumps and JVM target migration
buildSrc/build.gradle.kts, buildSrc/src/main/kotlin/Helpers.kt, build.gradle.kts, repositories.gradle.kts, app/build.gradle.kts
Kotlin plugin bumped to 2.3.10, KSP plugin to 2.3.9; Helpers.kt replaces the legacy KotlinJvmOptions API with the compilerOptions DSL targeting JVM_17; JitPack removed from repositories; Room KSP schema export block relocated to the top level.
Roomigrant removal and fast-scroll dependency swap
app/build.gradle.kts, app/src/main/java/.../database/SagerDatabase.kt, app/src/main/java/.../database/preference/PublicDatabase.kt
com.simplecityapps:recyclerview-fastscroll and com.github.MatrixDev.Roomigrant (library + compiler) removed; me.zhanghai.android.fastscroll:library:1.3.0 added; @GenerateRoomMigrations annotation and imports removed from both database classes.
XML layouts: replace FastScrollRecyclerView
app/src/main/res/layout/layout_app_list.xml, layout_apps.xml, layout_chain_settings.xml, layout_group.xml, layout_profile_list.xml, layout_route.xml
All six layouts replace the old com.simplecityapps FastScrollRecyclerView with standard androidx.recyclerview.widget.RecyclerView, removing fast-scroll-specific attributes and unused xmlns:app namespace declarations.
Kotlin UI: migrate to FastScrollerBuilder and PopupTextProvider
app/src/main/java/.../ui/AppListActivity.kt, AppManagerActivity.kt, ConfigurationFragment.kt, GroupFragment.kt, RouteFragment.kt, profile/ChainSettingsActivity.kt
AppListActivity and AppManagerActivity switch adapter base from FastScrollRecyclerView.SectionedAdapter to PopupTextProvider (with getPopupText replacing getSectionName). All six UI files add FastScrollerBuilder(...).useMd2Style().build() to their RecyclerView setup.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • hawkff/NekoBoxForAndroid#8: Directly related — introduces the Room 2.7.2 and KSP baseline that this PR builds upon with the Roomigrant removal and KSP block relocation.

Poem

🐇 Hopping through the gradle files with glee,
Old JitPack and Roomigrant — now set free!
FastScroll gets a brand-new MD2 coat,
While Kotlin options get a modern vote.
The warren is tidy, the deps are lean,
The cleanest build this bunny has ever seen! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely summarizes the three major changes: Kotlin/KSP toolchain modernization (2.3.10), sora-editor update (0.24.6), and removal of abandoned dependencies.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The PR description comprehensively details the toolchain upgrade, library migrations, and dependency removals with clear explanations of the rationale and changes.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Comment @coderabbitai help to get the list of available commands.

Comment thread buildSrc/src/main/kotlin/Helpers.kt Outdated
Comment thread app/src/main/res/layout/layout_chain_settings.xml Outdated
…XML trailing newline

- Helpers.kt: move tasks.withType<KotlinCompile> (a project-level call) out of the
  android.apply {} block to make scope explicit, matching the top-level ksp{} block.
- layout_chain_settings.xml: restore trailing newline.
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.

1 participant