Skip to content

Commit

Permalink
Merge pull request #107 from gradle/ew/fix-106
Browse files Browse the repository at this point in the history
Do nothing on subsequent applications of this plugins
  • Loading branch information
eriwen authored Jun 26, 2021
2 parents a3f9d22 + 2905b5b commit de2a17f
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,16 @@ public class TestRetryPlugin implements Plugin<Project> {

@Override
public void apply(Project project) {
if (pluginAlreadyApplied(project)) {
return;
}

project.getTasks()
.withType(Test.class)
.configureEach(task -> configureTestTask(task, objectFactory, providerFactory));
}

private static boolean pluginAlreadyApplied(Project project) {
return project.getPlugins().stream().anyMatch(plugin -> plugin.getClass().getName().equals(TestRetryPlugin.class.getName()));
}
}

0 comments on commit de2a17f

Please sign in to comment.