Search in sources :

Example 1 with ExactVersionMatcher

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

the class SortTest method setUp.

@Before
public void setUp() {
    // The revision is often not set in the
    md1 = createModuleDescriptorToSort("md1", null);
    // ivy.xml file that are ordered
    // But sometimes they are set
    md2 = createModuleDescriptorToSort("md2", "rev2");
    md3 = createModuleDescriptorToSort("md3", "rev3");
    md4 = createModuleDescriptorToSort("md4", "rev4");
    settings = new SimpleSortEngineSettings();
    settings.setCircularDependencyStrategy(WarnCircularDependencyStrategy.getInstance());
    settings.setVersionMatcher(new ExactVersionMatcher());
    sortEngine = new SortEngine(settings);
    nonMatchReporter = new SilentNonMatchingVersionReporter();
}
Also used : ExactVersionMatcher(org.apache.ivy.plugins.version.ExactVersionMatcher) Before(org.junit.Before)

Example 2 with ExactVersionMatcher

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

the class IvySettings method addVersionMatcher.

public synchronized void addVersionMatcher(VersionMatcher vmatcher) {
    init(vmatcher);
    versionMatchers.put(vmatcher.getName(), vmatcher);
    if (versionMatcher == null) {
        versionMatcher = new ChainVersionMatcher();
        addVersionMatcher(new ExactVersionMatcher());
    }
    if (versionMatcher instanceof ChainVersionMatcher) {
        ChainVersionMatcher chain = (ChainVersionMatcher) versionMatcher;
        chain.add(vmatcher);
    }
}
Also used : ExactVersionMatcher(org.apache.ivy.plugins.version.ExactVersionMatcher) ChainVersionMatcher(org.apache.ivy.plugins.version.ChainVersionMatcher)

Aggregations

ExactVersionMatcher (org.apache.ivy.plugins.version.ExactVersionMatcher)2 ChainVersionMatcher (org.apache.ivy.plugins.version.ChainVersionMatcher)1 Before (org.junit.Before)1