use of com.synopsys.integration.detectable.detectables.bazel.pipeline.Pipelines in project synopsys-detect by blackducksoftware.
the class PipelinesTest method doTest.
private List<Dependency> doTest(WorkspaceRule workspaceRule, List<String> expectedBazelCommandArgs, List<String> userProvidedCqueryAdditionalOptions, String input) throws IntegrationException, ExecutableFailedException {
BazelCommandExecutor bazelCommandExecutor = Mockito.mock(BazelCommandExecutor.class);
Mockito.when(bazelCommandExecutor.executeToString(expectedBazelCommandArgs)).thenReturn(Optional.of(input));
BazelVariableSubstitutor bazelVariableSubstitutor = new BazelVariableSubstitutor("/:testTarget", userProvidedCqueryAdditionalOptions);
ExternalIdFactory externalIdFactory = new ExternalIdFactory();
HaskellCabalLibraryJsonProtoParser haskellCabalLibraryJsonProtoParser = new HaskellCabalLibraryJsonProtoParser(new Gson());
Pipelines pipelines = new Pipelines(bazelCommandExecutor, bazelVariableSubstitutor, externalIdFactory, haskellCabalLibraryJsonProtoParser);
Pipeline pipeline = pipelines.get(workspaceRule);
return pipeline.run();
}
use of com.synopsys.integration.detectable.detectables.bazel.pipeline.Pipelines in project synopsys-detect by blackducksoftware.
the class BazelExtractor method extract.
public Extraction extract(ExecutableTarget bazelExe, File workspaceDir, File workspaceFile) throws ExecutableFailedException, DetectableException {
toolVersionLogger.log(workspaceDir, bazelExe, "version");
BazelCommandExecutor bazelCommandExecutor = new BazelCommandExecutor(executableRunner, workspaceDir, bazelExe);
Pipelines pipelines = new Pipelines(bazelCommandExecutor, bazelVariableSubstitutor, externalIdFactory, haskellCabalLibraryJsonProtoParser);
Set<WorkspaceRule> workspaceRulesFromFile = parseWorkspaceRulesFromFile(workspaceFile);
Set<WorkspaceRule> workspaceRulesToQuery = workspaceRuleChooser.choose(workspaceRulesFromFile, workspaceRulesFromProperty);
CodeLocation codeLocation = generateCodelocation(pipelines, workspaceRulesToQuery);
return buildResults(codeLocation, bazelProjectNameGenerator.generateFromBazelTarget(bazelTarget));
}
Aggregations