Skip to content

Commit

Permalink
Add option to list test dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
sambsnyd committed Apr 19, 2023
1 parent 85965d9 commit b9a2eab
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class DependencyList extends Recipe {

@Option(displayName = "Scope",
description = "The scope of the dependencies to include in the report.",
valid = {"Compile", "Runtime"},
valid = {"Compile", "Runtime", "TestRuntime"},
example = "Compile")
Scope scope;

Expand Down Expand Up @@ -116,14 +116,17 @@ private void insertDependency(ExecutionContext ctx, MavenResolutionResult maven,

public enum Scope {
Compile,
Runtime;
Runtime,
TestRuntime;

public org.openrewrite.maven.tree.Scope asMavenScope() {
switch (this) {
case Compile:
return org.openrewrite.maven.tree.Scope.Compile;
case Runtime:
return org.openrewrite.maven.tree.Scope.Runtime;
case TestRuntime:
return org.openrewrite.maven.tree.Scope.Test;
default:
throw new IllegalStateException("Unexpected value: " + this);
}
Expand All @@ -135,6 +138,8 @@ public String asGradleConfigurationName() {
return "compileClasspath";
case Runtime:
return "runtimeClasspath";
case TestRuntime:
return "testRuntimeClasspath";
default:
throw new IllegalStateException("Unexpected value: " + this);
}
Expand Down

0 comments on commit b9a2eab

Please sign in to comment.