Skip to content

Commit

Permalink
refactor(bazel): simplifying
Browse files Browse the repository at this point in the history
  • Loading branch information
Steve Billings committed Oct 7, 2019
1 parent 9a85c15 commit ff955d2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
Expand Up @@ -32,20 +32,15 @@ public class WorkspaceRuleChooser {

@NotNull
public WorkspaceRule choose(final WorkspaceRule ruleFromWorkspaceFile, final String providedBazelDependencyType) throws IntegrationException {
final WorkspaceRule finalBazelDependencyType = deriveDependencyType(ruleFromWorkspaceFile, providedBazelDependencyType);
return finalBazelDependencyType;
}

@NotNull
private WorkspaceRule deriveDependencyType(final WorkspaceRule ruleFromWorkspaceFile, final String providedBazelDependencyType) throws IntegrationException {
final WorkspaceRule finalBazelDependencyType;
final WorkspaceRule finalBazelDependencyType1;
if (StringUtils.isNotBlank(providedBazelDependencyType) && !"UNSPECIFIED".equalsIgnoreCase(providedBazelDependencyType)) {
finalBazelDependencyType = WorkspaceRule.lookup(providedBazelDependencyType);
finalBazelDependencyType1 = WorkspaceRule.lookup(providedBazelDependencyType);
} else if (ruleFromWorkspaceFile != WorkspaceRule.UNKNOWN) {
finalBazelDependencyType = ruleFromWorkspaceFile;
finalBazelDependencyType1 = ruleFromWorkspaceFile;
} else {
throw new IntegrationException("Unable to determine BazelWorkspace dependency rule; try setting it via the property");
}
final WorkspaceRule finalBazelDependencyType = finalBazelDependencyType1;
return finalBazelDependencyType;
}
}
Expand Up @@ -36,7 +36,6 @@ public void testMavenJar() throws ExecutableRunnerException, IntegrationExceptio
final BazelCommandExecutor bazelCommandExecutor = Mockito.mock(BazelCommandExecutor.class);
final BazelVariableSubstitutor bazelVariableSubstitutor = Mockito.mock(BazelVariableSubstitutor.class);
final Pipelines pipelines = new Pipelines(bazelCommandExecutor, bazelVariableSubstitutor);
final List<StepExecutor> steps = pipelines.get(WorkspaceRule.MAVEN_JAR);

final String commonsIoXml = "<?xml version=\"1.1\" encoding=\"UTF-8\" standalone=\"no\"?>\n"
+ "<query version=\"2\">\n"
Expand Down

0 comments on commit ff955d2

Please sign in to comment.