Java Code Examples for org.apache.ivy.core.report.ResolveReport#getConfigurations()

The following examples show how to use org.apache.ivy.core.report.ResolveReport#getConfigurations() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LatestConflictManagerTest.java    From ant-ivy with Apache License 2.0 6 votes vote down vote up
/**
 * Test case for IVY-388.
 *
 * @throws Exception if something goes wrong
 * @see <a href="https://issues.apache.org/jira/browse/IVY-388">IVY-388</a>
 */
@Test
public void testIvy388() throws Exception {
    ResolveReport report = ivy.resolve(
        LatestConflictManagerTest.class.getResource("ivy-388.xml"), getResolveOptions());

    List<IvyNode> deps = report.getDependencies();
    Iterator<IvyNode> dependencies = deps.iterator();
    String[] confs = report.getConfigurations();
    while (dependencies.hasNext()) {
        IvyNode node = dependencies.next();
        for (String conf : confs) {
            if (!node.isEvicted(conf)) {
                boolean flag1 = report.getConfigurationReport(conf).getDependency(
                    node.getResolvedId()) != null;
                boolean flag2 = report.getConfigurationReport(conf).getModuleRevisionIds()
                        .contains(node.getResolvedId());
                assertEquals("Inconsistent data for node " + node + " in conf " + conf, flag1,
                    flag2);
            }
        }
    }
}
 
Example 2
Source File: IvyTask.java    From ant-ivy with Apache License 2.0 5 votes vote down vote up
protected void setResolved(ResolveReport report, boolean keep) {
    ModuleDescriptor md = report.getModuleDescriptor();
    String[] confs = report.getConfigurations();
    if (keep) {
        getProject().addReference("ivy.resolved.report", report);
        getProject().addReference("ivy.resolved.configurations.ref", confs);
        getProject().addReference("ivy.resolved.descriptor", md);
    }
    String suffix = md.getModuleRevisionId().getModuleId().getOrganisation() + "."
            + md.getModuleRevisionId().getModuleId().getName();
    getProject().addReference("ivy.resolved.report." + suffix, report);
    getProject().addReference("ivy.resolved.descriptor." + suffix, md);
    getProject().addReference("ivy.resolved.configurations.ref." + suffix, confs);
}
 
Example 3
Source File: IvyTask.java    From ant-ivy with Apache License 2.0 5 votes vote down vote up
protected void setResolved(ResolveReport report, String resolveId, boolean keep) {
    setResolved(report, keep);
    if (resolveId == null) {
        return;
    }
    ModuleDescriptor md = report.getModuleDescriptor();
    String[] confs = report.getConfigurations();
    getProject().addReference("ivy.resolved.report." + resolveId, report);
    getProject().addReference("ivy.resolved.descriptor." + resolveId, md);
    getProject().addReference("ivy.resolved.configurations.ref." + resolveId, confs);
}
 
Example 4
Source File: XmlReportOutputter.java    From ant-ivy with Apache License 2.0 5 votes vote down vote up
public void output(ResolveReport report, ResolutionCacheManager cacheMgr, ResolveOptions options)
        throws IOException {
    String[] confs = report.getConfigurations();
    for (String conf : confs) {
        output(report.getConfigurationReport(conf), report.getResolveId(), confs, cacheMgr);
    }
}