Introducing a new way to review your PRs.

Read the announcement

metrolistgroup / metrolist

Material Design YouTube Music client for Android, iOS and desktop

View on GitHub

19 documents · Updated Nov 4, 2026

docs / android-build-variants

Android build variants and distribution

The Android build turns the Metrolist app and its shared InnerTube library into installable APKs for different distribution channels. It keeps one main product while changing channel-specific access to Google Cast and in-app updates, then uses CI to build, sign, name, and publish the right artifacts. See Application platform for the wider platform view and Application lifecycle for the runtime view.

Gradle module composition

The Gradle project has one application module and one library module. The app module produces the user-facing APK and depends on innertube, while the library provides the shared InnerTube client boundary. This split lets the app build use either the normal published InnerTubeX package or a local package during development.

The shared version catalog keeps the Gradle plugin and library versions in one place. Its entries include the InnerTubeX and Google Cast dependencies that shape the app and its distribution variants.

References: settings.gradle.kts• L39-42 app/build.gradle.kts• L302 innertube/build.gradle.kts• L1-4 innertube/build.gradle.kts• L25-30 gradle/libs.versions.toml• L1-18 gradle/libs.versions.toml• L74-80 gradle/libs.versions.toml• L103

Locale resource packaging

Locale resources provide translated app text and plural forms without creating new Gradle flavors or distribution channels. The locale-specific string files keep the same product surface available in each translated build, while the flavor still controls channel features such as Cast and updates.

References: app/…/strings.xml• L3-21 app/…/strings.xml• L3-26 app/…/strings.xml• L3-25 app/…/strings.xml• L3-17 app/…/strings.xml• L3-17 app/…/strings.xml• L3-29 app/…/strings.xml• L3-26 app/…/strings.xml• L3-24 app/…/strings.xml• L3-26 app/…/strings.xml• L3-28 app/…/strings.xml• L3-26 app/…/strings.xml• L3-25 app/…/strings.xml• L3-25 app/…/strings.xml• L3-31 app/…/strings.xml• L3-25 app/…/strings.xml• L3-24 app/…/strings.xml• L3-24 app/…/strings.xml• L3-24

The useMavenLocalInnerTubeX Gradle property changes only the source of the InnerTubeX dependency. With the property present, Gradle resolves the package set from Maven Local. Otherwise, it uses the published JitPack package. The repository rules keep these package choices separate from the normal Google and Maven Central dependencies.

References: settings.gradle.kts• L3 settings.gradle.kts• L18-35 innertube/build.gradle.kts• L25-30

Product flavor differences

Product flavors define the distribution channels. A flavor is a build-time product choice that sets feature flags and controls which channel-specific libraries are included in the APK. All three flavors use the same app code and share the same universal ABI target.

References: app/build.gradle.kts• L39-65 app/build.gradle.kts• L67-90 app/build.gradle.kts• L289-292

FlavorDistribution roleGoogle CastIn-app updater
fossGeneral FOSS packageNot availableAvailable
gmsPackage with Google services supportAvailableAvailable
izzyF-Droid-compliant package for IzzyOnDroidNot availableNot available

The GMS flavor is the only flavor that receives the Cast libraries. The app uses the generated CAST_AVAILABLE value to hide Cast settings in the other flavors. It uses UPDATER_AVAILABLE to keep the updater out of the Izzy package, which must remain F-Droid compliant.

References: app/build.gradle.kts• L69-89 app/build.gradle.kts• L289-292 app/…/PlayerSettings.kt• L524-544 app/…/SettingsScreen.kt• L212-220

The flavor choice also affects update matching. The updater maps a build with Cast to the gms release asset and all other updater-enabled builds to the foss asset. The Izzy build does not expose this path because its updater flag is off. Release asset names therefore form a contract between the CI release job and the app.

References: app/…/Updater.kt• L25-31 app/…/Updater.kt• L74-81 app/…/Updater.kt• L99-116 app/…/Updater.kt• L219-226

Build types and signing

Each flavor can produce a debug or release build. Debug builds remain inspectable and use a debug identity. Release builds are non-debuggable and use code shrinking and resource shrinking before signing. The default debug package gets a .debug application ID suffix unless a workflow supplies an explicit ID.

References: app/build.gradle.kts• L119-147

Signing separates local development from distribution. Local debug builds select a workflow keystore when one is supplied, then a persistent repository-local debug keystore, and finally the normal Android debug keystore. Release signing reads the keystore file and credentials from the release environment. CI signs the already-built release APK with its protected keystore secrets.

References: app/build.gradle.kts• L19-24 app/build.gradle.kts• L92-116 .github/…/build.yml• L73-81 .github/…/release.yml• L133-141

The debug keystore used by pull request builds is tied to the pull request number. CI restores it from the action cache or creates it with a pull-request-specific identity, so repeated builds of the same pull request can install over the earlier artifact.

References: .github/…/build_pr.yml• L43-68

Environment overrides

Environment values let CI label an artifact without changing the product source. The application ID and display name can be replaced for testing, pull requests, and nightly builds. A validated commit value can be added to the version name for nightly traceability. Local properties or environment values can also supply the Last.fm credentials used at build time.

