Skip to content

Conversation

@keyboardsurfer
Copy link
Member

Several clean up actions with the goal to completely remove lint errors, enable release builds, add basic benchmarking and enable optimizations.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @keyboardsurfer, 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 focuses on a comprehensive cleanup and modernization of the project's build infrastructure and codebase. The changes aim to improve build efficiency, enable release optimizations, and introduce performance benchmarking capabilities. By updating core dependencies and standardizing project structure, the PR sets a stronger foundation for future development and maintenance.

Highlights

  • Build System Updates: The project's build system has been significantly updated, including upgrading Gradle to version 8.14.3, Android Gradle Plugin (AGP) to 8.13.2, and Kotlin to 2.2.0. Numerous other dependencies, such as Compose BOM, Hilt, and Firebase BOM, have also been updated to their latest versions.
  • Release Build Optimizations: Release builds for the main application and sample modules now have minification and resource shrinking enabled by default, removing individual proguard-rules.pro files from sample modules and centralizing optimization configurations.
  • Benchmarking Module Introduction: A new benchmark module has been added to the project, including a benchmark build type and a StartupBenchmark using MacrobenchmarkRule to measure application startup performance.
  • Kotlin Source Directory Migration: All Java source files (.java) across the app module and various samples modules have been moved from src/main/java to src/main/kotlin directories, aligning with modern Kotlin project structure best practices.
  • Codebase Cleanups and API Usage: Minor code cleanups were performed, including updating Kotlin compiler options syntax in Gradle files, adjusting resource lookup from LocalContext to LocalResources in Compose, and modernizing image loading for Android API 28+ in the Magic Selfie sample.

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

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.

Copy link
Contributor

@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

The pull request introduces several positive changes aimed at improving the project's overall health. Key updates include modernizing Gradle configurations, updating dependencies, and migrating to LocalResources for accessing string resources in Compose, which aligns with best practices. The addition of a dedicated benchmark module is a valuable step towards performance monitoring. The removal of proguard-rules.pro files from library modules is appropriate if minification is handled at the app level or if those rules were no longer necessary. Overall, these changes contribute to a more maintainable and performant codebase.

Copy link
Collaborator

@ksemenova ksemenova left a comment

Choose a reason for hiding this comment

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

LGTM overall. I would suggest next time to have separate atomic prs for each refactoring (lint errors, sorting dependencies, adding release builds, benchmarking).

Copy link
Collaborator

@lethargicpanda lethargicpanda left a comment

Choose a reason for hiding this comment

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

The path changes from /main/java to /main/kotlin in the samples is breaking the links in dedicated ReadMe files. I tried to point out the broken ones, but I might have missed some.

Before we merge it, can we book time to discuss the benefits of adding the benchmark to the catalog.

target("gradle/libs.versions.toml")
prettier(mapOf("prettier" to "3.2.5", "prettier-plugin-toml" to "2.0.1"))
.config(mapOf("plugins" to listOf("prettier-plugin-toml")))
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

👌

Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we remove this, if we don't need it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Even without manual content the AndroidManifest will be populated by tools. As part of that the empty file needs to exist.

alias(libs.plugins.google.gms.google.services)
alias(libs.plugins.hilt.plugin)
alias(libs.plugins.jetbrains.kotlin.android)
alias(libs.plugins.jetbrains.kotlin.serialization)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I am curious why this import re-ordering isn't something that Detekt in the github action picked up. Did you run manually?

Copy link
Member Author

Choose a reason for hiding this comment

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

This should be a pre-push or even pre-commit hook. For now its manual.

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