Skip to content

Comments

Make isolated projects mode pass without issues#2073

Merged
liutikas merged 1 commit intoandroid:mainfrom
liutikas:isolatedprojects
Feb 19, 2026
Merged

Make isolated projects mode pass without issues#2073
liutikas merged 1 commit intoandroid:mainfrom
liutikas:isolatedprojects

Conversation

@liutikas
Copy link
Collaborator

#1842

Test: ./gradlew build -Dorg.gradle.unsafe.isolated-projects=true --dry-run

- Enable KSP isolated projects support google/ksp#1752
- Disable spotless in isolated projects mode diffplug/spotless#1979
- Disable graph tasks in isolated projects mode

android#1842

Test: ./gradlew build -Dorg.gradle.unsafe.isolated-projects=true --dry-run
@liutikas liutikas requested a review from dturner as a code owner February 19, 2026 21:48
@gemini-code-assist
Copy link

Summary of Changes

Hello @liutikas, 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 significantly improves compatibility with Gradle's experimental isolated projects mode. It achieves this by enabling KSP's specific support for isolated projects and by conditionally disabling certain build features, such as Spotless formatting and graph task configuration, when isolated projects are active. These adjustments prevent known issues and allow the project to build successfully in this advanced Gradle configuration.

Highlights

  • KSP Isolated Projects Enabled: The ksp.project.isolation.enabled=true property was added to gradle.properties to enable KSP's isolated projects support, addressing a known issue.
  • Conditional Spotless Application: Spotless configuration is now conditionally applied across AndroidApplicationConventionPlugin, AndroidLibraryConventionPlugin, JvmLibraryConventionPlugin, and RootPlugin only when Gradle's isolated projects mode is not enabled, mitigating incompatibilities.
  • Conditional Graph Task Configuration: Graph tasks, previously configured for all subprojects in RootPlugin, are now also conditionally applied only when isolated projects mode is not enabled, preventing potential issues.
  • Isolated Projects Detection Utility: A new extension function BuildFeatures.isIsolatedProjectsEnabled() was introduced to programmatically check if Gradle's isolated projects feature is active, facilitating the conditional logic in convention plugins.

🧠 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
  • build-logic/convention/src/main/kotlin/AndroidApplicationConventionPlugin.kt
    • Updated plugin class to be abstract and inject BuildFeatures.
    • Conditionally applied Spotless configuration based on isolated projects status.
  • build-logic/convention/src/main/kotlin/AndroidLibraryConventionPlugin.kt
    • Updated plugin class to be abstract and inject BuildFeatures.
    • Conditionally applied Spotless configuration based on isolated projects status.
  • build-logic/convention/src/main/kotlin/JvmLibraryConventionPlugin.kt
    • Updated plugin class to be abstract and inject BuildFeatures.
    • Conditionally applied Spotless configuration based on isolated projects status.
  • build-logic/convention/src/main/kotlin/RootPlugin.kt
    • Updated plugin class to be abstract and inject BuildFeatures.
    • Conditionally applied graph tasks and Spotless configuration based on isolated projects status.
  • build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/ProjectIsolation.kt
    • Added a utility function isIsolatedProjectsEnabled to check if Gradle's isolated projects feature is active.
  • gradle.properties
    • Enabled KSP project isolation by setting a Gradle property.
Activity
  • No specific activity (comments, reviews, or progress updates) has been recorded for this pull request yet.
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.

@liutikas liutikas requested a review from alexvanyo February 19, 2026 21:48
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 correctly implements the changes required to support Gradle's Isolated Projects mode. The primary improvements include:

  1. Conditional Configuration: Convention plugins now inject BuildFeatures to check if isolated projects mode is active, allowing them to skip incompatible configurations like Spotless (which currently has known issues with project isolation).
  2. Project Isolation Compliance: In RootPlugin, the use of target.subprojects (a classic violation of project isolation) is now conditionally disabled, preventing configuration-time errors when the mode is enabled.
  3. KSP Support: The ksp.project.isolation.enabled flag is added to gradle.properties to leverage KSP's internal support for this mode.

The transition to abstract class for the convention plugins is the correct approach to enable Gradle's property injection for BuildFeatures. The implementation is clean, modular, and follows modern Gradle best practices.

@liutikas liutikas merged commit 4a5becf into android:main Feb 19, 2026
6 checks passed
@liutikas liutikas deleted the isolatedprojects branch February 19, 2026 22:27
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