Search in sources :

Example 1 with LatestVersionMatcher

use of org.apache.ivy.plugins.version.LatestVersionMatcher in project ant-ivy by apache.

the class IvySettings method configureDefaultVersionMatcher.

public synchronized void configureDefaultVersionMatcher() {
    addVersionMatcher(new LatestVersionMatcher());
    addVersionMatcher(new SubVersionMatcher());
    addVersionMatcher(new VersionRangeMatcher());
}
Also used : SubVersionMatcher(org.apache.ivy.plugins.version.SubVersionMatcher) LatestVersionMatcher(org.apache.ivy.plugins.version.LatestVersionMatcher) VersionRangeMatcher(org.apache.ivy.plugins.version.VersionRangeMatcher)

Example 2 with LatestVersionMatcher

use of org.apache.ivy.plugins.version.LatestVersionMatcher in project ant-ivy by apache.

the class SortTest method testLatestIntegration.

/**
 * The dependency can ask for the latest integration. It should match whatever the version
 * declared in the modules to order.
 */
@Test
public void testLatestIntegration() {
    addDependency(md2, "md1", "latest.integration");
    addDependency(md3, "md2", "latest.integration");
    addDependency(md4, "md3", "latest.integration");
    settings.setVersionMatcher(new LatestVersionMatcher());
    DefaultModuleDescriptor[][] expectedOrder = new DefaultModuleDescriptor[][] { { md1, md2, md3, md4 } };
    for (List<ModuleDescriptor> toSort : getAllLists(md1, md3, md2, md4)) {
        assertSorted(expectedOrder, sortModuleDescriptors(toSort, nonMatchReporter));
    }
}
Also used : DefaultModuleDescriptor(org.apache.ivy.core.module.descriptor.DefaultModuleDescriptor) ModuleDescriptor(org.apache.ivy.core.module.descriptor.ModuleDescriptor) LatestVersionMatcher(org.apache.ivy.plugins.version.LatestVersionMatcher) DefaultModuleDescriptor(org.apache.ivy.core.module.descriptor.DefaultModuleDescriptor) Test(org.junit.Test)

Aggregations

LatestVersionMatcher (org.apache.ivy.plugins.version.LatestVersionMatcher)2 DefaultModuleDescriptor (org.apache.ivy.core.module.descriptor.DefaultModuleDescriptor)1 ModuleDescriptor (org.apache.ivy.core.module.descriptor.ModuleDescriptor)1 SubVersionMatcher (org.apache.ivy.plugins.version.SubVersionMatcher)1 VersionRangeMatcher (org.apache.ivy.plugins.version.VersionRangeMatcher)1 Test (org.junit.Test)1