Skip to content

Honor effective Gradle Isolated Projects flags in KSP source wiring - #3189

Closed
gregjotau wants to merge 1 commit into
google:mainfrom
gregjotau:codex/isolated-projects-build-features
Closed

Honor effective Gradle Isolated Projects flags in KSP source wiring#3189
gregjotau wants to merge 1 commit into
google:mainfrom
gregjotau:codex/isolated-projects-build-features

Conversation

@gregjotau

Copy link
Copy Markdown

fix #3188

@google-cla

google-cla Bot commented Sep 5, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@gregjotau

Copy link
Copy Markdown
Author

The current property-only check does not see --isolated-projects, and it ignores --no-isolated-projects overriding a property. This patch uses injected BuildFeatures.isolatedProjects.active on Gradle 8.5+ and keeps the existing property fallback on older Gradle versions. The explicit ksp.project.isolation.enabled=true opt-in is preserved even when Gradle isolation is disabled.

Before the implementation change, the focused tests reproduced both wrong values: the CLI enable test returned false and the CLI disable-over-property test returned true. With the change, all six tests pass, with no skips:

  • CLI enable and configuration-cache reuse
  • CLI disable overriding the Gradle property
  • explicit KSP opt-in with isolation disabled
  • Gradle 8.4 compatibility before BuildFeatures exists
  • the legacy isolation property on Gradle 8.5
  • a two-project processor/consumer build compiling actual generated Kotlin classes with only --isolated-projects, then reusing its configuration cache

Validation (JDK 17):

./gradlew :gradle-plugin:validatePlugins :gradle-plugin:test --tests '*ProjectIsolationTest*'

The changed Kotlin files also pass ktfmt 0.63 with the repository's kotlinlang style. Tests consume the build's test Maven publications, using the real plugin classpath and no TestKit classloader injection. No repository-wide test claim is made.

This patch and its tests were substantially prepared and tested with Codex. The draft is available for human review; any required contributor agreement must be completed by the contributor, not the agent.

@gregjotau

Copy link
Copy Markdown
Author

@Mon322812 Can you just open this and get it merged, I dont care about contribution here and the CLA. I just want it fixed :)

@gregjotau gregjotau closed this Sep 5, 2026
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.

Command-line Isolated Projects flags are not reflected in KSP source wiring

2 participants