handlePropertyAsAttribute(attributes, Arrays.asList(PLUGIN_REGULAR_ATTRIBUTES), buildtype,
buildtype.getBuildConfigurations());
}
private PluginDescriptor handleCommonPluginDescriptorAttributes(Attributes attributes, PluginType pluginType) {
PluginDescriptor pluginDescriptor = new PluginDescriptor();
String mrid = getSettings().substitute(attributes.getValue("mrid"));
if (mrid != null) {
if (!mrid.matches(".*#.*")) {
if (pluginType == PluginType.BUILDTYPE) {
Message.debug("No organisation specified for buildtype " + mrid + " using the default one");
mrid = EasyAntConstants.EASYANT_BUILDTYPES_ORGANISATION + "#" + mrid;
} else {
Message.debug("No organisation specified for plugin " + mrid + " using the default one");
mrid = EasyAntConstants.EASYANT_PLUGIN_ORGANISATION + "#" + mrid;
}
}
pluginDescriptor.setMrid(mrid);
} else {
String org = attributes.getValue("org") != null ? attributes.getValue("org") : attributes
.getValue("organisation");
org = getSettings().substitute(org);
if (org == null) {
if (pluginType == PluginType.BUILDTYPE) {
Message.debug("No organisation specified for buildtype " + mrid + " using the default one");
org = EasyAntConstants.EASYANT_BUILDTYPES_ORGANISATION;
} else {
Message.debug("No organisation specified for plugin " + mrid + " using the default one");
org = EasyAntConstants.EASYANT_PLUGIN_ORGANISATION;
}
}
String module = getSettings().substitute(attributes.getValue("module"));
String revision = attributes.getValue("rev") != null ? attributes.getValue("rev") : attributes
.getValue("revision");
revision = getSettings().substitute(revision);
pluginDescriptor.setOrganisation(org);
pluginDescriptor.setModule(module);
pluginDescriptor.setRevision(revision);
}
String conf = getSettings().substitute(attributes.getValue("conf"));
pluginDescriptor.setBuildConfigurations(conf);
pluginDescriptor.setMode(getSettings().substitute(attributes.getValue("mode")));
pluginDescriptor.setAs(getSettings().substitute(attributes.getValue("as")));
return pluginDescriptor;
}