use of com.synopsys.integration.detectable.detectables.bazel.BazelExtractor in project synopsys-detect by blackducksoftware.
the class DetectableFactory method bazelExtractor.
// #endregion
// #region Utility
private BazelExtractor bazelExtractor(BazelDetectableOptions bazelDetectableOptions) {
WorkspaceRuleChooser workspaceRuleChooser = new WorkspaceRuleChooser();
BazelWorkspaceFileParser bazelWorkspaceFileParser = new BazelWorkspaceFileParser();
HaskellCabalLibraryJsonProtoParser haskellCabalLibraryJsonProtoParser = new HaskellCabalLibraryJsonProtoParser(gson);
BazelVariableSubstitutor bazelVariableSubstitutor = new BazelVariableSubstitutor(bazelDetectableOptions.getTargetName().orElse(null), bazelDetectableOptions.getBazelCqueryAdditionalOptions());
BazelProjectNameGenerator bazelProjectNameGenerator = new BazelProjectNameGenerator();
return new BazelExtractor(executableRunner, externalIdFactory, bazelWorkspaceFileParser, workspaceRuleChooser, toolVersionLogger, haskellCabalLibraryJsonProtoParser, bazelDetectableOptions.getTargetName().orElse(null), bazelDetectableOptions.getWorkspaceRulesFromProperty(), bazelVariableSubstitutor, bazelProjectNameGenerator);
}
use of com.synopsys.integration.detectable.detectables.bazel.BazelExtractor in project synopsys-detect by blackducksoftware.
the class BazelDetectableTest method testApplicable.
@Test
public void testApplicable() {
DetectableEnvironment environment = MockDetectableEnvironment.empty();
FileFinder fileFinder = Mockito.mock(FileFinder.class);
Mockito.when(fileFinder.findFile(new File("."), "WORKSPACE")).thenReturn(new File("src/test/resources/functional/bazel/WORKSPACE"));
BazelExtractor bazelExtractor = null;
BazelResolver bazelResolver = null;
BazelDetectableOptions bazelDetectableOptions = new BazelDetectableOptions("target", null, null);
BazelDetectable detectable = new BazelDetectable(environment, fileFinder, bazelExtractor, bazelResolver, bazelDetectableOptions.getTargetName().orElse(null));
assertTrue(detectable.applicable().getPassed());
}
Aggregations