Skip to content

Migrate to the shared common library (logger, crashes, debug pages) - #64

Merged
LukeNeedham merged 10 commits into
mainfrom
claude/android-library-migration-d7fp6h
Oct 17, 2026
Merged

LukeNeedham merged 10 commits into
mainfrom
claude/android-library-migration-d7fp6h

Conversation

@LukeNeedham

Copy link
Copy Markdown
Owner

Summary

Moves VideoDiary onto com.lukeneedham:common:0.1.0 (LukeNeedham/ci-workflows), following docs/using-the-library.md. Two commits: (1) the toolchain/SDK raise, (2) the migration.

Toolchain (commit 1)

  • minSdk 21 -> 23, compileSdk 35 -> 36 (targetSdk stays 35)
  • Kotlin 2.0.0 -> 2.2.21, KSP -> 2.2.21-2.0.4, AGP 8.7.1 -> 8.13.2, Gradle 8.9 -> 8.14.3
  • Room 2.6.1 -> 2.8.4 (KSP2 / Kotlin 2.2), Compose BOM 2024.04.01 -> 2026.02.00 (matches the library's Compose 1.10, so the old BOM does not pin older Compose artifacts)
  • android { kotlinOptions } is an error in Kotlin 2.2, replaced by kotlin { compilerOptions }. The compose compiler plugin was already in use.

Migration (commit 2)

  • Maven repo added in settings.gradle.kts (inside dependencyResolutionManagement, so FAIL_ON_PROJECT_REPOS is respected; limited to group com.lukeneedham); dependency in deps.kt
  • DebugKit.init(DebugKitConfig(enabled = BuildConfig.DEBUG, minLogLevel = Debug in debug / Info in release)) at the top of App.onCreate (keeps "debug logs only in debug builds")
  • Old Logger/LoggerEngine/AndroidLoggerEngine/LoggerOrigin removed; all call sites use the library Logger (d/w/e)
  • Removed CrashLogDao, CrashLog, the crash handler in App, CrashLogPage, the app's DebugPage and their Koin wiring
  • NormalPage now has Debug, Logs, Crashes, routed to the library's DebugPage/LogsPage/CrashesPage. The app's own tools (mock data, resync thumbnails, allow retake) are kept as DebugPage extraContent (DebugExtras/DebugExtrasContent)
  • R8 keep rules for the library's LogEntry/CrashEntry (release is minified and the doc says R8 is untested)
  • CLAUDE.md updated. No tests existed for the removed code (only the template example tests remain). No F-Droid metadata/docs recorded minSdk.

Privacy

The library's Android manifest declares no permissions (only a non-exported content provider). The app manifest is unchanged, still with no INTERNET permission, and keeps its ACCESS_NETWORK_STATE removal. The library's dependencies (Compose, okio, kotlinx-serialization) add none. I could not inspect the merged manifest, so please check it in the CI APK.

Not verified (please check CI)

  • Nothing was built. ./gradlew was tried and could not resolve plugins offline, so everything was reviewed by reading. The Kotlin 2.2 / AGP 8.13 / KSP / Room 2.8 versions are chosen from Maven metadata but untested together.
  • The published library could not be reached from my sandbox.
  • Library pages use Material 3 while the app theme is Material 2, so they look different from the rest of the app.

Notes / judgement calls

  • No Room table to drop: the doc says VideoDiary has a Room table behind crash logs, but it did not. Crash logs were plain .txt files in filesDir/crashlogs. Room only holds saved recaps. Those files are left on disk, not migrated (noted in CLAUDE.md); delete the folder in a later release.
  • Log tag changes from VideoDiaryLog (with a clickable file:line origin) to the library default App.
  • allowBackup is on with default rules, so the library's filesDir/common logs/crashes are backed up as the old crash logs were. I did not change the backup rules.
  • minSdk 23 drops Android 5.x/6-era devices (API 21-22). F-Droid's own build recipe may need to accept the extra Maven repository (GitHub Pages), as it already does for JitPack.
  • The library's animation speed is not wired in; the app has no animation scaling.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XDmfLXhjCA66KrhHPs1c5s


Generated by Claude Code

Prerequisites for the shared com.lukeneedham:common library (Compose 1.10 needs
minSdk 23 and compileSdk 36; Kotlin must be 2.2 or newer).

- Kotlin 2.0.0 -> 2.2.21, KSP -> 2.2.21-2.0.4, AGP 8.7.1 -> 8.13.2, Gradle 8.9 -> 8.14.3
- Room 2.6.1 -> 2.8.4 (KSP2 / Kotlin 2.2 support)
- Compose BOM 2024.04.01 -> 2026.02.00, matching the library's Compose 1.10
- android.kotlinOptions is an error in Kotlin 2.2: use kotlin.compilerOptions

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XDmfLXhjCA66KrhHPs1c5s
- Add the library's Maven repository and dependency (com.lukeneedham:common:0.1.0)
- Call DebugKit.init at the top of App.onCreate; debug logs only in debug builds
- Replace Logger/LoggerEngine/AndroidLoggerEngine with the library Logger
- Remove CrashLogDao/CrashLog, the crash handler in App, CrashLogPage and the app's DebugPage
- Route the Debug, Logs and Crashes pages to the library's pages; the app's mock data tools
  stay as DebugPage extraContent
- Keep rules for the library's LogEntry/CrashEntry (release builds are minified)
- Update CLAUDE.md

The old crash logs in filesDir/crashlogs are left on disk, not migrated.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XDmfLXhjCA66KrhHPs1c5s
@github-actions

github-actions Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

✅ Build succeeded

Copy link
Copy Markdown
Owner Author

The android / build / build failure is not caused by this PR's code. Gradle could not download com.lukeneedham:common:0.1.0 from https://lukeneedham.github.io/ci-workflows/maven.

The artifacts are on the gh-pages branch of LukeNeedham/ci-workflows, but GitHub Pages is not enabled for that repo, so the URL serves nothing. It needs Settings → Pages → "Deploy from a branch" → gh-pages / root (a repo-owner setting). Once Pages is on, this build needs a re-run.

What the run did show: the Gradle 8.14.3 wrapper, buildSrc (compiled with the new Kotlin) and project configuration all got through, so the toolchain bumps are not what failed. App code compilation has not been reached yet, so the Kotlin 2.2 / AGP / Room / KSP versions are still unverified.


Generated by Claude Code

The shared library's single provider of debug composition locals is now
ProvideDebugSettings (renamed from ProvideAnimationSpeed, which provided only the
animation speed). Every app wraps its content in it, even without a debug setting
to read, so a setting added to the library later reaches the app with only a version
bump. Needs common 0.2.0.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XDmfLXhjCA66KrhHPs1c5s
The shared library needs Compose 1.10, so the BOM moved from 2024.04 to 2026.02.
Pager's beyondBoundsPageCount is now beyondViewportPageCount, and the Material 3
ModalBottomSheet takes contentWindowInsets (a lambda) instead of windowInsets. Behaviour is unchanged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XDmfLXhjCA66KrhHPs1c5s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XDmfLXhjCA66KrhHPs1c5s
0.2.1 keeps logging and the debug settings working, in memory, when there is no application
context (plain JVM unit tests), instead of throwing UninitializedPropertyAccessException.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XDmfLXhjCA66KrhHPs1c5s
0.3.0 makes the shared Logger a no-op until DebugKit.init runs, so it needs no application
context, no android.util.Log and no files before the app starts (plain JVM unit tests never
start it). DebugKit.init, already the first call at app start, switches the real logger on.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XDmfLXhjCA66KrhHPs1c5s
…s debug page

The shared library's DebugPage now shows only the library's own things, with no extraContent
slot. App-specific debug tools therefore live on the app's own debug page, which has a button
that opens the library's page. Compiles against common 0.3.0 and the next version, which
removes the extraContent parameter.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XDmfLXhjCA66KrhHPs1c5s
0.4.0 removes the extraContent parameter from the shared DebugPage, which shows only the library's
own things. This app no longer uses it.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XDmfLXhjCA66KrhHPs1c5s
…through Logger

The shared library's animation speed now scales the animations that have an explicit duration,
through LocalAnimationSpeed.current.scale(ms): the recap share sheet settle and the camera focus
indicator hold and fade. Animations that use the default spring are not affected.

Also move the last three direct android.util.Log calls (CameraInput, VideoRecorder) to the shared
Logger, which the migration missed, so those errors reach the Logs page and crash reports.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XDmfLXhjCA66KrhHPs1c5s
@LukeNeedham
LukeNeedham merged commit 02127c8 into main Oct 17, 2026
2 checks passed
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