<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Constella Apps</title>
    <description>The latest articles on DEV Community by Constella Apps (@constella_apps).</description>
    <link>https://dev.to/constella_apps</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4247049%2F7ec3c451-a468-4fb0-b69c-a697287fe154.png</url>
      <title>DEV Community: Constella Apps</title>
      <link>https://dev.to/constella_apps</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/constella_apps"/>
    <language>en</language>
    <item>
      <title>One Gradle build, 53 offline Android apps: what lives in the shared core</title>
      <dc:creator>Constella Apps</dc:creator>
      <pubDate>Mon, 16 Nov 2026 06:44:40 +0000</pubDate>
      <link>https://dev.to/constella_apps/one-gradle-build-53-offline-android-apps-what-lives-in-the-shared-core-4gmf</link>
      <guid>https://dev.to/constella_apps/one-gradle-build-53-offline-android-apps-what-lives-in-the-shared-core-4gmf</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;AI disclosure:&lt;/strong&gt; this post was drafted with an AI assistant from our own repository and checked against it before posting. #ABotWroteThis&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;h2&gt;
  
  
  The layout
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;settings.gradle.kts&lt;/code&gt; has one list of app names. Each app keeps its own folder (&lt;code&gt;&amp;lt;app&amp;gt;/app&lt;/code&gt;), but the Gradle project is named after the app:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight kotlin"&gt;&lt;code&gt;&lt;span class="nf"&gt;listOf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"constella"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"sotto"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"verso"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="cm"&gt;/* … */&lt;/span&gt; &lt;span class="s2"&gt;"lessico"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;forEach&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;app&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;
    &lt;span class="nf"&gt;include&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;":$app"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;project&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;":$app"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;projectDir&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;file&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"$app/app"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// Code that is the same in every app lives once, here.&lt;/span&gt;
&lt;span class="nf"&gt;listOf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"billing"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"ui"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"lunar"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;forEach&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;
    &lt;span class="nf"&gt;include&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;":core:$m"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;project&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;":core:$m"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;projectDir&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;file&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"core/$m"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;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.&lt;/p&gt;

&lt;h2&gt;
  
  
  Convention plugins instead of copied build files
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;build-logic/&lt;/code&gt; is an included build with three precompiled script plugins:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;constella.android-app&lt;/code&gt; — compile/target SDK, the language list, release shrinking, signing from an untracked &lt;code&gt;keystore.properties&lt;/code&gt;, Compose, the test setup, and the dependencies every app uses (including &lt;code&gt;:core:ui&lt;/code&gt; and &lt;code&gt;:core:billing&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;constella.android-library&lt;/code&gt; — the same basics for the core modules&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;constella.room&lt;/code&gt; — for apps that keep their data in Room&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;An app's own &lt;code&gt;build.gradle.kts&lt;/code&gt; then only says what is different about it. A whole one looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight kotlin"&gt;&lt;code&gt;&lt;span class="n"&gt;plugins&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;id&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"constella.android-app"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;id&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"constella.room"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="n"&gt;android&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"io.constella.spartito"&lt;/span&gt;
    &lt;span class="n"&gt;defaultConfig&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;applicationId&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"app.constella.spartito"&lt;/span&gt;
        &lt;span class="n"&gt;versionCode&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;
        &lt;span class="n"&gt;versionName&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"1.0.3"&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When we change the SDK level, the shrinker rules, or the test settings, it is one edit for every app in the build.&lt;/p&gt;

&lt;h2&gt;
  
  
  One flag for a free edition
&lt;/h2&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight kotlin"&gt;&lt;code&gt;&lt;span class="kd"&gt;val&lt;/span&gt; &lt;span class="n"&gt;billing&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;providers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;gradleProperty&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"constella.billing"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;orNull&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="s2"&gt;"false"&lt;/span&gt;

&lt;span class="n"&gt;android&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;sourceSets&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"main"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;java&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;srcDir&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;billing&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="s2"&gt;"src/play/java"&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="s2"&gt;"src/free/java"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="n"&gt;dependencies&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;billing&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nf"&gt;implementation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;libs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;billing&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ktx&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;h2&gt;
  
  
  No network permission
&lt;/h2&gt;

&lt;p&gt;None of the apps asks for &lt;code&gt;INTERNET&lt;/code&gt; — 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.&lt;/p&gt;

&lt;h2&gt;
  
  
  Store listings are checked like code
&lt;/h2&gt;

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

&lt;ul&gt;
&lt;li&gt;a listing file is missing, or the title, short description or full description is empty or over Play's limits (30 / 80 / 4000 characters)&lt;/li&gt;
&lt;li&gt;the icon is not 512 × 512 or the feature graphic is not 1024 × 500&lt;/li&gt;
&lt;li&gt;there are fewer than 2 or more than 8 screenshots for a language, or one breaks the size rules (shortest side at least 320 px, longest at most 3840 px, at most 2:1, under 8 MB)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;h2&gt;
  
  
  CI runs the same checks every time
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;.github/workflows/ci.yml&lt;/code&gt; runs, in order:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;python3 check_store.py&lt;/code&gt; — the listing and asset checks above&lt;/li&gt;
&lt;li&gt;a font check that the brand fonts cover the languages routed to them&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;./gradlew testDebugUnitTest --continue&lt;/code&gt; — unit tests for all apps&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;./gradlew bundleRelease&lt;/code&gt; — unsigned release bundles (lint-vital runs here)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;h2&gt;
  
  
  What we would do again
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Keep the module list in one file and make every script read it.&lt;/li&gt;
&lt;li&gt;Put a short reason next to every exception (a skipped language, a pending screenshot set) so the next person knows when to remove it.&lt;/li&gt;
&lt;li&gt;Treat store text and images as build inputs with checks, not as something typed into a console.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;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: &lt;a href="https://constella-play.web.app" rel="noopener noreferrer"&gt;https://constella-play.web.app&lt;/a&gt;&lt;/p&gt;

</description>
      <category>android</category>
      <category>kotlin</category>
      <category>gradle</category>
      <category>abotwrotethis</category>
    </item>
  </channel>
</rss>
