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

Add configuration cache for publishing verification phase #191

Merged
merged 2 commits into from
Nov 18, 2023

Conversation

rpalcolea
Copy link
Member

No description provided.

…derExtension with VerificationViolationsCollectorService build service
@@ -44,23 +45,25 @@ class PublishVerificationPlugin implements Plugin<Project> {

@CompileDynamic
private void setupPlugin(Project project, PublishVerificationExtension extension) {
createVerificationViolationsCollector(project)
Provider<VerificationViolationsCollectorService> serviceProvider = project.getGradle().getSharedServices().registerIfAbsent("verificationViolationsCollectorService", VerificationViolationsCollectorService.class, spec -> {
Copy link
Member Author

Choose a reason for hiding this comment

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

We are moving away from having an extension that was holding violation information to a build service approach that can be used by all tasks in a config cache safe way

@@ -72,14 +75,6 @@ class PublishVerificationPlugin implements Plugin<Project> {
}
}

void createVerificationViolationsCollector(Project project) {
Copy link
Member Author

Choose a reason for hiding this comment

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

bye bye

if (project.rootProject == project) {
reportErrors(verificationViolationsCollectorHolderExtension.get().collector)
}
reportErrors(verificationViolationsCollectorService.get().collector)
Copy link
Member Author

Choose a reason for hiding this comment

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

Removed the need for checking if the project is a rootProject. We register the task only for the rootProject so we should be good with the assumption


import java.util.concurrent.ConcurrentHashMap

abstract class VerificationViolationsCollectorService implements BuildService<BuildServiceParameters.None>, AutoCloseable {
Copy link
Member Author

Choose a reason for hiding this comment

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

Build services ftw!

@rpalcolea rpalcolea force-pushed the publish-verification-config-cache branch from 013e4b6 to bf3ad53 Compare November 18, 2023 01:25
@rpalcolea rpalcolea merged commit 0bf65e2 into main Nov 18, 2023
10 of 12 checks passed
@rpalcolea rpalcolea deleted the publish-verification-config-cache branch November 18, 2023 01:35
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.

1 participant