Skip to content
This repository has been archived by the owner on Jan 5, 2021. It is now read-only.

Commit

Permalink
fixing errors from the merge
Browse files Browse the repository at this point in the history
  • Loading branch information
rottebds committed Jun 19, 2018
1 parent 293b054 commit f7b84f5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 24 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* hub-detect
* detect-configuration
*
* Copyright (C) 2018 Black Duck Software, Inc.
* http://www.blackducksoftware.com/
Expand Down Expand Up @@ -57,21 +57,15 @@
import com.blackducksoftware.integration.hub.detect.help.HelpDescription;
import com.blackducksoftware.integration.hub.detect.help.HelpDetailed;
import com.blackducksoftware.integration.hub.detect.help.HelpGroup;
import com.blackducksoftware.integration.hub.detect.model.BomToolType;
import com.blackducksoftware.integration.hub.detect.search.BomToolFinder;
import com.blackducksoftware.integration.hub.detect.util.TildeInPathResolver;
import com.blackducksoftware.integration.log.Slf4jIntLogger;
import com.blackducksoftware.integration.rest.connection.UnauthenticatedRestConnection;
import com.blackducksoftware.integration.rest.connection.UnauthenticatedRestConnectionBuilder;
import com.blackducksoftware.integration.rest.proxy.ProxyInfo;
import com.blackducksoftware.integration.rest.proxy.ProxyInfoBuilder;
import com.blackducksoftware.integration.util.ExcludedIncludedFilter;
import com.blackducksoftware.integration.util.ResourceUtil;

import groovy.transform.TypeChecked;

@Component
@TypeChecked
public class DetectConfiguration {
private final Logger logger = LoggerFactory.getLogger(DetectConfiguration.class);

Expand Down Expand Up @@ -139,7 +133,6 @@ public class DetectConfiguration {
private boolean usingDefaultSourcePath;
private boolean usingDefaultOutputPath;

private ExcludedIncludedFilter bomToolFilter;
private List<String> bomToolSearchDirectoryExclusions;

public void init(final List<DetectOption> detectOptions) throws DetectUserFriendlyException, IOException, IllegalArgumentException, IllegalAccessException {
Expand Down Expand Up @@ -214,8 +207,6 @@ public void init(final List<DetectOption> detectOptions) throws DetectUserFriend
hubSignatureScannerParallelProcessors = Runtime.getRuntime().availableProcessors();
}

bomToolFilter = new ExcludedIncludedFilter(getExcludedBomToolTypes(), getIncludedBomToolTypes());

configureForDocker();

if (StringUtils.isNotBlank(hubSignatureScannerHostUrl) && StringUtils.isNotBlank(hubSignatureScannerOfflineLocalPath)) {
Expand Down Expand Up @@ -249,7 +240,7 @@ public void init(final List<DetectOption> detectOptions) throws DetectUserFriend
}
try {
if (bomToolSearchExclusionDefaults) {
final String fileContent = ResourceUtil.getResourceAsString(BomToolFinder.class, "/excludedDirectoriesBomToolSearch.txt", StandardCharsets.UTF_8);
final String fileContent = ResourceUtil.getResourceAsString(DetectConfiguration.class, "/excludedDirectoriesBomToolSearch.txt", StandardCharsets.UTF_8);
bomToolSearchDirectoryExclusions.addAll(Arrays.asList(fileContent.split("\r?\n")));
}
} catch (final IOException e) {
Expand Down Expand Up @@ -307,10 +298,6 @@ public boolean isUsingDefaultOutputPath() {
return usingDefaultOutputPath;
}

public boolean isBomToolIncluded(final BomToolType type) {
return bomToolFilter.shouldInclude(type.toString());
}

public String getDetectProperty(final String key) {
return configurableEnvironment.getProperty(key);
}
Expand Down Expand Up @@ -684,7 +671,7 @@ public Map<String, String> getBlackduckHubProperties() {
@DefaultValue("External")
@HelpGroup(primary = GROUP_PROJECT_INFO, additional = { SEARCH_GROUP_PROJECT })
@HelpDescription("An override for the Project Version distribution")
@AcceptableValues(value = { "EXTERNAL", "SAAS", "INTERNAL", "OPENSOURCE" }, caseSensitive = false, strict = false)
@AcceptableValues(value = { "EXTERNAL", "SAAS", "INTERNAL", "OPENSOURCE" }, caseSensitive = false, strict = false, isCommaSeparatedList = true)
private String projectVersionDistribution;

@Value("${detect.project.version.update:}")
Expand All @@ -700,12 +687,6 @@ public Map<String, String> getBlackduckHubProperties() {
@AcceptableValues(value = { "ALL", "BLOCKER", "CRITICAL", "MAJOR", "MINOR", "TRIVIAL" }, caseSensitive = false, strict = false)
private String policyCheckFailOnSeverities;

@Value("${detect.code.location.combine.same.names:}")
@HelpGroup(primary = GROUP_CODELOCATION)
@HelpDescription("If set to true, detect will automatically combine code locations with the same name. Otherwise, duplicate names will be appended with their index.")
@DefaultValue("false")
private Boolean combineCodeLocations;

@Value("${detect.gradle.inspector.version:}")
@DefaultValue("latest")
@HelpGroup(primary = GROUP_GRADLE)
Expand Down Expand Up @@ -1292,7 +1273,7 @@ public String getPolicyCheckFailOnSeverities() {
}

public boolean getCombineCodeLocations() {
return combineCodeLocations;
return false; // for now this is always false, in the future we could introduce a property.
}

public String getGradleInspectorVersion() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* hub-detect
* detect-configuration
*
* Copyright (C) 2018 Black Duck Software, Inc.
* http://www.blackducksoftware.com/
Expand Down

0 comments on commit f7b84f5

Please sign in to comment.