mirror of https://github.com/apache/ant-ivy
Add a new method on DefaultRepositoryCacheManager and DefaultResolutionCacheManager to easily changeon subclass the ModuleDescriptorParser used
git-svn-id: https://svn.apache.org/repos/asf/ant/ivy/core/trunk@1558715 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
9029cca391
commit
91ac1574aa
|
|
@ -722,7 +722,7 @@ public class DefaultRepositoryCacheManager implements RepositoryCacheManager, Iv
|
|||
if (ivyFile.exists()) {
|
||||
// found in cache !
|
||||
try {
|
||||
XmlModuleDescriptorParser parser = XmlModuleDescriptorParser.getInstance();
|
||||
ModuleDescriptorParser parser = getModuleDescriptorParser();
|
||||
ModuleDescriptor depMD = getMdFromCache(parser, options, ivyFile);
|
||||
String resolverName = getSavedResolverName(depMD);
|
||||
String artResolverName = getSavedArtResolverName(depMD);
|
||||
|
|
@ -790,6 +790,10 @@ public class DefaultRepositoryCacheManager implements RepositoryCacheManager, Iv
|
|||
return null;
|
||||
}
|
||||
|
||||
protected ModuleDescriptorParser getModuleDescriptorParser() {
|
||||
return XmlModuleDescriptorParser.getInstance();
|
||||
}
|
||||
|
||||
private class MyModuleDescriptorProvider implements ModuleDescriptorProvider {
|
||||
|
||||
private final ModuleDescriptorParser mdParser;
|
||||
|
|
@ -807,7 +811,7 @@ public class DefaultRepositoryCacheManager implements RepositoryCacheManager, Iv
|
|||
}
|
||||
}
|
||||
|
||||
private ModuleDescriptor getMdFromCache(XmlModuleDescriptorParser mdParser,
|
||||
private ModuleDescriptor getMdFromCache(ModuleDescriptorParser mdParser,
|
||||
CacheMetadataOptions options, File ivyFile) throws ParseException, IOException {
|
||||
ModuleDescriptorMemoryCache cache = getMemoryCache();
|
||||
ModuleDescriptorProvider mdProvider = new MyModuleDescriptorProvider(mdParser, settings);
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ import org.apache.ivy.plugins.IvySettingsAware;
|
|||
import org.apache.ivy.plugins.conflict.ConflictManager;
|
||||
import org.apache.ivy.plugins.matcher.PatternMatcher;
|
||||
import org.apache.ivy.plugins.namespace.Namespace;
|
||||
import org.apache.ivy.plugins.parser.ModuleDescriptorParser;
|
||||
import org.apache.ivy.plugins.parser.ParserSettings;
|
||||
import org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorParser;
|
||||
import org.apache.ivy.plugins.resolver.DependencyResolver;
|
||||
|
|
@ -154,8 +155,11 @@ public class DefaultResolutionCacheManager implements ResolutionCacheManager, Iv
|
|||
ParserSettings pSettings = new CacheParserSettings(settings, paths);
|
||||
|
||||
URL ivyFileURL = ivyFile.toURI().toURL();
|
||||
return XmlModuleDescriptorParser.getInstance()
|
||||
.parseDescriptor(pSettings, ivyFileURL, false);
|
||||
return getModuleDescriptorParser().parseDescriptor(pSettings, ivyFileURL, false);
|
||||
}
|
||||
|
||||
protected ModuleDescriptorParser getModuleDescriptorParser() {
|
||||
return XmlModuleDescriptorParser.getInstance();
|
||||
}
|
||||
|
||||
public void saveResolvedModuleDescriptor(ModuleDescriptor md) throws ParseException,
|
||||
|
|
|
|||
Loading…
Reference in New Issue