Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No implicit or explicit dependency on rncToXsd task causes caching to be disabled for some tasks #13668

Closed
wants to merge 3 commits into from

Conversation

erichaagdev
Copy link
Contributor

This change addresses a deprecation warning causing caching to be disabled for some tasks. The deprecation is caused by rncToXsd writing files to src/main/resources of the spring-security-config project. That directory is used as an input to several tasks, so there is ambiguity when computing the task graph. Gradle must therefore disable caching for these tasks.

Prior to this change, a build scan would show us that caching for rncToXsd is disabled to ensure correctness. We can also see the corresponding deprecation warnings. To resolve this, the output of rncToXsd is wired to the main resources source set. This informs Gradle that it must execute rncToXsd before any task using the main resources as an input.

Resolving this deprecation warning caused the same issue for the checkstyleNohttp task of the root project. To address this, the checkstyleNohttp task is made aware of the output of the rncToXsd task from spring-security-config. This makes sure the rncToXsd task is executed before running the checkstyleNohttp task.

Now with these changes, we can see caching is never disabled to ensure correctness and the deprecation warnings are gone. It's worth noting these deprecation warnings prevented the upgrade to Gradle 8.0. Only 2 deprecation warnings remain preventing the upgrade.

This avoids configuring the task eagerly.
This addresses a deprecation warning causing build caching to be
disabled for some tasks. With this change, we tell Gradle that the
rncToXsd task produces output that should be considered a resource.
This clears up ambiguities when computing the task graph.
This addresses a deprecation warning causing build caching to be
disabled for the checkstyleNohttp task. With this change, we tell
Gradle that the rncToXsd task in the spring-security-config project
produces output that should be considered when running the
checkstyleNohttp task. This clears up ambiguities when computing the
task graph.
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Aug 18, 2023
@marcusdacoregio marcusdacoregio self-assigned this Sep 12, 2023
@marcusdacoregio marcusdacoregio added in: build An issue in the build type: task A general task and removed status: waiting-for-triage An issue we've not yet triaged labels Sep 12, 2023
@marcusdacoregio
Copy link
Contributor

Thank you, @erichaagdev. This has been merged via 4ebfa2c 620e6e0 and f026e29 into 5.8.x, 6.0.x, 6.1.x and main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: build An issue in the build type: task A general task
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

3 participants