Skip to content

Sync multimodule with base and fix customizer.sh#202

Closed
JoseAlcerreca wants to merge 16 commits intomultimodulefrom
multimodule-parity-update-12297434757777862811
Closed

Sync multimodule with base and fix customizer.sh#202
JoseAlcerreca wants to merge 16 commits intomultimodulefrom
multimodule-parity-update-12297434757777862811

Conversation

@JoseAlcerreca
Copy link
Contributor

This PR synchronizes the multimodule branch with the latest improvements from the base branch and fixes several issues in the customizer.sh script.

Key changes:

  1. Edge-to-Edge UI: Enabled edge-to-edge in MainActivity and applied safeDrawingPadding in navigation entries, consistent with the latest UI improvements in the base branch.
  2. Room Configuration: Moved the room.schemaLocation KSP argument to the correct block in core-database.
  3. AGP 9.0 & KSP Migration: Modernized build files by removing redundant kotlin-android and kotlin-kapt plugins (supported natively by AGP 9.0), and migrated annotation processing to KSP across all modules.
  4. Dependency Sync: Updated versions in libs.versions.toml to match the base branch. Added explicit versions for Compose material3 and ui libraries to fix resolution issues encountered during the build.
  5. Customizer Script Fixes:
    • Fixed a typo (rm -rf mv).
    • Improved sed compatibility for both macOS (BSD) and Linux (GNU).
    • Prevented the script from deleting .git and .github folders, allowing users to maintain history and CI/CD setup.
    • Enhanced the MyApplication renaming logic to cover more files.

The changes have been verified by successfully running ./gradlew :app:assembleDebug and ./gradlew test.


PR created automatically by Jules for task 12297434757777862811 started by @JoseAlcerreca

JoseAlcerreca and others added 16 commits August 26, 2022 14:25
Change-Id: I507de0d9ff44c8cefa4635068e762079bd238145
* Add renovate.json

