}
// create deployment candidate for each local component
for (Component localComponent : localComponentList) {
DeploymentComponent deploymentComponent =
createNewDeploymentComponent(localComponent, remoteEnabledComponentTypes);
deploymentComponent.setRemoteFound(false);
// if packaged content, check against retrieved non-package stuff to determine if the component
// exists in the destination, but is not packaged.
if (!localComponent.isPackageManifest() && Utils.isNotEmpty(localProjectPackage.getName())
&& !Constants.DEFAULT_PACKAGED_NAME.equals(localProjectPackage.getName())) {
Component remoteComponent =
remoteProjectPackageList.getComponentByFilePath(localComponent.getMetadataFilePath());
if (remoteComponent != null) {
initDeploymentComponent(deploymentComponent, localComponent, remoteComponent, monitor);
deploymentComponent.setRemoteFound(true);
}
}
boolean added = deploymentComponentSet.add(deploymentComponent, false);
if (added) {
if (logger.isDebugEnabled()) {
logger.debug("Added " + deploymentComponent.getFullDisplayName() + " to deployment set");
}
} else {
if (logger.isDebugEnabled()) {
logger.debug(deploymentComponent.getDisplayName() + " already exists in deployment set");
}
}
}
if (logger.isDebugEnabled()) {
logger.debug("Added [" + deploymentComponentSet.size() + "] deployment components to set");
}
} else {
// found package in destination org
// deep equal check on same-named project package
remoteComponentList = localProjectPackage.getComponentListInstance();
remoteComponentList.addAll(remoteProjectPackage.getComponentList());
if (logger.isDebugEnabled()) {
logger.debug("Comparing all components in local [" + localComponentList.size() + "] and remote ["
+ remoteComponentList.size() + "] package '" + localProjectPackage.getName() + "'");
}
for (Component localComponent : localComponentList) {
DeploymentComponent deploymentComponent =
getDeploymentComponentForComponent(localComponent, remoteEnabledComponentTypes, monitor);
boolean added = deploymentComponentSet.add(deploymentComponent, true);
if (added) {
if (logger.isDebugEnabled()) {
logger.debug("Added " + deploymentComponent.getFullDisplayName() + " ("
+ deploymentComponent.getDestinationSummary() + ") to deployment set");
}
} else {
if (logger.isDebugEnabled()) {
logger.debug(deploymentComponent.getFullDisplayName() + " already exists in deployment set");
}
}
monitorCheck(monitor);
}
// remaining remote components are considered action-able deletes, but are deploy=false (default)
if (Utils.isNotEmpty(remoteComponentList)) {
for (Component remoteComponent : remoteComponentList) {
DeploymentComponent deploymentComponent = createDeleteDeploymentComponent(remoteComponent);
deploymentComponentSet.add(deploymentComponent, false);
if (logger.isDebugEnabled()) {
logger.debug("Remote component " + remoteComponent.getFullDisplayName()
+ " does not exist locally and will be consider as a delete candidate");
}