Skip to content

Refactor: Update dependencies and plugins to use version catalog#91

Merged
baraa0abd merged 20 commits into
developfrom
refactor/refactor-gradle
Jul 20, 2025
Merged

Refactor: Update dependencies and plugins to use version catalog#91
baraa0abd merged 20 commits into
developfrom
refactor/refactor-gradle

Conversation

@baraa0abd

Copy link
Copy Markdown
Collaborator

This commit refactors the build configuration to utilize the version catalog for managing dependencies and plugins.

Specific changes:

  • Migrated plugin declarations in build.gradle.kts files (root, app, data, designSystem, detectImageContent, presentation, domain) to use aliases from the version catalog.
  • Updated dependency declarations in module-level build.gradle.kts files to reference versions and libraries defined in gradle/libs.versions.toml.
  • Added new entries to gradle/libs.versions.toml for firebase, ksp, ktor, room, and other libraries.
  • Removed direct version specifications from build.gradle.kts files.
  • In data/build.gradle.kts:
    • Changed android.buildFeatures.buildConfig = true to the buildFeatures block.
    • Enabled isMinifyEnabled and isShrinkResources for debug builds.
  • Added data/consumer-rules.pro with keep rules for serialization, Retrofit, Room, and Kotlin data classes.
  • Updated Java compatibility in domain/build.gradle.kts to version 17.
  • Removed redundant dependencies and unused espresso-core from several modules.

This commit refactors the build configuration to utilize the version catalog for managing dependencies and plugins.

Specific changes:
- Migrated plugin declarations in `build.gradle.kts` files (root, app, data, designSystem, detectImageContent, presentation, domain) to use aliases from the version catalog.
- Updated dependency declarations in module-level `build.gradle.kts` files to reference versions and libraries defined in `gradle/libs.versions.toml`.
- Added new entries to `gradle/libs.versions.toml` for firebase, ksp, ktor, room, and other libraries.
- Removed direct version specifications from `build.gradle.kts` files.
- In `data/build.gradle.kts`:
    - Changed `android.buildFeatures.buildConfig = true` to the `buildFeatures` block.
    - Enabled `isMinifyEnabled` and `isShrinkResources` for debug builds.
- Added `data/consumer-rules.pro` with keep rules for serialization, Retrofit, Room, and Kotlin data classes.
- Updated Java compatibility in `domain/build.gradle.kts` to version 17.
- Removed redundant dependencies and unused `espresso-core` from several modules.
This commit enables `isMinifyEnabled` and `isShrinkResources` in the release build type for the `app` module. It also removes these properties from the debug build type in the `data` module.

Additionally, the Kotlin Kapt and KSP plugins are added to the `app` module, and the Room compiler dependency is switched from `kapt` to `ksp`. Some dependency versions and implementations have also been updated.

Finally, a commented-out line for `FilteredScreen()` has been removed from `MainActivity.kt`.
@Mohammed-qmr Mohammed-qmr self-requested a review July 18, 2025 07:27
@karrar-abbas

Copy link
Copy Markdown
Contributor

Good work. Solve the conflict before merging.

baraa0abd added 12 commits July 19, 2025 21:55
…gradle

# Conflicts:
#	app/build.gradle.kts
#	data/build.gradle.kts
#	gradle/libs.versions.toml
#	presentation/build.gradle.kts
# Conflicts:
#	presentation/build.gradle.kts
This commit downgrades the Gradle version from 8.11.1 to 8.4.
It also updates various library and plugin versions in `gradle/libs.versions.toml` to align with the older Gradle version.
Additionally, `org.gradle.parallel` and `org.gradle.configureondemand` are set to `false` in `gradle.properties`.
This commit downgrades the Kotlin version from 2.0.21 to 1.9.10. It also updates several dependencies to align with this Kotlin version and makes related adjustments in build configuration files.

Key changes include:
- **Kotlin version downgrade:** Updated `kotlin` and related plugin versions in `gradle/libs.versions.toml` and `.idea/kotlinc.xml`.
- **Dependency updates:** Various libraries in `gradle/libs.versions.toml` have been updated or had their versions adjusted.
- **Build file modifications:**
    - `build.gradle.kts`: Applied plugin aliases consistently.
    - `app/build.gradle.kts`: Switched from `ksp` to `kapt` for Room compiler. Adjusted dependency order.
    - `designSystem/build.gradle.kts` and `presentation/build.gradle.kts`: Set `kotlinCompilerExtensionVersion`. Updated material and foundation dependencies.
    - `domain/build.gradle.kts`: Changed `java-library` plugin alias to `id("java-library")` and added `kotlinx-coroutines-core` dependency.
    - `detectImageContent/build.gradle.kts`: Commented out `coil-network-okhttp` dependency.
- **Coil library update:**
    - `detectImageContent/src/main/java/com/madrid/detectImageContent/GetImageBitmap.kt`: Updated Coil library usage from v3 to v2. This involved changing import paths and the method for getting a Bitmap from an ImageRequest.
