Skip to content

Commit

Permalink
GH-135: rename dependencyResolutionScope to dependencyResolutionDepth
Browse files Browse the repository at this point in the history
  • Loading branch information
ascopes committed Mar 23, 2024
1 parent 6fe3ecf commit 53137d8
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import static java.util.Objects.requireNonNullElse;
import static java.util.Objects.requireNonNullElseGet;

import io.github.ascopes.protobufmavenplugin.dependency.DependencyResolutionScope;
import io.github.ascopes.protobufmavenplugin.dependency.DependencyResolutionDepth;
import io.github.ascopes.protobufmavenplugin.dependency.MavenArtifact;
import io.github.ascopes.protobufmavenplugin.dependency.ResolutionException;
import io.github.ascopes.protobufmavenplugin.generate.ImmutableGenerationRequest;
Expand Down Expand Up @@ -115,7 +115,7 @@ public abstract class AbstractGenerateMojo extends AbstractMojo {
* @since 1.2.0
*/
@Parameter(defaultValue = "TRANSITIVE")
private DependencyResolutionScope dependencyResolutionScope;
private DependencyResolutionDepth dependencyResolutionDepth;

/**
* Specify additional paths to import protobuf sources from on the local file system.
Expand Down Expand Up @@ -415,7 +415,7 @@ public void execute() throws MojoExecutionException, MojoFailureException {
.binaryMavenPlugins(nonNullList(binaryMavenPlugins))
.binaryPathPlugins(nonNullList(binaryPathPlugins))
.binaryUrlPlugins(nonNullList(binaryUrlPlugins))
.dependencyResolutionScope(dependencyResolutionScope)
.dependencyResolutionDepth(dependencyResolutionDepth)
.jvmMavenPlugins(nonNullList(jvmMavenPlugins))
.importPaths(nonNullList(importPaths)
.stream()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* @author Ashley Scopes
* @since 1.2.0
*/
public enum DependencyResolutionScope {
public enum DependencyResolutionDepth {

/**
* Resolve all transitive dependencies.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ private List<String> resolveAndBuildArgLine(
.resolveDependencyTreePaths(
session,
SCOPES,
DependencyResolutionScope.TRANSITIVE,
DependencyResolutionDepth.TRANSITIVE,
plugin
)
.iterator();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public MavenDependencyPathResolver(
public Collection<Path> resolveProjectDependencyPaths(
MavenSession session,
Set<String> allowedScopes,
DependencyResolutionScope dependencyResolutionScope
DependencyResolutionDepth dependencyResolutionDepth
) throws ResolutionException {
var paths = new ArrayList<Path>();

Expand All @@ -66,7 +66,7 @@ public Collection<Path> resolveProjectDependencyPaths(
paths.addAll(resolveDependencyTreePaths(
session,
allowedScopes,
dependencyResolutionScope,
dependencyResolutionDepth,
artifact
));
}
Expand All @@ -77,7 +77,7 @@ public Collection<Path> resolveProjectDependencyPaths(
public Collection<Path> resolveDependencyTreePaths(
MavenSession session,
Set<String> allowedScopes,
DependencyResolutionScope dependencyResolutionScope,
DependencyResolutionDepth dependencyResolutionDepth,
MavenArtifact artifact
) throws ResolutionException {
log.debug("Resolving dependency '{}'", artifact);
Expand All @@ -86,7 +86,7 @@ public Collection<Path> resolveDependencyTreePaths(
var artifactPath = resolveArtifact(session, artifact);
allDependencyPaths.add(artifactPath);

if (dependencyResolutionScope == DependencyResolutionScope.DIRECT) {
if (dependencyResolutionDepth == DependencyResolutionDepth.DIRECT) {
log.debug("Not resolving transitive dependencies of '{}'", artifact);
return allDependencyPaths;

Check warning on line 91 in src/main/java/io/github/ascopes/protobufmavenplugin/dependency/MavenDependencyPathResolver.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/io/github/ascopes/protobufmavenplugin/dependency/MavenDependencyPathResolver.java#L90-L91

Added lines #L90 - L91 were not covered by tests
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package io.github.ascopes.protobufmavenplugin.generate;

import io.github.ascopes.protobufmavenplugin.dependency.DependencyResolutionScope;
import io.github.ascopes.protobufmavenplugin.dependency.DependencyResolutionDepth;
import io.github.ascopes.protobufmavenplugin.dependency.MavenArtifact;
import java.net.URL;
import java.nio.file.Path;
Expand All @@ -39,7 +39,7 @@ public interface GenerationRequest {

Collection<URL> getBinaryUrlPlugins();

DependencyResolutionScope getDependencyResolutionScope();
DependencyResolutionDepth getDependencyResolutionDepth();

Collection<Path> getImportPaths();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package io.github.ascopes.protobufmavenplugin.generate;

import io.github.ascopes.protobufmavenplugin.dependency.BinaryPluginResolver;
import io.github.ascopes.protobufmavenplugin.dependency.DependencyResolutionScope;
import io.github.ascopes.protobufmavenplugin.dependency.DependencyResolutionDepth;
import io.github.ascopes.protobufmavenplugin.dependency.JvmPluginResolver;
import io.github.ascopes.protobufmavenplugin.dependency.MavenDependencyPathResolver;
import io.github.ascopes.protobufmavenplugin.dependency.ProtocResolver;
Expand Down Expand Up @@ -174,13 +174,13 @@ private Collection<ProtoFileListing> discoverImportPaths(

log.debug(
"Finding importable protobuf sources from the classpath ({})",
request.getDependencyResolutionScope()
request.getDependencyResolutionDepth()
);

var dependencyPaths = mavenDependencyPathResolver.resolveProjectDependencyPaths(
session,
request.getAllowedDependencyScopes(),
request.getDependencyResolutionScope()
request.getDependencyResolutionDepth()
);

var inheritedDependencies = protoListingResolver
Expand Down

0 comments on commit 53137d8

Please sign in to comment.