Meshtastic-Android icon indicating copy to clipboard operation
Meshtastic-Android copied to clipboard

feat(build): Upgrade to AGP 9.0 and refactor build logic

Open jamesarich opened this issue 1 month ago • 1 comments

This commit upgrades the Android Gradle Plugin to v9.0.0-beta02 and refactors the build logic to improve modularity, maintainability, and compatibility with the new plugin version.

Key changes include:

  • AGP 9.0.0-beta02 Upgrade:

    • Updated the Android Gradle Plugin from 8.13.1 to 9.0.0-beta02.
    • Replaced deprecated android extension access with the androidComponents API for variant configuration in app/build.gradle.kts.
    • Removed obsolete com.android.library and org.jetbrains.kotlin.android plugin aliases, centralizing plugin management in convention plugins.
    • Set android.newDsl=false in gradle.properties to maintain compatibility with existing build scripts during the transition.
      • Hilt is our big blocker here.
  • Build Logic Refactoring:

    • Centralized SDK and Java version configurations into config.properties, accessed via a new configProperties extension in ProjectExtensions.kt.
    • Updated KotlinAndroid.kt and KmpLibraryConventionPlugin.kt to read compileSdk, minSdk, and targetSdk from the centralized properties.
    • Removed redundant plugin applications (e.g., com.android.library, org.jetbrains.kotlin.android) from individual convention plugins (AndroidLibraryConventionPlugin, AndroidApplicationConventionPlugin, etc.), as they are now handled by base plugins.
    • Simplified AndroidCompose.kt by removing dependency declarations now handled by the compose-compiler plugin.
  • Domain Layer and UseCase:

    • Introduced a new core:domain module to encapsulate business logic.
    • Created SavePacketLogsUseCase to abstract the logic for exporting packet logs to a CSV file, moving this responsibility out of SettingsViewModel.
    • SettingsViewModel now calls SavePacketLogsUseCase for data export, simplifying its implementation.
  • Testing Improvements:

    • Added testFixtures to the core:model module.
    • Created NodeInfoFixtures.kt to provide reusable NodeInfo objects for tests.
    • Refactored NodeInfoTest.kt to use the new fixtures.

jamesarich avatar Nov 25 '25 22:11 jamesarich

:warning: JUnit XML file not found

The CLI was unable to find any JUnit XML files to upload. For more help, visit our troubleshooting guide.

codecov[bot] avatar Dec 05 '25 14:12 codecov[bot]