Skip to content

Compile library modules against compileSdk 37.1 - #30

Draft
dfabulich wants to merge 1 commit into
skiptools:mainfrom
dfabulich:compilesdk-37.1
Draft

dfabulich wants to merge 1 commit into
skiptools:mainfrom
dfabulich:compilesdk-37.1

Conversation

@dfabulich

Copy link
Copy Markdown
Member

Part of skiptools/skip#776 (for skiptools/skip#775, the Compose 1.13 bump). Depends on skiptools/skip#778. Don't merge this until a skip release includes that PR.

Compose 1.13 (BOM 2026.12.00) requires compileSdk 37.1. This PR makes every Skip library module compile against android-37.1 and moves AGP to a version that supports it.

Changes to skip.yml

  • New catalog entry android-sdk-compilePlatform = "37.1". android-sdk-compile stays "37", because integer-only consumers call libs.versions.android.sdk.compile.get().toInt(). Those include targetSdk and every existing app's app/build.gradle.kts.

  • The android { } block sets compileSdkMinor from the new entry. This line has to come after compileSdk, because assigning compileSdk resets compileSdkMinor:

    compileSdk = libs.versions.android.sdk.compile.get().toInt()
    libs.versions.android.sdk.compilePlatform.get().split(".").let { if (it.size > 1 && it[0].toInt() == compileSdk) compileSdkMinor = it[1].toInt() }

    The minor level only applies when its major level matches compileSdk. A project that overrides only android-sdk-compile therefore gets that platform unchanged. For example, overriding it to 36 gives android-36, not android-36.1, and overriding it to 38 wouldn't ask for a nonexistent android-38.1.

  • AGP goes from 9.2.0 to 9.3.3. Google lists AGP 9.3.1 as the minimum for compile SDK 37.1, and AGP 9.2.0 warns that it was only tested up to 37.0.

Why the alias is android-sdk-compilePlatform

The obvious names, android-sdk-compile-platform or android-sdk-compile-minor, break existing builds. A version catalog alias can't also be the prefix of another alias. If one of them existed, libs.versions.android.sdk.compile would become an accessor group instead of a version, and the existing .get() calls would stop compiling.

Why this needs the skip PR first

Once library modules compile against 37.1, AGP requires everything that depends on them to compile against 37.1 too. Every existing app sets compileSdk = libs.versions.android.sdk.compile.get().toInt(), which is plain 37. So this PR alone breaks existing apps, even on the current Compose BOM. Using skipapp-showcase with this branch, BOM 2026.05.01, and the released skip 1.9.23 plugin, gradle :app:checkDebugAarMetadata fails for all 19 Skip modules:

Dependency ':skipstone:SkipLib' requires libraries and applications that
depend on it to compile against version 37.1 or later of the
Android APIs.

:app is currently compiled against android-37.0.

skiptools/skip#778 fixes this in skip-build-plugin. It uses finalizeDsl to raise an app's compileSdk from 37 to 37.1 when this catalog entry is present. With that plugin, the same build passes. To enforce the order, this PR should also raise skip-unit's skip dependency to the release that includes it. That change isn't in the diff yet.

Testing

I used swift package edit on skipapp-showcase with this branch and the skip plugin branch. The app's build.gradle.kts was left unmodified.

  • BOM 2026.05.01 (current): gradle :app:checkDebugAarMetadata passes, and the plugin logs Skip: raising compileSdk from 37 to 37.1. It fails without the plugin, as shown above.
  • BOM 2026.12.00 (Compose 1.13.1): gradle :app:checkDebugAarMetadata :app:assembleDebug passes, and so does the Xcode build of the showcase.
  • Overriding android-sdk-compile to 36 compiles against android-36.
  • skip-ui swift test on BOM 2026.12.00 matches the baseline on released dependencies (compileSdk 37.0):
    • Robolectric: 335 tests, 309 passed, 0 failed, 26 skipped.
    • Android 17 emulator: 335 tests, 318 passed, 3 failed, 14 skipped. The same 3 TextTests size tests fail on the baseline too.

Compose 1.13 (BOM 2026.12.00) requires compileSdk 37.1. Add an android-sdk-compilePlatform = "37.1" version catalog entry and set compileSdkMinor from it in every library module, but only when its major level matches android-sdk-compile, so overriding just android-sdk-compile (e.g., to 38) doesn't select a nonexistent android-38.1. android-sdk-compile stays an integer so existing consumers like targetSdk and app build.gradle.kts files keep working. The alias can't be android-sdk-compile-platform because a version catalog alias can't also be a prefix of another alias (libs.versions.android.sdk.compile would lose its get()). Also bump AGP to 9.3.3; Google lists AGP 9.3.1 as the minimum for compile SDK 37.1, and AGP 9.2.0 warns that it was only tested up to 37.0.

This requires a skip release whose skip-build-plugin raises the app's compileSdk to 37.1; otherwise apps that set compileSdk = 37 fail checkDebugAarMetadata against these library modules.
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