-
Notifications
You must be signed in to change notification settings - Fork 23
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
Conversation
…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 -> { |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Build services ftw!
013e4b6
to
bf3ad53
Compare
No description provided.