use of com.synopsys.integration.detect.workflow.blackduck.project.options.ProjectGroupFindResult in project synopsys-detect by blackducksoftware.
the class BlackDuckProjectVersionStepRunner method runAll.
ProjectVersionWrapper runAll(NameVersion projectNameVersion, BlackDuckRunData blackDuckRunData) throws DetectUserFriendlyException, OperationException {
CloneFindResult cloneFindResult = findClone(projectNameVersion.getName(), blackDuckRunData);
ProjectGroupFindResult projectGroupFindResult = findProjectGroup(blackDuckRunData);
ProjectVersionLicenseFindResult projectVersionLicensesFindResult = findLicense(blackDuckRunData);
ProjectVersionWrapper projectVersion = operationFactory.syncProjectVersion(projectNameVersion, projectGroupFindResult, cloneFindResult, projectVersionLicensesFindResult, blackDuckRunData);
ParentProjectMapOptions mapOptions = operationFactory.calculateParentProjectMapOptions();
if (StringUtils.isNotBlank(mapOptions.getParentProjectName()) || StringUtils.isNotBlank(mapOptions.getParentProjectVersionName())) {
operationFactory.mapToParentProject(mapOptions.getParentProjectName(), mapOptions.getParentProjectVersionName(), projectVersion, blackDuckRunData);
}
String applicationId = operationFactory.calculateApplicationId();
if (StringUtils.isBlank(applicationId)) {
logger.debug("No 'Application ID' to set.");
} else {
operationFactory.setApplicationId(applicationId, projectVersion, blackDuckRunData);
}
CustomFieldDocument customFieldDocument = operationFactory.calculateCustomFields();
if (customFieldDocument == null || (customFieldDocument.getProject().size() == 0 && customFieldDocument.getVersion().size() == 0)) {
logger.debug("No custom fields to set.");
} else {
operationFactory.updateCustomFields(customFieldDocument, projectVersion, blackDuckRunData);
}
List<String> userGroups = operationFactory.calculateUserGroups();
if (userGroups == null) {
logger.debug("No user groups to set.");
} else {
operationFactory.addUserGroups(userGroups, projectVersion, blackDuckRunData);
}
List<String> tags = operationFactory.calculateTags();
if (tags == null) {
logger.debug("No tags to set.");
} else {
operationFactory.addTags(tags, projectVersion, blackDuckRunData);
}
if (operationFactory.calculateShouldUnmap()) {
logger.debug("Unmapping code locations.");
operationFactory.unmapCodeLocations(projectVersion, blackDuckRunData);
} else {
logger.debug("Will not unmap code locations: Project view was not present, or should not unmap code locations.");
}
return projectVersion;
}
Aggregations