Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Scaling Android Development without a Monorepo

Scaling Android Development without a Monorepo

Abdulahi Osoble

September 23, 2024
Tweet

More Decks by Abdulahi Osoble

Other Decks in Technology

Transcript

  1. Container (App Shell) * Lives in its own repository *

    “Cont a ins” (depends on) a ll the fe a tures a nd deleg a tes to them * Outputs the f in a l a pk th a t goes to the Pl a y Store
  2. * No fe a ture directly depends on a nother

    * Fe a tures a re option a l (T&Cs a pply) * Aim tow a rds not h a ving n di ff erent w a ys of doing things
  3. interface DependenciesProvider { fun analytics(): AnalyticsProvider fun experiments(): Experiments fun

    locationDependencies(): LocationDependencies fun networkingDependencies(): NetworkingDependencies }
  4. Dependencies • Cont a iner implements DependenciesProvider • Fe a

    ture doesn't need to know the concrete type • We c a n ch a nge det a ils without fe a tures needing to m a ke a ny ch a nges a s long a s the API is consistent
  5. Dependencies Provider * it’s a n interf a ce, so

    we c a n h a ve fun with individu a l dependencies * Wr a p it * No-op it * Repl a ce it
  6. fun resolveDeepLink(uri: String): Intent? { val host = uri.parseHost() val

    feature = features.getOrDefault(host, null) return feature?.deepLinkResolver()?.resolve(uri) }
  7. fun resolveDeepLink(uri: String): Intent? { val host = uri.parseHost() val

    feature = features.getOrDefault(host, null) return feature?.deepLinkResolver()?.resolve(uri) }
  8. fun resolveDeepLink(uri: String): Intent? { val host = uri.parseHost() val

    feature = features.getOrDefault(host, null) return feature?.deepLinkResolver()?.resolve(uri) }
  9. Push Noti f ications • Received by the cont a

    iner a nd deleg a ted, b a sed on a f ield, to the proper fe a ture
  10. Binary Compatibility • Gr a dle will compile e a

    ch module a g a inst the st a ted version • For p a ck a ging a nd runtime, Gr a dle picks the "newest" version
  11. Tooling can Help for our Libs • https://github.com/Kotlin/bin a ry-comp

    a tibility-v a lid a tor • https://github.com/tylerbwong/met a l a v a -gr a dle
  12. Dependency Alignment • Publish BOM or Version c a t

    a log • Centr a lizing control of BOM/Version c a t a log a t a pl a tform level • Pl a tform dependencies only
  13. Challenges • More di ff icult to m a ke

    ch a nges a cross a ll a pps • Deprec a tions a re tricky to m a ke • Extr a cting st a nd a lone SDKs is tricky
  14. for some smaller teams having devx is a distant dream

    but they can continue to scale until their codebase is as big as a whale ignoring the monorepo reviews multiple repos they will use one main repository controls the release version bump PRs will certainly increase since every team builds on their own tests and makes sure it works on their phone uploads their new version to internal maven the ability to rollback makes it a haven tooling comes into play helping to fi nd bugs and slay detect hidden changes before they break catch them early before the mistake di ff erences in size of apks dependency di ff s across the days a central team controls dependencies setting the version and avoiding redundancies let's not forget compatibility too binary and source to name a few using the tools and being aware helps save us from lots of despair unfortunately, that is all the time that i have for this summary rhyme written with 0% GPT by the one and only ahmedre
  15. Scaling with Kotlin Multiplatform • Te a ms h a

    ve their own KMP dependencies • Choice between n a mesp a ce cl a shing a nd "KMP" per fr a mework t a x on iOS • Bridges h a ve to be repe a ted, since types a re a ll slightly di ff erent