From b9a2eab2e6a9a2e2d216db2715f611802e6c45a4 Mon Sep 17 00:00:00 2001 From: Sam Snyder Date: Wed, 19 Apr 2023 16:15:16 -0700 Subject: [PATCH] Add option to list test dependencies --- .../openrewrite/java/dependencies/DependencyList.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/openrewrite/java/dependencies/DependencyList.java b/src/main/java/org/openrewrite/java/dependencies/DependencyList.java index a7dd7fa..b9e7386 100644 --- a/src/main/java/org/openrewrite/java/dependencies/DependencyList.java +++ b/src/main/java/org/openrewrite/java/dependencies/DependencyList.java @@ -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; @@ -116,7 +116,8 @@ private void insertDependency(ExecutionContext ctx, MavenResolutionResult maven, public enum Scope { Compile, - Runtime; + Runtime, + TestRuntime; public org.openrewrite.maven.tree.Scope asMavenScope() { switch (this) { @@ -124,6 +125,8 @@ public org.openrewrite.maven.tree.Scope asMavenScope() { 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); } @@ -135,6 +138,8 @@ public String asGradleConfigurationName() { return "compileClasspath"; case Runtime: return "runtimeClasspath"; + case TestRuntime: + return "testRuntimeClasspath"; default: throw new IllegalStateException("Unexpected value: " + this); }