log("Loading EasyAnt module descriptor :" + parser.getClass().getName(), Project.MSG_DEBUG);
try {
parser.parseDescriptor(getEasyAntIvyInstance().getSettings(), buildModule.toURI().toURL(), new URLResource(
buildModule.toURI().toURL()), true);
EasyAntModuleDescriptor md = parser.getEasyAntModuleDescriptor();
ModuleRevisionId currentModule = md.getIvyModuleDescriptor().getModuleRevisionId();
String buildConfigurations = null;
for (String conf : md.getBuildConfigurations()) {
if (buildConfigurations == null) {
buildConfigurations = conf;
} else {
buildConfigurations = buildConfigurations + "," + conf;
}
}
getProject().setProperty(EasyAntMagicNames.AVAILABLE_BUILD_CONFIGURATIONS, buildConfigurations);
updateMainConfs();
for (Iterator<PropertyDescriptor> iterator = md.getProperties().values().iterator(); iterator.hasNext();) {
PropertyDescriptor property = iterator.next();
if (canInherit(property, currentModule)) {
PropertyTask propTask = new PropertyTask();
propTask.setName(property.getName());
propTask.setValue(property.getValue());
propTask.setBuildConfigurations(property.getBuildConfigurations());
propTask.setTaskType("antlib:org.apache.easyant:property");
getOwningTarget().addTask(propTask);
initTask(propTask).execute();
}
}
if (md.getConfigureProjectDescriptor() != null) {
ConfigureProjectDescriptor descriptor = md.getConfigureProjectDescriptor();
ConfigureProject configureProject = new ConfigureProject();
configureProject.setDefaultTarget(descriptor.getDefaultTarget());
configureProject.setBasedir(descriptor.getBasedir());
configureProject.setTaskType("antlib:org.apache.easyant:configure-project");
getOwningTarget().addTask(configureProject);
initTask(configureProject).execute();
}
if (md.getBuildType() != null) {
if (canInherit(md.getBuildType(), currentModule)) {
Import importTask = new Import();
importTask.setMrid(md.getBuildType().getMrid());
importTask.setMode(md.getBuildType().getMode());
importTask.setAs(md.getBuildType().getAs());
importTask.setMandatory(md.getBuildType().isMandatory());
importTask.setBuildConfigurations(md.getBuildType().getBuildConfigurations());
importTask.setDependencies(md.getBuildType().getDependencies());
importTask.setConflicts(md.getBuildType().getConflicts());
importTask.setExcludes(md.getBuildType().getExcludes());
importTask.setTaskType("antlib:org.apache.easyant:import");
getOwningTarget().addTask(importTask);
initTask(importTask).execute();
}
}
for (Iterator<?> iterator = md.getPlugins().iterator(); iterator.hasNext();) {
PluginDescriptor plugin = (PluginDescriptor) iterator.next();
if (canInherit(plugin, currentModule)) {
Import importTask = new Import();
importTask.setMrid(plugin.getMrid());
importTask.setMode(plugin.getMode());
importTask.setAs(plugin.getAs());
importTask.setMandatory(plugin.isMandatory());
importTask.setBuildConfigurations(plugin.getBuildConfigurations());
importTask.setDependencies(plugin.getDependencies());
importTask.setConflicts(plugin.getConflicts());
importTask.setExcludes(plugin.getExcludes());
importTask.setTaskType("antlib:org.apache.easyant:import");
getOwningTarget().addTask(importTask);
initTask(importTask).execute();
}
}
// Apply ExtensionPointMapping
for (ExtensionPointMappingDescriptor epMapping : md.getExtensionPointsMappings()) {
BindTarget bindTarget = new BindTarget();
bindTarget.setTarget(epMapping.getTarget());
bindTarget.setExtensionOf(epMapping.getExtensionPoint());
bindTarget.setBuildConfigurations(epMapping.getBuildConfigurations());
initTask(bindTarget).execute();