Skip to content

Refactor: Move Hilt modules from core to data layer#537

Merged
davidjiagoogle merged 11 commits into
mainfrom
david/hiltRemoval
Jul 23, 2026
Merged

Refactor: Move Hilt modules from core to data layer#537
davidjiagoogle merged 11 commits into
mainfrom
david/hiltRemoval

Conversation

@davidjiagoogle

Copy link
Copy Markdown
Collaborator

Refactor Hilt modules to enforce modularization boundaries:

  • Created :data:common and moved CommonModule out of :core:common.
  • Created :data:camera:low-light and moved LowLightBoostModule out of :core:camera:low-light.
  • Created :data:camera:postprocess and moved PostProcessModule out of :core:camera:postprocess.
  • Moved :core:camera:low-light-playservices to :data:camera:low-light-playservices.
  • Removed unused Hilt/kapt plugins and dependencies from :core:common, :core:settings, :core:camera:low-light, and :core:camera:postprocess.
  • Removed unused hilt.navigation.compose dependency from :ui:components:capture and explicitly declared androidx.core:core-ktx.
  • Updated all consumer module dependencies and import statements across app, feature, data, and core modules.

…dependencies

- Created :data:common and moved CommonModule out of :core:common.
- Created :data📷low-light and moved LowLightBoostModule out of :core📷low-light.
- Created :data📷postprocess and moved PostProcessModule out of :core📷postprocess.
- Moved :core📷low-light-playservices to :data📷low-light-playservices.
- Removed unused Hilt/kapt plugins and dependencies from :core:common, :core:settings, :core📷low-light, and :core📷postprocess.
- Removed unused hilt.navigation.compose dependency from :ui:components:capture and explicitly declared androidx.core:core-ktx.
- Updated all consumer module dependencies and import statements across app, feature, data, and core modules.
@davidjiagoogle
davidjiagoogle requested a review from temcguir July 7, 2026 23:24

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the project structure by introducing a new :data:common module and splitting low-light and postprocess modules into data-specific modules. Feedback highlights an architectural issue where a :core module depends on a :data module, violating clean architecture boundaries; it is recommended to keep qualifier annotations in :core:common and only Hilt modules in :data:common. Additionally, a style guide violation was noted regarding the removal of KDoc documentation for the DefaultCaptureModeOverride annotation.

Comment thread core/camera/build.gradle.kts Outdated
Comment thread data/common/src/main/java/com/google/jetpackcamera/data/common/CommonModule.kt Outdated
davidjiagoogle and others added 2 commits July 7, 2026 23:27
…layering

- Created CommonQualifiers.kt in :core:common with KDoc for all qualifier annotations.
- Added javax.inject to :core:common and removed :data:common dependency from :core:camera.
- Kept only Hilt @module in :data:common/CommonModule.kt.
- Updated import statements across consumer modules to com.google.jetpackcamera.core.common.*.
@davidjiagoogle
davidjiagoogle requested a review from Kimblebee July 8, 2026 00:54
@temcguir

temcguir commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request restructures the project's modular architecture by moving Hilt dependency injection modules from core modules into newly created data modules (such as :data:common, :data:camera:low-light, and :data:camera:postprocess). As a result, core modules no longer depend on Hilt or Kapt, which simplifies their dependencies. Additionally, qualifiers have been moved to :core:common using standard javax.inject annotations. I have no feedback to provide as there are no review comments to evaluate.

Comment thread core/camera/low-light-playservices-di/build.gradle.kts
Comment thread core/camera/low-light/low-light-di/build.gradle.kts
Comment thread core/camera/low-light-playservices/build.gradle.kts
Comment thread core/camera/postprocess/postprocess-di/build.gradle.kts
Comment thread core/common/build.gradle.kts Outdated
Comment thread app/src/main/java/com/google/jetpackcamera/di/AppQualifiers.kt
Comment thread app/src/main/java/com/google/jetpackcamera/di/AppQualifiers.kt
Comment thread app/src/main/java/com/google/jetpackcamera/di/AppQualifiers.kt
…omments)

- Delete data:common and move CommonModule and AppQualifiers to app module
- Reorganize low-light, low-light-playservices, and postprocess DI modules into core:camera:*:*-di sub-modules
- Revert low-light-playservices to core and remove Hilt/kapt plugins from base capability modules
- Remove @Inject and @qualifier annotations from core constructors and instantiate core classes via @provides
- Update settings.gradle.kts and app module dependencies
@davidjiagoogle
davidjiagoogle requested a review from temcguir July 22, 2026 01:05

@temcguir temcguir left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two minor pieces of feedback from the last check were missed. Could you address these before we merge?

Comment thread core/common/build.gradle.kts Outdated
Comment thread app/src/main/java/com/google/jetpackcamera/di/AppQualifiers.kt
davidjiagoogle and others added 6 commits July 23, 2026 18:00
- Change annotation classes in AppQualifiers.kt to internal annotation class per styleguide
- Remove unused javax.inject dependency declaration from core:common build.gradle.kts
- Refactor feature:postcapture, ui:uistate:postcapture, and ui:uistateadapter:postcapture build scripts to use libs.versions.compileSdk
@davidjiagoogle
davidjiagoogle enabled auto-merge (squash) July 23, 2026 19:48
@davidjiagoogle
davidjiagoogle disabled auto-merge July 23, 2026 19:49
@davidjiagoogle
davidjiagoogle merged commit 57371e0 into main Jul 23, 2026
11 of 12 checks passed
@davidjiagoogle
davidjiagoogle deleted the david/hiltRemoval branch July 23, 2026 19:49
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