use of com.synopsys.integration.detectable.detectables.xcode.model.XcodeWorkspaceResult in project synopsys-detect by blackducksoftware.
the class XcodeWorkspaceDetectable method extract.
@Override
public Extraction extract(ExtractionEnvironment extractionEnvironment) throws IOException, ParserConfigurationException, SAXException {
List<CodeLocation> codeLocations = new LinkedList<>();
if (foundPackageResolvedFile != null) {
PackageResolvedResult localResult = packageResolvedExtractor.extract(foundPackageResolvedFile);
Optional<FailedDetectableResult> failedDetectableResult = localResult.getFailedDetectableResult();
if (failedDetectableResult.isPresent()) {
return Extraction.failure(failedDetectableResult.get());
}
codeLocations.add(new CodeLocation(localResult.getDependencyGraph(), environment.getDirectory()));
}
if (foundWorkspaceDataFile != null) {
XcodeWorkspaceResult xcodeWorkspaceResult = xcodeWorkspaceExtractor.extract(foundWorkspaceDataFile, workspaceDirectory);
if (xcodeWorkspaceResult.isFailure()) {
return Extraction.failure(xcodeWorkspaceResult.getFailedDetectableResults());
}
codeLocations.addAll(xcodeWorkspaceResult.getCodeLocations());
}
return Extraction.success(codeLocations);
}
Aggregations