Skip to content

Commit

Permalink
apply workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
ndr-brt committed Feb 23, 2024
1 parent ad1fb03 commit 8ee0591
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ class CheckstyleConvention implements EdcConvention {
public void apply(Project target) {
var extension = requireExtension(target, CheckstyleExtension.class);

guavaWorkaround(target);

extension.setToolVersion(Versions.CHECKSTYLE);
extension.setMaxErrors(0);
extension.setMaxWarnings(0);
Expand All @@ -44,4 +46,14 @@ public void apply(Project target) {
r.getXml().getRequired().set(true);
}));
}

/**
* Ref. <a href="https://github.com/gradle/gradle/issues/27035#issuecomment-1814589243">https://github.com/gradle/gradle/issues/27035#issuecomment-1814589243</a>
*
* @param target the project.
*/
private static void guavaWorkaround(Project target) {
target.getConfigurations().getByName("checkstyle").getResolutionStrategy().getCapabilitiesResolution()
.withCapability("com.google.collections:google-collections", details -> details.select("com.google.guava:guava:0"));
}
}

0 comments on commit 8ee0591

Please sign in to comment.