Skip to main content
Version: 2.8

Codebase

Repository layout, namespacing conventions, and build system overview.

Repository Structure​

Meshtastic-Android/
├── androidApp/ # Android application module
│ ├── src/main/ # Shared Android code
│ ├── src/google/ # Google Play flavor (proprietary Google integrations — Gemini, Maps, Play services)
│ └── src/fdroid/ # F-Droid flavor (FOSS-only)
├── desktopApp/ # Desktop JVM application
├── feature/ # Feature modules (KMP)
│ ├── intro/
│ ├── messaging/
│ ├── connections/
│ ├── map/
│ ├── map-maplibre/
│ ├── map-terrain/
│ ├── node/
│ ├── settings/
│ ├── firmware/
│ ├── docs/
│ ├── wifi-provision/
│ ├── widget/
│ └── discovery/
├── core/ # Core infrastructure modules (KMP)
│ ├── barcode/
│ ├── ble/
│ ├── common/
│ ├── data/
│ ├── database/
│ ├── datastore/
│ ├── di/
│ ├── domain/
│ ├── konsist/
│ ├── model/
│ ├── navigation/
│ ├── network/
│ ├── nfc/
│ ├── prefs/
│ ├── repository/
│ ├── resources/
│ ├── service/
│ ├── takserver/
│ ├── testing/
│ └── ui/
├── baselineprofile/ # Baseline Profile generation for :androidApp
├── screenshot-tests/ # Compose Preview screenshot tests (visual-regression gate)
├── docs-screenshots/ # Doc-framed composition screenshots (generate-only, not CI-gated)
├── build-logic/ # Convention plugins and build helpers
│ └── convention/
├── docs/ # Documentation source (markdown)
│ └── en/ # English source; other locales live under docs/<locale>/user/
│ ├── user/
│ └── developer/
├── gradle/ # Gradle wrapper and version catalog
│ └── libs.versions.toml
├── specs/ # Feature specifications
└── .github/workflows/ # CI/CD workflows

Namespacing Convention​

All Kotlin packages follow the pattern:

org.meshtastic.{layer}.{module}.{subpackage}

Examples:

  • org.meshtastic.core.navigation — core navigation module
  • org.meshtastic.feature.docs.ui — docs feature UI package
  • org.meshtastic.app.di — app DI configuration

Build System​

Gradle Kotlin DSL​

All build files use Kotlin DSL (.gradle.kts). Configuration:

  • Version catalog: gradle/libs.versions.toml
  • Convention plugins: build-logic/convention/
  • Settings: settings.gradle.kts

Convention Plugins​

Located in build-logic/convention/src/main/kotlin/. The full set is registered in build-logic/convention/build.gradle.kts; these are the ones a module build applies most often:

PluginPurpose
meshtastic.kmp.featureStandard feature module setup
meshtastic.kmp.libraryShared KMP library module
meshtastic.kmp.library.composeKMP library that also ships Compose UI
meshtastic.kmp.jvm.androidAdds the jvmAndroidMain source set shared by the Android and desktop JVM targets
meshtastic.koinKoin Annotations + K2 compiler plugin
meshtastic.kotlinx.serializationSerialization plugin setup
meshtastic.android.roomRoom KMP setup and schema location
meshtastic.android.screenshotCompose Preview screenshot testing

The rest cover the application and library variants, lint, detekt, spotless, Dokka, Kover, AboutLibraries, analytics, secrets, the docs tasks and the root aggregate — read the register(…) block rather than assuming a plugin does or does not exist.

Build Variants (Android)​

FlavorDescription
googleGoogle Play distribution; includes proprietary APIs
fdroidF-Droid distribution; FOSS-only dependencies

Key Gradle Tasks​

# Compile check of every KMP module for JVM and iosSimulatorArm64 (excludes :desktopApp), plus the device-test APKs
./gradlew kmpSmokeCompile

# Run all tests: allTests covers KMP modules, test covers Android/JVM-only modules; run both
./gradlew test allTests

# Code quality
./gradlew spotlessCheck detekt detektTypeResolved

# Android build
./gradlew assembleGoogleDebug assembleFdroidDebug

# Desktop run
./gradlew :desktopApp:run

# Desktop native installers for the current OS (DMG / MSI+EXE / DEB+RPM+AppImage)
./gradlew :desktopApp:packageReleaseDistributionForCurrentOS

# API reference (Dokka HTML → build/dokka/html)
./gradlew :dokkaGeneratePublicationHtml

Version Catalog Highlights​

Key dependencies in gradle/libs.versions.toml:

CategoryLibrary
ComposeCompose Multiplatform (JetBrains)
NavigationNavigation 3
DIKoin (annotations)
Serializationkotlinx.serialization
DatabaseRoom KMP
NetworkingKtor
Markdownmultiplatform-markdown-renderer
Testingkotlin-test, compose-ui-test