bazelbuild / migration-tooling

Migration tools for Bazel
Apache License 2.0
45 stars 30 forks source link

Support for Test and Runtime Maven Scopes #3

Closed petroseskinder closed 6 years ago

petroseskinder commented 7 years ago

Within the Resolver class (com.google.devtools.build.workspace.maven package), the resolveEffectiveModel function simply skips over any dependencies that are not scoped as COMPILE. Maven supports five other types of dependencies, of particular note are the test and runtime scope. It would be useful to add support to these scopes as well.

Here is the relevant portion of the Resolver

public Model resolveEffectiveModel(ModelSource modelSource, Set<String> exclusions, Rule parent) {
    Model model = modelResolver.getEffectiveModel(modelSource);
    ...
    for (Dependency dependency : model.getDependencies()) {
      if (!dependency.getScope().equals(COMPILE_SCOPE)) {
        continue;
      }
      ...
    }
    ...
}