Search in sources :

Example 1 with RunOptions

use of com.blackducksoftware.integration.hub.detect.lifecycle.run.RunOptions in project hub-detect by blackducksoftware.

the class DetectConfigurationFactory method createRunOptions.

public RunOptions createRunOptions() {
    Optional<Boolean> sigScanDisabled = Optional.empty();
    // TODO: Fix this when deprecated properties are removed
    // This is because it is double deprecated so we must check if either property is set.
    final boolean originalPropertySet = detectConfiguration.wasPropertyActuallySet(DetectProperty.DETECT_BLACKDUCK_SIGNATURE_SCANNER_DISABLED);
    final boolean newPropertySet = detectConfiguration.wasPropertyActuallySet(DetectProperty.DETECT_HUB_SIGNATURE_SCANNER_DISABLED);
    if (originalPropertySet || newPropertySet) {
        sigScanDisabled = Optional.of(detectConfiguration.getBooleanProperty(DetectProperty.DETECT_BLACKDUCK_SIGNATURE_SCANNER_DISABLED, PropertyAuthority.None));
    }
    Optional<Boolean> polarisEnabled = Optional.empty();
    if (detectConfiguration.wasPropertyActuallySet(DetectProperty.DETECT_SWIP_ENABLED)) {
        polarisEnabled = Optional.of(detectConfiguration.getBooleanProperty(DetectProperty.DETECT_SWIP_ENABLED, PropertyAuthority.None));
    }
    final String includedTools = detectConfiguration.getProperty(DetectProperty.DETECT_TOOLS, PropertyAuthority.None);
    final String excludedTools = detectConfiguration.getProperty(DetectProperty.DETECT_TOOLS_EXCLUDED, PropertyAuthority.None);
    final DetectToolFilter detectToolFilter = new DetectToolFilter(excludedTools, includedTools, sigScanDisabled, polarisEnabled);
    final boolean unmapCodeLocations = detectConfiguration.getBooleanProperty(DetectProperty.DETECT_PROJECT_CODELOCATION_UNMAP, PropertyAuthority.None);
    final String aggregateName = detectConfiguration.getProperty(DetectProperty.DETECT_BOM_AGGREGATE_NAME, PropertyAuthority.None);
    final String preferredTools = detectConfiguration.getProperty(DetectProperty.DETECT_PROJECT_TOOL, PropertyAuthority.None);
    return new RunOptions(unmapCodeLocations, aggregateName, preferredTools, detectToolFilter);
}
Also used : DetectToolFilter(com.blackducksoftware.integration.hub.detect.workflow.DetectToolFilter) RunOptions(com.blackducksoftware.integration.hub.detect.lifecycle.run.RunOptions)

Aggregations

RunOptions (com.blackducksoftware.integration.hub.detect.lifecycle.run.RunOptions)1 DetectToolFilter (com.blackducksoftware.integration.hub.detect.workflow.DetectToolFilter)1