This commit includes several updates to the project's dependencies and Gradle configuration:

**Dependency Updates:**
- Updated Ktor to version 2.3.2.
- Updated AndroidX Navigation Compose to version 2.8.0.
- Added various AndroidX UI, Test, Navigation, Ktor, and Kotlin Serialization dependencies.
- Added SLF4J Simple for logging in the `app` module.
- Added Koin Android and Annotations dependencies to the `data` module.

**Gradle Configuration Changes:**
- Enabled parallel builds, caching, and configure on demand in `gradle.properties` for improved build performance.
- Suppressed `compileSdk` warnings in `gradle.properties`.
- Added a custom `cleanAll` task to the root `build.gradle.kts` to forcefully delete build directories.
- Updated plugin aliases in `presentation/build.gradle.kts`.
- Enabled `isMinifyEnabled = true` for the debug build type in the `data` module.
- Added debug build type configuration with `isMinifyEnabled = false` to the `app` module.
- Set `kotlinCompilerExtensionVersion` in `app/build.gradle.kts`.

**ProGuard Rules:**
- Added ProGuard rules for SLF4J, Ktor, and Kotlin Serialization in `app/proguard-rules.pro`.
This commit includes several updates to the project's dependencies and Gradle configuration:

**Dependency Updates:**
- Updated Ktor to version 2.3.2.
- Updated AndroidX Navigation Compose to version 2.8.0.
- Added various AndroidX UI, Test, Navigation, Ktor, and Kotlin Serialization dependencies.
- Added SLF4J Simple for logging in the `app` module.
- Added Koin Android and Annotations dependencies to the `data` module.

**Gradle Configuration Changes:**
- Enabled parallel builds, caching, and configure on demand in `gradle.properties` for improved build performance.
- Suppressed `compileSdk` warnings in `gradle.properties`.
- Added a custom `cleanAll` task to the root `build.gradle.kts` to forcefully delete build directories.
- Updated plugin aliases in `presentation/build.gradle.kts`.
- Enabled `isMinifyEnabled = true` for the debug build type in the `data` module.
- Added debug build type configuration with `isMinifyEnabled = false` to the `app` module.
- Set `kotlinCompilerExtensionVersion` in `app/build.gradle.kts`.

**ProGuard Rules:**
- Added ProGuard rules for SLF4J, Ktor, and Kotlin Serialization in `app/proguard-rules.pro`.
This commit includes several updates to the project's dependencies and Gradle configuration:

**Dependency Updates:**
- Updated Ktor to version 2.3.2.
- Updated AndroidX Navigation Compose to version 2.8.0.
- Added various AndroidX UI, Test, Navigation, Ktor, and Kotlin Serialization dependencies.
- Added SLF4J Simple for logging in the `app` module.
- Added Koin Android and Annotations dependencies to the `data` module.

**Gradle Configuration Changes:**
- Enabled parallel builds, caching, and configure on demand in `gradle.properties` for improved build performance.
- Suppressed `compileSdk` warnings in `gradle.properties`.
- Added a custom `cleanAll` task to the root `build.gradle.kts` to forcefully delete build directories.
- Updated plugin aliases in `presentation/build.gradle.kts`.
- Enabled `isMinifyEnabled = true` for the debug build type in the `data` module.
- Added debug build type configuration with `isMinifyEnabled = false` to the `app` module.
- Set `kotlinCompilerExtensionVersion` in `app/build.gradle.kts`.

**ProGuard Rules:**
- Added ProGuard rules for SLF4J, Ktor, and Kotlin Serialization in `app/proguard-rules.pro`.
Comment thread app/build.gradle.kts Outdated
Comment thread app/build.gradle.kts
Comment thread detectImageContent/build.gradle.kts Outdated
- Removed the `androidx.material3` dependency from `app/build.gradle.kts` as it's not being used.
- Updated the `GetImageBitmap.kt` file to use the latest version of the Coil library for image loading.
- Modified the `MovioDatabase.kt` to allow destructive migration on downgrade in Room.
This commit updates the Room Database library to version 2.7.2.
It also removes an unused OkHttp dependency from the detectImageContent module.
This commit the kotlin-stdlib version to 1.9.10 across all subprojects to resolve compatibility issues.

The `detectImageContent` module has been updated to use the older `coil` library (version 2.x) instead of `coil3` for image loading, as `coil3` requires a newer Kotlin version.

Additionally, Room schema location has been configured in the `data` module's build script.
…gradle

# Conflicts:
#	designSystem/build.gradle.kts
# Conflicts:
#	designSystem/build.gradle.kts
@baraa0abd baraa0abd merged commit 66cdee7 into develop Jul 20, 2025
1 check passed
@yasserahmed10 yasserahmed10 deleted the refactor/refactor-gradle branch July 22, 2025 12:22
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.

6 participants