Skip to content

Commit

Permalink
Merge ebf3f1a into b435252
Browse files Browse the repository at this point in the history
  • Loading branch information
crowleySynopsys committed May 15, 2020
2 parents b435252 + ebf3f1a commit 64c55e6
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Expand Up @@ -13,7 +13,7 @@ import com.synopsys.integration.log.PrintStreamIntLogger
buildscript {
ext {
springBootVersion = '2.2.4.RELEASE'
blackDuckCommonVersion = '47.1.0'
blackDuckCommonVersion = '47.1.3'
polarisCommonVersion = '0.13.2'
junitPlatformDefaultTestTags = 'integration, performance, battery'
}
Expand Down
1 change: 1 addition & 0 deletions docs/templates/content/90-releasenotes.ftl
Expand Up @@ -13,6 +13,7 @@ Moved download location of ${solution_name} for the shell script from /tmp to ~/
* The Yarn detector extracts project information from package.json files.
* Added Yarn Detector support for dependencies that are missing a fuzzy version in a lockfile dependency declaration.
* ${solution_name} logs policy violations when it is configured to [fail on policy violations](../properties/configuration/project/#fail-on-policy-violation-severities).
* Added the property [detect.blackduck.signature.scanner.copyright.search](../properties/configuration/signature scanner/#signature-scanner-copyright-search-advanced).

### Changed features
* Users can [upload source](../properties/configuration/signature scanner/#upload-source-mode) files when only [license search](../properties/configuration/signature scanner/#signature-scanner-license-search) is enabled.
Expand Down
Expand Up @@ -337,6 +337,7 @@ open class DetectConfigurationFactory(private val detectConfiguration: PropertyC
val dryRun = PropertyConfigUtils.getFirstProvidedValueOrDefault(detectConfiguration, DetectProperties.DETECT_BLACKDUCK_SIGNATURE_SCANNER_DRY_RUN, DetectProperties.DETECT_HUB_SIGNATURE_SCANNER_DRY_RUN)
val uploadSource = detectConfiguration.getValue(DetectProperties.DETECT_BLACKDUCK_SIGNATURE_SCANNER_UPLOAD_SOURCE_MODE)
val licenseSearch = detectConfiguration.getValue(DetectProperties.DETECT_BLACKDUCK_SIGNATURE_SCANNER_LICENSE_SEARCH)
val copyrightSearch = detectConfiguration.getValue(DetectProperties.DETECT_BLACKDUCK_SIGNATURE_SCANNER_COPYRIGHT_SEARCH)
val codeLocationPrefix = detectConfiguration.getValue(DetectProperties.DETECT_PROJECT_CODELOCATION_PREFIX).orElse(null)
val codeLocationSuffix = detectConfiguration.getValue(DetectProperties.DETECT_PROJECT_CODELOCATION_SUFFIX).orElse(null)
val additionalArguments = PropertyConfigUtils.getFirstProvidedValueOrEmpty(detectConfiguration, DetectProperties.DETECT_BLACKDUCK_SIGNATURE_SCANNER_ARGUMENTS, DetectProperties.DETECT_HUB_SIGNATURE_SCANNER_ARGUMENTS).orElse(null)
Expand Down Expand Up @@ -371,7 +372,8 @@ open class DetectConfigurationFactory(private val detectConfiguration: PropertyC
additionalArguments,
maxDepth,
findIndividualFileMatching(),
licenseSearch
licenseSearch,
copyrightSearch
)
}

Expand Down
Expand Up @@ -219,6 +219,11 @@ class DetectProperties {
setHelp("Additional arguments to use when running the Black Duck signature scanner.", "For example: Suppose you are running in bash on Linux and want to use the signature scanner's ability to read a list of directories to exclude from a file (using the signature scanner --exclude-from option). You tell the signature scanner read excluded directories from a file named excludes.txt in your home directory with: --detect.blackduck.signature.scanner.arguments='--exclude-from \${HOME}/excludes.txt'")
setGroups(DetectGroup.SIGNATURE_SCANNER, DetectGroup.GLOBAL)
}
val DETECT_BLACKDUCK_SIGNATURE_SCANNER_COPYRIGHT_SEARCH = BooleanProperty("detect.blackduck.signature.scanner.copyright.search", false).apply {
setInfo("Signature Scanner Copyright Search", "6.4.0")
setHelp("When set to true, user will be able to scan and discover copyright names in Black Duck.")
setGroups(DetectGroup.SIGNATURE_SCANNER)
}
val DETECT_BLACKDUCK_SIGNATURE_SCANNER_DRY_RUN = BooleanProperty("detect.blackduck.signature.scanner.dry.run", false).apply {
setInfo("Signature Scanner Dry Run", "4.2.0")
setHelp("If set to true, the signature scanner results are not uploaded to Black Duck, and the scanner results are written to disk.")
Expand Down
Expand Up @@ -214,6 +214,7 @@ protected ScanBatchBuilder createDefaultScanBatchBuilder(final NameVersion proje
signatureScannerOptions.getSnippetMatching().ifPresent(scanJobBuilder::snippetMatching);
scanJobBuilder.uploadSource(signatureScannerOptions.getUploadSource());
scanJobBuilder.licenseSearch(signatureScannerOptions.getLicenseSearch());
scanJobBuilder.copyrightSearch(signatureScannerOptions.getCopyrightSearch());

signatureScannerOptions.getAdditionalArguments().ifPresent(scanJobBuilder::additionalScanArguments);

Expand Down
Expand Up @@ -61,6 +61,7 @@ public class BlackDuckSignatureScannerOptions {
@Nullable
private final IndividualFileMatching individualFileMatching;
private final Boolean licenseSearch;
private final Boolean copyrightSearch;

public BlackDuckSignatureScannerOptions(
final List<Path> signatureScannerPaths,
Expand All @@ -79,7 +80,8 @@ public BlackDuckSignatureScannerOptions(
@Nullable final String additionalArguments,
final Integer maxDepth,
@Nullable final IndividualFileMatching individualFileMatching,
final Boolean licenseSearch) {
final Boolean licenseSearch,
final Boolean copyrightSearch) {

this.signatureScannerPaths = signatureScannerPaths;
this.exclusionPatterns = exclusionPatterns;
Expand All @@ -98,6 +100,7 @@ public BlackDuckSignatureScannerOptions(
this.maxDepth = maxDepth;
this.individualFileMatching = individualFileMatching;
this.licenseSearch = licenseSearch;
this.copyrightSearch = copyrightSearch;
}

public List<Path> getSignatureScannerPaths() {
Expand Down Expand Up @@ -167,4 +170,8 @@ public Optional<IndividualFileMatching> getIndividualFileMatching() {
public Boolean getLicenseSearch() {
return licenseSearch;
}

public Boolean getCopyrightSearch() {
return copyrightSearch;
}
}
Expand Up @@ -121,7 +121,7 @@ private DetectToolFilter mockToolFilterForPolaris(boolean includesPolaris) {
}

private BlackDuckSignatureScannerOptions blackDuckSignatureScannerOptions(Path offlineScannerInstallPath, String userProvidedScannerInstallUrl) {
return new BlackDuckSignatureScannerOptions(Bds.listOf(), Bds.listOf(), Bds.listOf(), offlineScannerInstallPath, null, userProvidedScannerInstallUrl, 1024, 1, false, null, false, null, null, null, 1, null, false);
return new BlackDuckSignatureScannerOptions(Bds.listOf(), Bds.listOf(), Bds.listOf(), offlineScannerInstallPath, null, userProvidedScannerInstallUrl, 1024, 1, false, null, false, null, null, null, 1, null, false, false);
}

private BlackDuckConnectionDetails blackDuckConnectionDetails(boolean offline, String blackduckUrl) {
Expand Down

0 comments on commit 64c55e6

Please sign in to comment.