Skip to content

Conversation

@jamesarich
Copy link
Collaborator

@jamesarich jamesarich commented Nov 25, 2025

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.

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.

- **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.

Signed-off-by: James Rich <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants