Skip to content

build: domain modules and one app module per surface #286

Closed

Description

@altaywtf

Parent: #52

Split the single flavored :app into domain library modules and one application module per surface, so CI stops doing the same work once per variant and each domain's public interface is enforced by the compiler.

Decision (Altay): domain modules + two apps. Full feature × surface slices (~30 modules) and a package-only reorg were rejected: the first is over-modularized at ~35k lines, the second gives no build gain.

Why

  • Shared src/main compiles once per variant: six times in verify, about 12s each locally.
  • Shared unit tests and lint run once per surface, and lintVital runs once per release build.
  • testEvidence and testEmulatorHarness declare no inputs, so they rerun on every build.
  • Baseline at 3204b82, ./gradlew verify on an 18-core Mac after a one-line edit: TV-only 46s, mobile-only 53s, shared 76s. CI takes 9–21 min for code PRs.
  • Google's modularization patterns say: "If your app targets multiple device types … define an app module for each one."

Target

core/common   core/design
domain/{files,playback,account,transfers,downloads,history,search,trash,auth}
mobile/   :mobile app, channel flavors, mobile UI in domain packages
tv/       :tv app, channel flavors, TV UI in domain packages
  • Application ids, the channel flavors, Kotlin packages and the MainActivity FQN stay as they are.
  • Domain types used by both apps become public; everything else stays internal.

Slices

The interface tightening the audit turned up (state constructors, shared kernel, downloads placement) is tracked in #288.

Acceptance

  • ./gradlew verify and every debug assemble are green after each slice. The surface split keeps all application ids identical (aapt check).
  • scripts/prove.sh mobile and scripts/prove.sh tv pass on the final layout.
  • Each PR records the before/after incremental verify benchmark.
  • AGENTS.md, README and docs/harness.md describe the new layout and task names.

Written by an agent (Claude Code, Opus 5.5)

Activity

  1. altaywtf commented on Oct 3, 2026

    @altaywtf
    MemberAuthor

    Done. main (eda2d2d) is now 11 library modules under core/ and domain/, plus the :mobile and :tv application modules. Application ids, version names, MainActivity and Kotlin packages are unchanged.

    Follow-ups: #288 (tighten the domain interfaces) and #292 (detekt baselines).


    Written by an agent (Claude Code, Opus 5.5)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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