if (bundleTaskCount > 1) {
throw new InvalidBuildFileException(
"More than one rhq:bundle task found - an RHQ bundle Ant build file must contain exactly one rhq:bundle task.");
}
BundleTask bundleTask = (BundleTask) preconfigureTask(unconfiguredBundleTask);
Collection<DeploymentUnitType> deployments = bundleTask.getDeploymentUnits().values();
if (deployments.isEmpty()) {
throw new InvalidBuildFileException(
"The bundle task must contain exactly one rhq:deploymentUnit child element.");
}
DeploymentUnitType deployment = deployments.iterator().next();
if (requireExplicitCompliance && deployment.getCompliance() == null) {
throw new InvalidBuildFileException(
"The deployment unit must specifically declare compliance mode of the destination directory.");
}
project.setDestinationCompliance(deployment.getCompliance());
Map<File, String> files = deployment.getLocalFileNames();
for (String file : files.values()) {
project.getBundleFileNames().add(file);
}
Map<File, String> archives = deployment.getLocalArchiveNames();
for (String archive : archives.values()) {
project.getBundleFileNames().add(archive);
}
List<String> propertyFiles = bundleTask.getLocalPropertyFiles();
for (String propFile : propertyFiles) {
project.getBundleFileNames().add(propFile);
}
// note that we do NOT add url-files and url-archives to the BundleFileNames because those are