Skip to content

Replace project.provider with ProviderFactory.provider for configuration cache compliance#295

Open
rpalcolea wants to merge 1 commit intomainfrom
remove-project-provider
Open

Replace project.provider with ProviderFactory.provider for configuration cache compliance#295
rpalcolea wants to merge 1 commit intomainfrom
remove-project-provider

Conversation

@rpalcolea
Copy link
Member

No description provided.

@wakingrufus
Copy link
Member

This doesn't look like it actually fixes anything to me. can you add a test to prove that it does?

@rpalcolea
Copy link
Member Author

This follows https://docs.gradle.org/current/userguide/configuration_cache_requirements.html#config_cache:requirements:use_project_during_execution

Replacing project.provider {} with ProviderFactory.provider {}

Also, all tests use configuration cache

new File(projectDir, 'gradle.properties') << '''org.gradle.configuration-cache=true'''.stripIndent()

@wakingrufus
Copy link
Member

This follows https://docs.gradle.org/current/userguide/configuration_cache_requirements.html#config_cache:requirements:use_project_during_execution

Replacing project.provider {} with ProviderFactory.provider {}

Also, all tests use configuration cache

new File(projectDir, 'gradle.properties') << '''org.gradle.configuration-cache=true'''.stripIndent()

yes, but the Project reference is still retained, even though this usage has been removed. is that not still an issue?

@rpalcolea rpalcolea force-pushed the remove-project-provider branch from 51fe9dd to 58282b8 Compare March 16, 2026 21:39
@rpalcolea
Copy link
Member Author

Added a few tests in 58282b8

My understanding here is that because we are not trying to serialize the project into the Task graph, we are good. The Project reference is retained in ReleasePluginExtension, but it's only accessed during configuration time where DelayedVersion (which calls infer()strategy.selector(project, ...)) is resolved eagerly during configuration in BaseReleasePlugin via project.version.toString()

The resolved version string is then passed into task properties (projectVersion.set(...)) as plain values.

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