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.
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. |
Create a new directory under the corresponding layer. For example:
ui/profile
build.gradle.kts
FileInside 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:
- Multiplatform module: use plugins under
libs.plugins.baselines.multiplatform.*
- Android-only module: use plugins under
libs.plugins.baselines.android.*
We’ll break these into separate sections below.
Use this if your module should compile for both Android and iOS or just iOS.
✅ Step-by-Step:
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)
}
android {
namespace = "com.example.ui.profile"
}