This guide outlines the step-by-step process for adding a new module to the project. Android-specific and Multiplatform module build configs are supported via baselines convention plugins.


1️⃣ Decide Where the Module Belongs

First, determine which layer your module should live in. This helps maintain a clean architectural separation:

Layer Purpose
ui User interface logic, navigation, screens, theming
domain Business logic, use-case orchestration, app rules
data Repository implementations, network, local storage
toolkit Reusable utilities, wrappers, DI, logging, crypto, time, etc.

2️⃣ Create the Module Directory

Create a new directory under the corresponding layer. For example: ui/profile

3️⃣ Add a build.gradle.kts File

Inside your module directory, create a build.gradle.kts file. The setup depends on whether you're creating a multiplatform or an Android-specific module.

💡 Key Difference: The plugins you apply come from different namespaces:

We’ll break these into separate sections below.

🔀 Multiplatform Module Setup

Use this if your module should compile for both Android and iOS or just iOS.

✅ Step-by-Step:

  1. Apply plugins
plugins {
    alias(libs.plugins.baselines.android.library)
    alias(libs.plugins.baselines.multiplatform.kotlin)
    // Add if it's a UI module:
    alias(libs.plugins.baselines.multiplatform.compose)
}
  1. Set the namespace
android {
    namespace = "com.example.ui.profile"
}
  1. Declare dependencies by target