cd /news/developer-tools/one-gradle-build-53-offline-android-… Β· home β€Ί topics β€Ί developer-tools β€Ί article
[ARTICLE Β· art-170380] src=dev.to β†— pub= topic=developer-tools verified=true sentiment=↑ positive

One Gradle build, 53 offline Android apps: what lives in the shared core

A developer consolidated 53 single-purpose offline Android apps into a single Gradle build, using an included build-logic project with three precompiled script plugins (constella.android-app, constella.android-library, constella.room) so each app's build file only declares what differs. Shared code lives in core modules for billing, UI, and a lunar module, with billing swapped between Play Billing and a no-op source set via a Gradle property, and a check_store.py script plus CI workflow validating listings and assets before upload.

by read3 min views2 publishedNov 16, 2026

AI disclosure: this post was drafted with an AI assistant from our own repository and checked against it before posting. #ABotWroteThis

We make small single-purpose Android apps: a practice log for musicians, a pantry expiry list, a "where did I put it" finder, and so on. They now live in one Gradle build: 53 app modules (not all of them are on the store yet). This post is about the parts that made that manageable β€” what we pulled into shared code, what we kept per app, and the checks that run before anything is uploaded.

settings.gradle.kts has one list of app names. Each app keeps its own folder (<app>/app), but the Gradle project is named after the app:

listOf("constella", "sotto", "verso", /* … */ "lessico").forEach { app ->
    include(":$app")
    project(":$app").projectDir = file("$app/app")
}

// Code that is the same in every app lives once, here.
listOf("billing", "ui", "lunar").forEach { m ->
    include(":core:$m")
    project(":core:$m").projectDir = file("core/$m")
}

Having the list in one place turned out to matter beyond Gradle. Our store-listing checker reads the same list with a regex instead of keeping its own copy β€” a hand-kept copy once missed two newly added apps.

build-logic/ is an included build with three precompiled script plugins:

constella.android-app β€” compile/target SDK, the language list, release shrinking, signing from an untracked keystore.properties, Compose, the test setup, and the dependencies every app uses (including :core:ui and :core:billing) constella.android-library β€” the same basics for the core modulesconstella.room β€” for apps that keep their data in Room An app's own build.gradle.kts then only says what is different about it. A whole one looks like this:

plugins {
    id("constella.android-app")
    id("constella.room")
}

android {
    namespace = "io.constella.spartito"
    defaultConfig {
        applicationId = "app.constella.spartito"
        versionCode = 4
        versionName = "1.0.3"
    }
}

When we change the SDK level, the shrinker rules, or the test settings, it is one edit for every app in the build.

Billing lives in :core:billing, which has two source sets with the same API: src/play (Play Billing) and src/free (no-op). A Gradle property picks one:

val billing = providers.gradleProperty("constella.billing").orNull != "false"

android {
    sourceSets["main"].java.srcDir(if (billing) "src/play/java" else "src/free/java")
}

dependencies {
    if (billing) implementation(libs.billing.ktx)
}

With -Pconstella.billing=false the Billing library, and with it the billing permission, is not in the build at all. The app code does not change.

None of the apps asks for INTERNET β€” not in the source manifests, and not in the merged release manifests either, which is where a library could have slipped it in. Most say why in a comment: no account, no sync, nothing to send. Backup is a file the user exports (ZIP or JSON, depending on the app), so there is no server side to run either.

Each app has store/listing_<lang>.md for 18 languages, plus its icon, feature graphic and screenshots. Before anything is uploaded, check_store.py walks every app in the settings list and fails the build if:

It reads PNG sizes straight from the file header, so it needs no image library and no network. Apps that launch in fewer languages on purpose are named in the script, with the reason next to the name.

.github/workflows/ci.yml runs, in order:

python3 check_store.py β€” the listing and asset checks above./gradlew testDebugUnitTest --continue β€” unit tests for all apps./gradlew bundleRelease β€” unsigned release bundles (lint-vital runs here) The store screenshots themselves come out of Robolectric unit tests that render the real screens with demo data and write PNGs. One lesson: declare those PNGs as an output of the test task. Before we did, a test run restored from the build cache passed but left no screenshots behind.

We are running closed tests for some of these apps on Google Play. If you would like to try one and tell us what breaks, the list and opt-in links are here: https://constella-play.web.app

── more in #developer-tools 4 stories Β· sorted by recency
── more on @gradle 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain β€” perfect for shipping the agent you just read about.

$git push zahid main
β†’ Live at https://your-agent.zahid.host βœ“
Get free account β†’ Pricing
from €0/mo Β· no card required
LIVE [news/one-gradle-build-53-…] indexed:0 read:3min 2026-11-16 Β· β€”