Skip to content

Refactor property fetching to Gradle properties - #287

Open
cpaleop wants to merge 1 commit into
touchlab:mainfrom
cpaleop:main
Open

Refactor property fetching to Gradle properties#287
cpaleop wants to merge 1 commit into
touchlab:mainfrom
cpaleop:main

Conversation

@cpaleop

@cpaleop cpaleop commented Jul 20, 2026

Copy link
Copy Markdown

Issue: #285

Summary

The linked issue describes a failure occurring when Gradle Project Isolation feature is enabled.

Project Isolation is promoted to incubating status in Gradle 9.7.0 which allows for early adoption, and some of our repositories only fail with the issue described here.

The issue with my change is that it will probably require changes to your docs. My changes introduce behavioral changes, because properties defined in the root project will no longer be accessible. Only properties set via:

  • gradle.properties
  • Passed as argument with -P prefix in CLI
  • Environment variables

Fix

Followed Gradle's suggestion when it comes to fetching properties, specifically this guide. In addition, this had a nice improvement in Gradle 9.6.0 in regards of configuration cache.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Refactors KMMBridge’s property lookup to use Gradle’s ProviderFactory.gradleProperty(...), addressing incompatibilities with Gradle’s Project Isolation (and improving configuration-cache friendliness) by avoiding cross-project access to the root project’s extensions.

Changes:

  • Replaced root-project ExtraPropertiesExtension lookup with providers.gradleProperty(name).getOrNull().
  • Removed the ExtraPropertiesExtension import as it’s no longer used.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@faogustavo faogustavo 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.

That's great. Thanks for the contribution. Just including a minor note here so we can include it in the release notes later on.

Possible breaking change: support for Gradle Project Isolation

KMMBridge no longer reads its configuration from the root project's extra properties, since cross-project access is incompatible with Gradle Project Isolation. If you set KMMBridge properties (GITHUB_REPO, ENABLE_PUBLISHING, spmBuildTargets, …) via rootProject.ext/extra, your modules will no longer see them. Provide them through a gradle.properties file (project or home dir), the -Pname=value command-line argument, or an ORG_GRADLE_PROJECT_ environment variable.

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