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

Drop interactivity from rewrite:discover #828

Merged
merged 2 commits into from
Aug 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 4 additions & 51 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,10 @@
<groupId>org.openrewrite</groupId>
<artifactId>rewrite-java-17</artifactId>
</dependency>
<dependency>
<groupId>org.openrewrite</groupId>
<artifactId>rewrite-java-21</artifactId>
</dependency>
<dependency>
<groupId>org.openrewrite</groupId>
<artifactId>rewrite-xml</artifactId>
Expand Down Expand Up @@ -234,43 +238,11 @@
<groupId>io.rsocket</groupId>
<artifactId>rsocket-core</artifactId>
</dependency>
<dependency>
<!-- See https://github.com/advisories/GHSA-599f-7c49-w659 -->
<groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId>
<version>1.12.0</version>
</dependency>
<dependency>
<groupId>org.rocksdb</groupId>
<artifactId>rocksdbjni</artifactId>
<version>${rocksdbjni.version}</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-interactivity-api</artifactId>
<version>1.3</version>
<exclusions>
<!-- https://github.com/apache/maven-archetype/blob/5351651b33fde2cb046e2f103bbc6be3c38acbab/pom.xml -->
<exclusion>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-component-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-container-default</artifactId>
</exclusion>
<exclusion>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-filtering</artifactId>
<version>3.3.2</version>
</dependency>

<dependency>
<!-- plugin interfaces and base classes -->
Expand Down Expand Up @@ -346,25 +318,6 @@
<version>${itf-maven.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.apache.maven.plugin-testing</groupId>
<artifactId>maven-plugin-testing-harness</artifactId>
<version>3.3.0</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-container-default</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.3.1</version>
<scope>test</scope>
</dependency>
</dependencies>

<repositories>
Expand Down
18 changes: 0 additions & 18 deletions src/main/java/org/openrewrite/maven/RewriteDiscoverMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,13 @@
package org.openrewrite.maven;

import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugins.annotations.Component;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.codehaus.plexus.components.interactivity.Prompter;
import org.openrewrite.config.Environment;
import org.openrewrite.config.OptionDescriptor;
import org.openrewrite.config.RecipeDescriptor;
import org.openrewrite.internal.StringUtils;
import org.openrewrite.internal.lang.Nullable;
import org.openrewrite.maven.ui.RecipeDescriptorTreePrompter;
import org.openrewrite.style.NamedStyles;

import java.util.*;
Expand Down Expand Up @@ -60,16 +57,6 @@ public class RewriteDiscoverMojo extends AbstractRewriteMojo {
@Parameter(property = "recursion", defaultValue = "0")
int recursion;

/**
* Whether to enter an interactive shell to explore available recipes. For example:<br>
* {@code ./mvnw rewrite:discover -Dinteractive}
*/
@Parameter(property = "interactive", defaultValue = "false")
boolean interactive;

@SuppressWarnings("NotNullFieldNotInitialized")
@Component
private Prompter prompter;

@Override
public void execute() throws MojoExecutionException {
Expand All @@ -78,11 +65,6 @@ public void execute() throws MojoExecutionException {
if (recipe != null) {
RecipeDescriptor rd = getRecipeDescriptor(recipe, availableRecipeDescriptors);
writeRecipeDescriptor(rd, detail, 0, 0);
} else if (interactive) {
getLog().info("Entering interactive mode, Ctrl-C to exit...");
RecipeDescriptorTreePrompter treePrompter = new RecipeDescriptorTreePrompter(prompter);
RecipeDescriptor rd = treePrompter.execute(availableRecipeDescriptors);
writeRecipeDescriptor(rd, true, 0, 0);
} else {
Collection<RecipeDescriptor> activeRecipeDescriptors = new HashSet<>();
for (String activeRecipe : getActiveRecipes()) {
Expand Down
104 changes: 0 additions & 104 deletions src/main/java/org/openrewrite/maven/ui/RecipeDescriptorTree.java

This file was deleted.

This file was deleted.

16 changes: 0 additions & 16 deletions src/main/java/org/openrewrite/maven/ui/package-info.java

This file was deleted.