Gradle will set the project source path when possible.
*/
package com.synopsys.integration.detectable.detectables.gradle.inspection.parse;
+import java.io.File;
import java.util.Optional;
+import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -55,8 +57,12 @@ public class GradleReportTransformer {
}
final ExternalId projectId = externalIdFactory.createMavenExternalId(gradleReport.projectGroup, gradleReport.projectName, gradleReport.projectVersionName);
+ if (StringUtils.isNotBlank(gradleReport.projectSourcePath)){
+ return new CodeLocation(graph, projectId, new File(gradleReport.projectSourcePath));
+ } else {
return new CodeLocation(graph, projectId);
}
+ }
private void addConfigurationToGraph(final MutableDependencyGraph graph, final GradleConfiguration configuration) {
final DependencyHistory history = new DependencyHistory();
