public Configuration getConfiguration(String conf) { if (md == null) { throw new IllegalStateException( "impossible to get configuration when data has not been loaded"); } String defaultConf = getDefaultConf(conf); conf = getMainConf(conf); Configuration configuration = md.getConfiguration(conf); if (configuration == null) { configuration = md.getConfiguration(defaultConf); } return configuration; }
public void replaceWildcards(ModuleDescriptor md) { if (this != md.getConfiguration(name)) { throw new IllegalArgumentException( "The given ModuleDescriptor doesn't own this configuration!"); } Configuration[] configs = md.getConfigurations(); Set newExtends = new LinkedHashSet(); for (int j = 0; j < extendsFrom.length; j++) { if ("*".equals(extendsFrom[j])) { addOther(configs, null, newExtends); } else if ("*(public)".equals(extendsFrom[j])) { addOther(configs, Visibility.PUBLIC, newExtends); } else if ("*(private)".equals(extendsFrom[j])) { addOther(configs, Visibility.PRIVATE, newExtends); } else { newExtends.add(extendsFrom[j]); } } this.extendsFrom = (String[]) newExtends.toArray(new String[newExtends.size()]); }
for (int j = 0; j < masterConfs.length; j++) { if (!"*".equals(masterConfs[j].trim()) && md.getConfiguration(masterConfs[j]) == null) { Message.info("dependency required in non existing conf for " + ivyFile + " \n\tin " + dds[i] + ": " + masterConfs[j]);
private boolean gatherExtendingConfs(Set<String> extendingConfs, String conf, String extended) { if (extendingConfs.contains(conf)) { return true; } String[] ext = md.getConfiguration(conf).getExtends(); if (ext == null || ext.length == 0) { return false; } for (int i = 0; i < ext.length; i++) { if (extendingConfs.contains(ext[i])) { extendingConfs.add(conf); return true; } if (ext[i].equals(extended)) { extendingConfs.add(conf); return true; } if (gatherExtendingConfs(extendingConfs, ext[i], extended)) { extendingConfs.add(conf); return true; } } return false; }
Configuration config; if (masterConf.startsWith("!")) { config = md.getConfiguration(masterConf.substring(1)); } else { config = md.getConfiguration(masterConf);
public String[] getRealConfs(String conf) { if (md == null) { return new String[] {conf}; } String defaultConf = getDefaultConf(conf); conf = getMainConf(conf); if ((md.getConfiguration(conf) == null) || Configuration.Visibility.PRIVATE.equals(md.getConfiguration(conf) .getVisibility())) { if ("".equals(defaultConf)) { return new String[0]; } conf = defaultConf; } if (conf.startsWith("*")) { return resolveSpecialConfigurations(new String[] {conf}); } else if (conf.indexOf(',') != -1) { String[] confs = conf.split(","); for (int i = 0; i < confs.length; i++) { confs[i] = confs[i].trim(); } } return new String[] {conf}; }
private void addRootModuleConfigurations(IvyNodeUsage usage, String rootModuleConf, String[] dependencyConfs) { Set depConfs = usage.addAndGetConfigurations(rootModuleConf); if (md != null) { // add all given dependency configurations to the set + extended ones for (int i = 0; i < dependencyConfs.length; i++) { depConfs.add(dependencyConfs[i]); Configuration conf = md.getConfiguration(dependencyConfs[i]); if (conf != null) { String[] exts = conf.getExtends(); // recursive add of extended addRootModuleConfigurations(usage, rootModuleConf, exts); } } } else { for (int i = 0; i < dependencyConfs.length; i++) { depConfs.add(dependencyConfs[i]); } } }
public void addConfiguration(String callerConf, String[] dependencyConfs) { updateConfs(callerConf, dependencyConfs); Configuration conf = md.getConfiguration(callerConf); if (conf != null) { String[] confExtends = conf.getExtends(); if (confExtends != null) { for (int i = 0; i < confExtends.length; i++) { addConfiguration(confExtends[i], dependencyConfs); } } } }
String requestedConfiguration) { if (md != null) { Configuration c = md.getConfiguration(moduleConfiguration); if (c instanceof ConfigurationIntersection) { ConfigurationIntersection intersection = (ConfigurationIntersection) c;
addRootModuleConfigurations(usage, rootModuleConf, confs); for (int i = 0; i < confs.length; i++) { Configuration c = md.getConfiguration(confs[i]); if (c == null) { confsToFetch.remove(conf);
public void discardConf(String rootModuleConf, String conf) { Set depConfs = usage.addAndGetConfigurations(rootModuleConf); if (md != null) { // remove all given dependency configurations to the set + extended ones Configuration c = md.getConfiguration(conf); if (conf != null) { String[] exts = c.getExtends(); for (int i = 0; i < exts.length; i++) { discardConf(rootModuleConf, exts[i]); // recursive remove of extended // configurations } depConfs.remove(c.getName()); } else { Message.warn("unknown configuration in " + getId() + ": " + conf); } } else { depConfs.remove(conf); } }
if (md.getConfiguration(confs[i]) == null) { missingConfs.add(" '" + confs[i] + "' ");