References: app/build.gradle.kts• L4-24 app/build.gradle.kts• L39-64

The main workflows use distinct identities for distinct audiences:

  • Pull request builds use com.metrolist.music.pr.p<number> and a pull-request name.
  • Manual quick builds use com.metrolist.music.test and a testing name.
  • Nightly builds keep the production ID but use a nightly name and commit suffix.
  • Versioned releases use the production ID and the normal app name.

These overrides prevent test and preview APKs from looking like the stable app or replacing it on a device.

References: .github/…/build_pr.yml• L70-79 .github/…/build_quick.yml• L39-47 .github/…/build.yml• L62-71 .github/…/release.yml• L123-131

CI and release automation

CI uses separate paths for pull request checks, nightly artifacts, quick manual checks, and versioned releases. The common path is to select a Gradle task for a flavor and build type, sign release output when needed, rename the APK to a channel-facing name, and upload it as an artifact. The following diagram shows how source changes become a distributed APK.

References: .github/…/build_pr.yml• L70-85 .github/…/build.yml• L62-98 .github/…/release.yml• L123-173

flowchart LR
    S[Source or version change] --> V{Workflow}
    V --> P[Pull request debug build]
    V --> N[Main nightly build]
    V --> R[Versioned release build]
    P --> A1[PR APK artifact]
    N --> A2[Signed nightly APK]
    R --> A3[Signed FOSS, GMS, and Izzy APKs]
    A2 --> G1[GitHub nightly prerelease]
    A3 --> G2[GitHub versioned release]

Pull request automation builds only the GMS debug flavor because it checks the shared app build while keeping a separate install identity. Main-branch automation builds GMS release and debug artifacts, signs the release APK, and publishes the signed GMS APK as a nightly prerelease. The manual quick workflow provides a signed FOSS release check without running on every push.

References: .github/…/build_pr.yml• L20-85 .github/…/build.yml• L26-43 .github/…/build.yml• L100-156 .github/…/build.yml• L158-203 .github/…/build_quick.yml• L1-69

The versioned release workflow starts only when app/build.gradle.kts changes or when a maintainer runs it manually. It compares the current version name with the previous commit, then builds all three flavors only when a new release is needed. A final job gathers the APKs, reads release notes from changelog.md with a fallback to recent Git history, and creates the GitHub release.

References: .github/…/release.yml• L1-8 .github/…/release.yml• L14-76 .github/…/release.yml• L86-131 .github/…/release.yml• L175-239 .github/…/parse_changelog.sh• L1-50

Change checklist

When these files or sections are changed, remember to consider these:

  • Keep flavor flags, flavor-only dependencies, and the app settings that read them aligned.
  • Keep release APK names aligned with Updater asset parsing and the names published by the release workflow.
  • Keep application ID and app-name overrides distinct for pull request, test, nightly, and stable builds.
  • Keep release keystore input names aligned between app/build.gradle.kts and the CI signing action.
  • If version parsing changes, update the release trigger and the release-note lookup contract together.
  • If the module or InnerTube dependency path changes, update both repository resolution and the library dependency selection.
  • If a version-catalog entry changes, check the matching dependency or plugin used by the build and each affected flavor.
  • Keep locale resource names and placeholders aligned with the shared app strings so translated builds continue to resolve the same UI text.

Important failure modes

TriggerConsequenceGuard
A GMS-only library or feature is used without the GMS flavor guardFOSS or Izzy builds cannot resolve or run the Cast featureKeep Cast dependencies and CAST_AVAILABLE behavior flavor-specific
A published APK name changes without an updater changeThe app cannot find the matching update assetTreat release names and Updater.parseAssets as one contract
Release secrets or aliases do not match the signing configurationCI produces an unsigned APK or fails during signingKeep secret names aligned with the release signing inputs
The version name changes without a matching versionCode updateStore and release consumers can see an invalid version sequenceReview both version values in app/build.gradle.kts before release
A preview build uses the production application IDA test APK can replace or conflict with the installed stable appSet an explicit preview ID through the workflow environment
A locale resource removes a shared string or changes its placeholderA translated build can fail resource checks or show broken textPreserve shared string names and format placeholders across locale files

Key files

FileWhy to read it
app/build.gradle.ktsDefines the app module, flavors, build types, signing inputs, version values, and environment overrides.
settings.gradle.ktsDefines the two Gradle modules and dependency repository policy.
gradle/libs.versions.tomlCentralizes the dependency and plugin versions that affect the Android build and its channel-specific libraries.
innertube/build.gradle.ktsShows the shared library boundary and local-versus-published InnerTubeX choice.
app/…/strings.xmlIllustrates how locale resources translate the shared app surface without adding a product flavor.
.github/…/build_pr.ymlShows the pull request install identity, cached debug signing, and validation artifact.
.github/…/build.ymlShows main-branch nightly builds, release signing, and prerelease publication.
.github/…/build_quick.ymlShows the manual FOSS release check path.
.github/…/release.ymlShows version detection, all-flavor release builds, artifact naming, and GitHub release creation.
app/…/Updater.ktDefines how the app maps its build flavor to published release assets.
.github/…/parse_changelog.shDefines the release-note format used by versioned releases.