diff --git a/plugin/src/main/java/org/openrewrite/gradle/RewritePlugin.java b/plugin/src/main/java/org/openrewrite/gradle/RewritePlugin.java index a8a32c142..7f9daf333 100644 --- a/plugin/src/main/java/org/openrewrite/gradle/RewritePlugin.java +++ b/plugin/src/main/java/org/openrewrite/gradle/RewritePlugin.java @@ -71,6 +71,11 @@ public void apply(Project project) { Task checkTask = tasks.getByName("check"); checkTask.dependsOn(rewriteWarnAll); + Task rewriteDiscoverAll = tasks.create("rewriteDiscover", taskClosure(task -> { + task.setGroup("rewrite"); + task.setDescription("Lists all available recipes and their visitors available to each SourceSet"); + })); + sourceSets.all(sourceSet -> { String rewriteFixTaskName = "rewriteFix" + sourceSet.getName().substring(0, 1).toUpperCase() + sourceSet.getName().substring(1); @@ -78,7 +83,8 @@ public void apply(Project project) { rewriteFixAll.configure(taskClosure(it -> it.dependsOn(rewriteFix))); String rewriteDiscoverTaskName = "rewriteDiscover" + sourceSet.getName().substring(0, 1).toUpperCase() + sourceSet.getName().substring(1); - tasks.create(rewriteDiscoverTaskName, RewriteDiscoverTask.class, sourceSet, extension); + RewriteDiscoverTask discoverTask = tasks.create(rewriteDiscoverTaskName, RewriteDiscoverTask.class, sourceSet, extension); + rewriteDiscoverAll.dependsOn(discoverTask); String compileTaskName = sourceSet.getCompileTaskName("java"); Task compileTask = tasks.getByName(compileTaskName); diff --git a/plugin/src/main/java/org/openrewrite/gradle/RewriteWarnTask.java b/plugin/src/main/java/org/openrewrite/gradle/RewriteWarnTask.java index b7867c31b..995bd14de 100644 --- a/plugin/src/main/java/org/openrewrite/gradle/RewriteWarnTask.java +++ b/plugin/src/main/java/org/openrewrite/gradle/RewriteWarnTask.java @@ -72,7 +72,7 @@ public void run() { " by:"); logVisitorsThatMadeChanges(change); } - getLog().warn("Run 'mvn rewrite:fix' to apply the fixes. Afterwards, review and commit the changes."); + getLog().warn("Run 'gradle rewriteFix' to apply the fixes. Afterwards, review and commit the changes."); } } }