Skip to content

Commit

Permalink
refactor(battery): Switched from hardcoded strings to detect properties.
Browse files Browse the repository at this point in the history
  • Loading branch information
taikuukaits committed Oct 28, 2019
1 parent b620434 commit a74637f
Showing 1 changed file with 12 additions and 4 deletions.
Expand Up @@ -150,10 +150,18 @@ public void run() {

private void runDetect(final List<String> additionalArguments) throws IOException, ExecutableRunnerException {
final List<String> detectArguments = new ArrayList<>();
detectArguments.addAll(Arrays.asList("--detect.tools=DETECTOR", "--blackduck.offline.mode=true", "--detect.output.path=" + outputDirectory, "--detect.bdio.output.path=" + bdioDirectory, "--detect.cleanup=false"));

detectArguments.add("--logging.level.detect=DEBUG");
detectArguments.add("--detect.source.path=" + sourceDirectory.getCanonicalPath());
final Map<DetectProperty, String> properties = new HashMap<>();

properties.put(DetectProperty.DETECT_TOOLS, "DETECTOR");
properties.put(DetectProperty.BLACKDUCK_OFFLINE_MODE, "true");
properties.put(DetectProperty.DETECT_OUTPUT_PATH, outputDirectory.getCanonicalPath());
properties.put(DetectProperty.DETECT_BDIO_OUTPUT_PATH, bdioDirectory.getCanonicalPath());
properties.put(DetectProperty.DETECT_CLEANUP, "false");
properties.put(DetectProperty.LOGGING_LEVEL_COM_SYNOPSYS_INTEGRATION, "DEBUG");
properties.put(DetectProperty.DETECT_SOURCE_PATH, sourceDirectory.getCanonicalPath());
for (final Map.Entry<DetectProperty, String> entry : properties.entrySet()) {
detectArguments.add("--" + entry.getKey().getPropertyKey() + "=" + entry.getValue());
}

detectArguments.addAll(additionalArguments);
detectArguments.addAll(additionalProperties);
Expand Down

0 comments on commit a74637f

Please sign in to comment.