* Sets branches for Renovate

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jose Alcérreca <JoseAlcerreca@users.noreply.github.com>
Feedback from Lou: /bin/bash was v3 but `bash` used a v5, installed with homebrew. This also removes the need to chmod.
…ly (#36)

* Renovate - Offer Kotlin, KSP and Compose compiler updates independently

Fix #34

* [Renovate] Unifies groupName for the kotlin patterns

Co-authored-by: Jose Alcérreca <JoseAlcerreca@users.noreply.github.com>
* Add packaging info to architecture templates

* Update screenshot

* Rename packaging extension to .yaml instead of .yml
- Ported edge-to-edge UI improvements and Room schema configuration from base branch.
- Updated dependencies to align with base (AGP 9.0.1, Kotlin 2.3.10, etc.).
- Migrated all modules from kapt to KSP for Hilt and Room.
- Aligned build files with AGP 9.0 conventions (removed redundant Kotlin plugins, updated packaging block).
- Fixed customizer.sh: corrected typos, improved sed portability, and made it less destructive by retaining .git and .github directories.
- Added explicit versions for Compose libraries in libs.versions.toml to ensure build stability in multi-module setup.

Co-authored-by: JoseAlcerreca <609125+JoseAlcerreca@users.noreply.github.com>
@google-labs-jules
Copy link

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@gemini-code-assist
Copy link

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request brings the multimodule branch up-to-date with the latest base branch improvements, focusing on modernizing the Android build system and enhancing the user interface. It ensures compatibility with newer Android Gradle Plugin versions, streamlines dependency management, and refines the project's customization script for better usability and robustness.

Highlights

  • Edge-to-Edge UI Implementation: Enabled edge-to-edge display in MainActivity and applied safeDrawingPadding to navigation entries for a modern UI experience.
  • Build System Modernization: Migrated build files to support AGP 9.0, removed redundant Kotlin plugins, and transitioned annotation processing to KSP across all modules.
  • Room Database Configuration: Correctly placed room.schemaLocation KSP argument within the core-database module for proper Room auto-migrations.
  • Dependency Management Updates: Synchronized dependency versions in libs.versions.toml with the base branch and explicitly defined Compose Material3 and UI library versions to resolve build issues.
  • Customizer Script Enhancements: Fixed a typo, improved sed compatibility for different OS, prevented deletion of .git and .github directories, and expanded app renaming logic in customizer.sh.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • .gitignore
    • Added common build and IDE-related files to ignore.
  • .google/packaging.yaml
    • Removed trailing newline to standardize file format.
  • README.md
    • Updated project description, features, and usage instructions.
  • app/.gitignore
    • Added build directory to ignore.
  • app/build.gradle.kts
    • Configured application module with KSP, Hilt, Compose, and set compile/target SDK to 36.
  • app/proguard-rules.pro
    • Added default ProGuard rules for the application module.
  • app/src/main/AndroidManifest.xml
    • Defined application components, permissions, and activity settings.
  • app/src/main/java/android/template/MyApplication.kt
    • Added Hilt-enabled application class.
  • app/src/main/java/android/template/ui/MainActivity.kt
    • Implemented MainActivity with edge-to-edge display and Compose content setup.
  • app/src/main/java/android/template/ui/Navigation.kt
    • Configured Compose navigation for the main application flow.
  • app/src/main/res/drawable-v24/ic_launcher_foreground.xml
    • Added adaptive launcher icon foreground.
  • app/src/main/res/drawable/ic_launcher_background.xml
    • Added adaptive launcher icon background.
  • app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
    • Added adaptive launcher icon definition.
  • app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
    • Added adaptive round launcher icon definition.
  • app/src/main/res/values/strings.xml
    • Defined application name string resource.
  • app/src/main/res/values/themes.xml
    • Defined application theme.
  • app/src/main/res/xml/backup_rules.xml
    • Added Android backup rules configuration.
  • app/src/main/res/xml/data_extraction_rules.xml
    • Added Android data extraction rules configuration.
  • build.gradle.kts
    • Added a comment indicating it as the root build file.
  • core-data/.gitignore
    • Added build directory to ignore.
  • core-data/build.gradle.kts
    • Configured data module with KSP, Hilt, and coroutines dependencies.
  • core-data/src/main/java/android/template/core/data/MyModelRepository.kt
    • Defined and implemented MyModelRepository for data operations.
  • core-data/src/main/java/android/template/core/data/di/DataModule.kt
    • Provided Hilt module for MyModelRepository and a fake implementation.
  • core-data/src/test/java/android/template/data/DefaultMyModelRepositoryTest.kt
    • Added a unit test for DefaultMyModelRepository.
  • core-database/.gitignore
    • Added build directory to ignore.
  • core-database/build.gradle.kts
    • Configured database module with KSP, Room, Hilt, and specified Room schema location.
  • core-database/schemas/android.template.core.database.AppDatabase/1.json
    • Added Room database schema version 1.
  • core-database/src/main/java/android/template/core/database/AppDatabase.kt
    • Defined Room database abstract class.
  • core-database/src/main/java/android/template/core/database/MyModel.kt
    • Defined Room entity MyModel and its DAO.
  • core-database/src/main/java/android/template/core/database/di/DatabaseModule.kt
    • Provided Hilt module for Room database and DAO.
  • core-testing/.gitignore
    • Added build directory to ignore.
  • core-testing/build.gradle.kts
    • Configured testing module with Hilt testing dependencies.
  • core-testing/src/main/java/android/template/core/testing/HiltTestRunner.kt
    • Implemented a custom AndroidJUnitRunner for Hilt tests.
  • core-ui/.gitignore
    • Added build directory to ignore.
  • core-ui/build.gradle.kts
    • Configured UI module with Compose and core Android dependencies.
  • core-ui/src/main/java/android/template/core/ui/Color.kt
    • Defined Compose color palette.
  • core-ui/src/main/java/android/template/core/ui/Theme.kt
    • Implemented Compose Material3 theme with dynamic color support.
  • core-ui/src/main/java/android/template/core/ui/Type.kt
    • Defined Compose typography styles.
  • customizer.sh
    • Updated script with improved sed compatibility, typo fix, and enhanced file/directory renaming logic.
  • feature-mymodel-navigation/.gitignore
    • Added build directory to ignore.
  • feature-mymodel-navigation/build.gradle.kts
    • Configured navigation module with Compose and Kotlin serialization dependencies.
  • feature-mymodel-navigation/src/main/java/android/template/feature/mymodel/navigation/NavigationKeys.kt
    • Defined NavKey for main navigation.
  • feature-mymodel/.gitignore
    • Added build directory to ignore.
  • feature-mymodel/build.gradle.kts
    • Configured feature module with data, UI, navigation, Hilt, and testing dependencies.
  • feature-mymodel/src/androidTest/java/android/template/feature/mymodel/ui/MyModelScreenTest.kt
    • Added an instrumented UI test for MyModelScreen.
  • feature-mymodel/src/main/java/android/template/feature/mymodel/navigation/EntryProvider.kt
    • Provided a Compose navigation entry for MyModelScreen.
  • feature-mymodel/src/main/java/android/template/feature/mymodel/ui/MyModelScreen.kt
    • Implemented the MyModelScreen Composable UI.
  • feature-mymodel/src/main/java/android/template/feature/mymodel/ui/MyModelViewModel.kt
    • Implemented MyModelViewModel to manage UI state and interact with the repository.
  • feature-mymodel/src/test/java/android/template/feature/mymodel/ui/mymodel/MyModelViewModelTest.kt
    • Added a unit test for MyModelViewModel.
  • gradle.properties
    • Added various Gradle configuration properties for performance and AndroidX.
  • gradle/libs.versions.toml
    • Updated dependency versions and added explicit Compose library versions.
  • gradle/wrapper/gradle-wrapper.properties
    • Configured Gradle wrapper distribution URL to version 9.2.1.
  • gradlew
    • Added Gradle wrapper executable script.
  • gradlew.bat
    • Added Gradle wrapper batch script for Windows.
  • renovate.json
    • Removed Renovate bot configuration file.
  • settings.gradle.kts
    • Configured root project settings and included all submodules.
  • test-app/.gitignore
    • Added build directory to ignore.
  • test-app/build.gradle.kts
    • Configured test application module with Hilt and Compose testing dependencies.
  • test-app/src/main/java/android/template/test/app/AppTest.kt
    • Added an instrumented test for the main application flow.
  • test-app/src/main/java/android/template/test/app/testdi/TestDatabaseModule.kt
    • Provided a Hilt test module to replace the data repository with a fake implementation.
Ignored Files
  • Ignored by pattern: .github/workflows/** (2)
    • .github/workflows/build_and_local_tests.yml
    • .github/workflows/instrumented_tests.yml
Activity
  • The pull request was automatically created by Jules for a task initiated by @JoseAlcerreca.
  • The changes have been verified by successfully running ./gradlew :app:assembleDebug and ./gradlew test.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@JoseAlcerreca JoseAlcerreca changed the base branch from main to multimodule February 27, 2026 13:07
Copy link

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

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 does an excellent job of synchronizing the multimodule branch with the base branch, incorporating modern Android development practices such as KSP, version catalogs, and edge-to-edge UI. The improvements to the customizer.sh script also significantly enhance its usability and robustness. I have identified a few areas for improvement, including an unused function parameter, an incorrect unit test, and some minor inconsistencies in documentation and file naming that could impact maintainability. Overall, this is a strong update that establishes a solid foundation for the template. Addressing the suggested points will further enhance the quality and clarity of the codebase.

Comment on lines +43 to +47
fun MyModelScreen(
onItemClick: (NavKey) -> Unit,
modifier: Modifier = Modifier,
viewModel: MyModelViewModel = hiltViewModel(),
) {

Choose a reason for hiding this comment

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

high

The onItemClick parameter is declared but remains unused within this composable, nor is it passed to the internal MyModelScreen. This could indicate either missing click handling logic or dead code. If item clicks are not intended, removing this parameter would clarify the component's API. This change would also require an update at the call site in feature-mymodel/src/main/java/android/template/feature/mymodel/navigation/EntryProvider.kt.

fun MyModelScreen(
    modifier: Modifier = Modifier,
    viewModel: MyModelViewModel = hiltViewModel(),
) {


# License

Now in Android is distributed under the terms of the Apache License (Version 2.0). See the

Choose a reason for hiding this comment

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

medium

The phrase "Now in Android is distributed..." appears to be a remnant from another project. It would be clearer to update this to be specific to the current project, for example, "This code is distributed...".

Suggested change
Now in Android is distributed under the terms of the Apache License (Version 2.0). See the
This code is distributed under the terms of the Apache License (Version 2.0). See the

Comment on lines +42 to +45
// Enable room auto-migrations
ksp {
arg("room.schemaLocation", "$projectDir/schemas")
}

Choose a reason for hiding this comment

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

medium

The room.schemaLocation is already configured in the core-database module, which is the appropriate location since it's where the Room database is defined. This declaration in the app module is redundant and could lead to confusion. Removing it would improve the clarity of the build configuration.

}

@Test
fun uiState_onItemSaved_isDisplayed() = runTest {

Choose a reason for hiding this comment

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

medium

The test uiState_onItemSaved_isDisplayed currently has the same implementation as uiState_initiallyLoading and does not verify that an item is saved and displayed. To accurately reflect its name, the test should be updated to invoke viewModel.addMyModel() and then assert that the uiState correctly transitions to a Success state containing the newly added item. Please note that the FakeMyModelRepository might need to be updated to use a hot flow (like StateFlow) for this test to function as expected.

components = [SingletonComponent::class],
replaces = [DataModule::class]
)
interface FakeDataModule {

Choose a reason for hiding this comment

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

medium

The filename TestDatabaseModule.kt is a bit misleading, as the FakeDataModule within it provides a fake implementation for the data layer (MyModelRepository), not the database layer. For better clarity and consistency, I suggest renaming the file to FakeDataModule.kt to align with the name of the interface it contains.

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.

3 participants