Skip to content

fix: restore E2E APK discovery after AGP 9 migration #1128

Description

@ovitrif

Why this is required

Before AGP 9, the app build renamed APKs and AABs inside AGP's output directories through applicationVariants, BaseVariantOutputImpl.outputFileName, and FinalizeBundleTask. AGP 9 removes those legacy and internal APIs.

#1127 replaces them with the supported SingleArtifact.APK, SingleArtifact.BUNDLE, and BuiltArtifactsLoader APIs. The resulting artifact-listener tasks run whenever Gradle produces the corresponding app artifact, including direct assemble* and bundle* commands.

Producer contract

  • Every assemble<Variant> invocation automatically publishes the established versioned bitkit-*.apk copies under app/build/outputs/bitkit/<variant>.
  • Every bundle<Variant> invocation automatically publishes the established versioned bitkit-*.aab copy under app/build/outputs/bitkit/<variant>.
  • The artifact-listener wiring is the build trigger for these compatibility outputs across direct Gradle commands, Android Studio builds, just commands, and CI.
  • Each compatibility directory contains only the current APK or AAB set for its variant.
  • AGP's native app-* artifacts and metadata remain owned by AGP under app/build/outputs/apk and app/build/outputs/bundle.

Consumer delivery

Update the two public consumers before #1127 merges. Track both changes through this issue; separate planning issues in the consumer repositories are not required.

  • bitkit-e2e-tests/scripts/build-android-apk.sh
    • Resolve exactly one universal APK from app/build/outputs/bitkit/devDebug or app/build/outputs/bitkit/mainnetDebug after the existing assemble* command.
    • Continue writing aut/bitkit_e2e.apk for local and regtest runs.
    • Continue writing aut/bitkit_e2e_mainnet.apk for mainnet runs.
  • bitkit-nightly/.github/workflows/mainnet-probe.yml
    • Resolve exactly one universal APK from app/build/outputs/bitkit/mainnetDebug after assembleMainnetDebug.
    • Continue writing and uploading probe-apk/bitkit_e2e.apk.

During the merge transition, each consumer resolves the compatibility directory first and the legacy AGP output directory second. This keeps the same consumer revision working against Android refs from both sides of #1127.

Delivery order

  1. Merge the bitkit-e2e-tests compatibility update.
  2. Merge the bitkit-nightly compatibility update.
  3. Merge chore: upgrade to agp 9 and configure parallelism #1127 after both consumers accept the AGP 9 compatibility outputs.
  4. Close this issue after both consumer paths have run successfully against chore: upgrade to agp 9 and configure parallelism #1127.

Acceptance criteria

  • Direct ./gradlew assembleDevDebug publishes exactly one bitkit-dev-debug-*-universal.apk under app/build/outputs/bitkit/devDebug.
  • Direct ./gradlew assembleMainnetDebug publishes exactly one bitkit-mainnet-debug-*-universal.apk under app/build/outputs/bitkit/mainnetDebug.
  • Direct ./gradlew bundleMainnetRelease publishes exactly one current bitkit-mainnet-release-*.aab under app/build/outputs/bitkit/mainnetRelease.
  • The bitkit-e2e-tests Android build helper succeeds against Android refs before and after chore: upgrade to agp 9 and configure parallelism #1127 for local, regtest, and mainnet builds.
  • Each E2E build writes the expected APK under aut/.
  • The bitkit-nightly mainnet probe reaches the upload step with probe-apk/bitkit_e2e.apk present against Android refs before and after chore: upgrade to agp 9 and configure parallelism #1127.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions