qualifier = qualifier.substring(comma);
while (qualifier.length() > 0 && qualifier.charAt(0) == ' ') {
base.append(' ');
qualifier = qualifier.substring(1);
}
ResolveData data = new ResolveData(ivy.getResolveEngine(), new ResolveOptions());
ModuleRevisionId mrid = ModuleRevisionId.newInstance(org, name, branch, rev,
otherAtts);
DefaultDependencyDescriptor ddd = new DefaultDependencyDescriptor(mrid, false);
try {
DependencyResolver resolver = ivy.getSettings().getResolver(mrid);
if (resolver == null) {
return null;
}
ResolvedModuleRevision dep = resolver.getDependency(ddd, data);
if (dep == null) {
return null;
}
String[] confs = dep.getDescriptor().getConfigurationsNames();
for (int i = 0; i < confs.length; i++) {
confs[i] = base + confs[i];
}
List ret = new ArrayList(Arrays.asList(confs));
ret.add("*");
return (String[]) ret.toArray(new String[ret.size()]);
} catch (ParseException e) {
getSettings().logError("The dependencies of " + mrid + " could not be parsed",
e);
return null;
}
}
});
IvyTag conf3 = new IvyTag("conf", "defines configuration mapping has sub element");
conf3.addAttribute(new IvyTagAttribute(
"name",
"the name of the master configuration to map. \n"
+ "'*' wildcard can be used to designate all configurations of this module",
true, masterConfValueProvider));
conf3.addAttribute(new IvyTagAttribute("mapped",
"a comma separated list of dependency configurations \n"
+ "to which this master configuration should be mapped", false,
new IValueProvider() {
public String[] getValuesfor(IvyTagAttribute att, IvyFile ivyFile) {
Ivy ivy = getIvy();
int[] indexes = ivyFile.getParentTagIndex();
if (indexes != null && ivy != null) {
Map otherAttValues = ivyFile.getAllAttsValues(indexes[0] + 1);
String org = ((IvyModuleDescriptorFile) ivyFile)
.getDependencyOrganisation(otherAttValues);
if (org != null && otherAttValues != null
&& otherAttValues.get("name") != null
&& otherAttValues.get("rev") != null) {
StringBuffer base = new StringBuffer();
String qualifier = ivyFile.getAttributeValueQualifier();
// search for word after last comma
int comma = qualifier.lastIndexOf(",") + 1;
base.append(qualifier.substring(0, comma));
qualifier = qualifier.substring(comma);
while (qualifier.length() > 0 && qualifier.charAt(0) == ' ') {
base.append(' ');
qualifier = qualifier.substring(1);
}
ResolveData data = new ResolveData(ivy.getResolveEngine(),
new ResolveOptions());
ModuleRevisionId mrid = ModuleRevisionId.newInstance(org,
(String) otherAttValues.get("name"), (String) otherAttValues
.get("rev"));
DefaultDependencyDescriptor ddd = new DefaultDependencyDescriptor(
mrid, false);
try {
String[] confs = ivy.getSettings().getResolver(mrid)
.getDependency(ddd, data).getDescriptor()
.getConfigurationsNames();
for (int i = 0; i < confs.length; i++) {
confs[i] = base + confs[i];
}
List ret = new ArrayList(Arrays.asList(confs));
ret.add("*");
return (String[]) ret.toArray(new String[ret.size()]);
} catch (ParseException e) {
getSettings().logError(
"The dependencies of " + mrid + " could not be parsed", e);
return new String[] {"*"};
}
}
}
return new String[] {"*"};
}
}));
allConf.add(conf3);
IvyTag mapped = new IvyTag("mapped",
"map dependency configurations for this master configuration");
mapped.addAttribute(new IvyTagAttribute("name",
"the name of the dependency configuration mapped. \n"
+ "'*' wildcard can be used to designate all configurations of this module",
true, new IValueProvider() {
public String[] getValuesfor(IvyTagAttribute att, IvyFile ivyFile) {
Ivy ivy = getIvy();
int[] indexes = ivyFile.getParentTagIndex();
if (indexes == null || ivy == null) {
return new String[] {"*"};
}
indexes = ivyFile.getParentTagIndex(indexes[0]);
if (indexes == null) {
return new String[] {"*"};
}
Map otherAttValues = ivyFile.getAllAttsValues(indexes[0] + 1);
String org = ((IvyModuleDescriptorFile) ivyFile)
.getDependencyOrganisation(otherAttValues);
if (org == null || otherAttValues == null || otherAttValues.get("name") == null
|| otherAttValues.get("rev") == null) {
return new String[] {"*"};
}
ResolveData data = new ResolveData(ivy.getResolveEngine(),
new ResolveOptions());
ModuleRevisionId mrid = ModuleRevisionId.newInstance(org,
(String) otherAttValues.get("name"), (String) otherAttValues.get("rev"));
DefaultDependencyDescriptor ddd = new DefaultDependencyDescriptor(mrid, false);
try {
String[] confs = ivy.getSettings().getResolver(mrid)