Search in sources :

Example 1 with DetectorRuleFactory

use of com.synopsys.integration.detect.tool.detector.DetectorRuleFactory in project synopsys-detect by blackducksoftware.

the class OperationFactory method executeDetectors.

public final DetectorToolResult executeDetectors() throws OperationException {
    return auditLog.namedPublic("Execute Detectors", "Detectors", () -> {
        DetectorToolOptions detectorToolOptions = detectConfigurationFactory.createDetectorToolOptions();
        DetectorRuleFactory detectorRuleFactory = new DetectorRuleFactory();
        DetectorRuleSet detectRuleSet = detectorRuleFactory.createRules(detectDetectableFactory, detectorToolOptions.isBuildless());
        DetectorTool detectorTool = new DetectorTool(new DetectorFinder(), extractionEnvironmentProvider, eventSystem, codeLocationConverter, new DetectorIssuePublisher(), statusEventPublisher, exitCodePublisher, detectorEventPublisher);
        return detectorTool.performDetectors(directoryManager.getSourceDirectory(), detectRuleSet, detectConfigurationFactory.createDetectorFinderOptions(), detectConfigurationFactory.createDetectorEvaluationOptions(), detectorToolOptions.getProjectBomTool(), detectorToolOptions.getRequiredDetectors(), fileFinder);
    });
}
Also used : DetectorToolOptions(com.synopsys.integration.detect.configuration.DetectorToolOptions) DetectorFinder(com.synopsys.integration.detector.finder.DetectorFinder) DetectorIssuePublisher(com.synopsys.integration.detect.tool.detector.DetectorIssuePublisher) DetectorRuleFactory(com.synopsys.integration.detect.tool.detector.DetectorRuleFactory) DetectorTool(com.synopsys.integration.detect.tool.detector.DetectorTool) DetectorRuleSet(com.synopsys.integration.detector.rule.DetectorRuleSet)

Example 2 with DetectorRuleFactory

use of com.synopsys.integration.detect.tool.detector.DetectorRuleFactory in project synopsys-detect by blackducksoftware.

the class HelpJsonManager method createHelpJsonDetectorList.

private List<HelpJsonDetector> createHelpJsonDetectorList(boolean buildless) {
    DetectorRuleFactory ruleFactory = new DetectorRuleFactory();
    // TODO: Is there a better way to build a fake set of rules?
    DetectDetectableFactory mockFactory = new DetectDetectableFactory(null, null, null, null, null, null, null, null);
    DetectorRuleSet ruleSet = ruleFactory.createRules(mockFactory, buildless);
    return ruleSet.getOrderedDetectorRules().stream().map(detectorRule -> convertDetectorRule(detectorRule, ruleSet)).collect(Collectors.toList());
}
Also used : Arrays(java.util.Arrays) List(java.util.List) DetectDetectableFactory(com.synopsys.integration.detect.tool.detector.factory.DetectDetectableFactory) DetectableInfo(com.synopsys.integration.detectable.detectable.annotation.DetectableInfo) DetectorRule(com.synopsys.integration.detector.rule.DetectorRule) Gson(com.google.gson.Gson) Detectable(com.synopsys.integration.detectable.Detectable) DetectorRuleFactory(com.synopsys.integration.detect.tool.detector.DetectorRuleFactory) Optional(java.util.Optional) DetectorRuleSet(com.synopsys.integration.detector.rule.DetectorRuleSet) Collectors(java.util.stream.Collectors) DetectProperties(com.synopsys.integration.detect.configuration.DetectProperties) DetectorRuleFactory(com.synopsys.integration.detect.tool.detector.DetectorRuleFactory) DetectDetectableFactory(com.synopsys.integration.detect.tool.detector.factory.DetectDetectableFactory) DetectorRuleSet(com.synopsys.integration.detector.rule.DetectorRuleSet)

Aggregations

DetectorRuleFactory (com.synopsys.integration.detect.tool.detector.DetectorRuleFactory)2 DetectorRuleSet (com.synopsys.integration.detector.rule.DetectorRuleSet)2 Gson (com.google.gson.Gson)1 DetectProperties (com.synopsys.integration.detect.configuration.DetectProperties)1 DetectorToolOptions (com.synopsys.integration.detect.configuration.DetectorToolOptions)1 DetectorIssuePublisher (com.synopsys.integration.detect.tool.detector.DetectorIssuePublisher)1 DetectorTool (com.synopsys.integration.detect.tool.detector.DetectorTool)1 DetectDetectableFactory (com.synopsys.integration.detect.tool.detector.factory.DetectDetectableFactory)1 Detectable (com.synopsys.integration.detectable.Detectable)1 DetectableInfo (com.synopsys.integration.detectable.detectable.annotation.DetectableInfo)1 DetectorFinder (com.synopsys.integration.detector.finder.DetectorFinder)1 DetectorRule (com.synopsys.integration.detector.rule.DetectorRule)1 Arrays (java.util.Arrays)1 List (java.util.List)1 Optional (java.util.Optional)1 Collectors (java.util.stream.Collectors)1