Search in sources :

Example 1 with Pipelines

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();
}
Also used : Pipelines(com.synopsys.integration.detectable.detectables.bazel.pipeline.Pipelines) ExternalIdFactory(com.synopsys.integration.bdio.model.externalid.ExternalIdFactory) BazelVariableSubstitutor(com.synopsys.integration.detectable.detectables.bazel.pipeline.step.BazelVariableSubstitutor) Gson(com.google.gson.Gson) HaskellCabalLibraryJsonProtoParser(com.synopsys.integration.detectable.detectables.bazel.pipeline.step.HaskellCabalLibraryJsonProtoParser) BazelCommandExecutor(com.synopsys.integration.detectable.detectables.bazel.pipeline.step.BazelCommandExecutor) Pipeline(com.synopsys.integration.detectable.detectables.bazel.pipeline.Pipeline)

Example 2 with Pipelines

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));
}
Also used : CodeLocation(com.synopsys.integration.detectable.detectable.codelocation.CodeLocation) Pipelines(com.synopsys.integration.detectable.detectables.bazel.pipeline.Pipelines) BazelCommandExecutor(com.synopsys.integration.detectable.detectables.bazel.pipeline.step.BazelCommandExecutor)

Aggregations

Pipelines (com.synopsys.integration.detectable.detectables.bazel.pipeline.Pipelines)2 BazelCommandExecutor (com.synopsys.integration.detectable.detectables.bazel.pipeline.step.BazelCommandExecutor)2 Gson (com.google.gson.Gson)1 ExternalIdFactory (com.synopsys.integration.bdio.model.externalid.ExternalIdFactory)1 CodeLocation (com.synopsys.integration.detectable.detectable.codelocation.CodeLocation)1 Pipeline (com.synopsys.integration.detectable.detectables.bazel.pipeline.Pipeline)1 BazelVariableSubstitutor (com.synopsys.integration.detectable.detectables.bazel.pipeline.step.BazelVariableSubstitutor)1 HaskellCabalLibraryJsonProtoParser (com.synopsys.integration.detectable.detectables.bazel.pipeline.step.HaskellCabalLibraryJsonProtoParser)1