Package org.apache.ivy.core.resolve

Examples of org.apache.ivy.core.resolve.IvyNode


     */
    public List getModuleIds() {
        List ret = new ArrayList();
        List sortedDependencies = new ArrayList(dependencies);
        for (Iterator iter = sortedDependencies.iterator(); iter.hasNext();) {
            IvyNode dependency = (IvyNode) iter.next();
            ModuleId mid = dependency.getResolvedId().getModuleId();
            if (!ret.contains(mid)) {
                ret.add(mid);
            }
        }
        return ret;
View Full Code Here


     * @return all non evicted and non error dependency mrids
     */
    public Set getModuleRevisionIds() {
        Set mrids = new LinkedHashSet();
        for (Iterator iter = getDependencies().iterator(); iter.hasNext();) {
            IvyNode node = (IvyNode) iter.next();
            if (!node.isEvicted(getConfiguration()) && !node.hasProblem()) {
                mrids.add(node.getResolvedId());
            }
        }
        return mrids;
    }
View Full Code Here

    }

    public IvyNode[] getUnresolvedDependencies() {
        List unresolved = new ArrayList();
        for (Iterator iter = getDependencies().iterator(); iter.hasNext();) {
            IvyNode node = (IvyNode) iter.next();
            if (node.hasProblem()) {
                unresolved.add(node);
            }
        }
        return (IvyNode[]) unresolved.toArray(new IvyNode[unresolved.size()]);
    }
View Full Code Here

    }

    public IvyNode[] getEvictedNodes() {
        List evicted = new ArrayList();
        for (Iterator iter = getDependencies().iterator(); iter.hasNext();) {
            IvyNode node = (IvyNode) iter.next();
            if (node.isEvicted(conf)) {
                evicted.add(node);
            }
        }
        return (IvyNode[]) evicted.toArray(new IvyNode[evicted.size()]);
    }
View Full Code Here

    }

    public IvyNode[] getDownloadedNodes() {
        List downloaded = new ArrayList();
        for (Iterator iter = getDependencies().iterator(); iter.hasNext();) {
            IvyNode node = (IvyNode) iter.next();
            if (node.isDownloaded() && node.getRealNode() == node) {
                downloaded.add(node);
            }
        }
        return (IvyNode[]) downloaded.toArray(new IvyNode[downloaded.size()]);
    }
View Full Code Here

    }

    public IvyNode[] getSearchedNodes() {
        List downloaded = new ArrayList();
        for (Iterator iter = getDependencies().iterator(); iter.hasNext();) {
            IvyNode node = (IvyNode) iter.next();
            if (node.isSearched() && node.getRealNode() == node) {
                downloaded.add(node);
            }
        }
        return (IvyNode[]) downloaded.toArray(new IvyNode[downloaded.size()]);
    }
View Full Code Here

    public List getModuleIds() {
        if (modulesIds == null) {
            List sortedDependencies = resolveEngine.getSortEngine().sortNodes(getDependencies());
            Collections.reverse(sortedDependencies);
            for (Iterator iter = sortedDependencies.iterator(); iter.hasNext();) {
                IvyNode dependency = (IvyNode) iter.next();
                ModuleId mid = dependency.getResolvedId().getModuleId();
                Collection deps = (Collection) modulesIdsMap.get(mid);
                if (deps == null) {
                    deps = new HashSet();
                    modulesIdsMap.put(mid, deps);
                }
View Full Code Here

                Message.verbose("\t" + getName() + ": found ivy file in cache for " + mrid);
                Message.verbose("\t\t=> " + ivyRef);

                ModuleRevisionId resolvedMrid = ModuleRevisionId.newInstance(mrid, ivyRef
                        .getRevision());
                IvyNode node = data.getNode(resolvedMrid);
                if (node != null && node.getModuleRevision() != null) {
                    // this revision has already be resolved : return it
                    Message.verbose("\t" + getName() + ": revision already resolved: "
                            + resolvedMrid);
                    return searchedRmr(node.getModuleRevision());
                }
                ResolvedModuleRevision rmr = data.getCacheManager().findModuleInCache(resolvedMrid,
                    doValidate(data));
                if (rmr != null) {
                    Message.verbose("\t" + getName() + ": revision in cache: " + resolvedMrid);
View Full Code Here

            ModuleId mid = (ModuleId) iter.next();
            out.println("\t\t<module organisation=\"" + mid.getOrganisation() + "\"" + " name=\""
                    + mid.getName() + "\"" + " resolver=\""
                    + report.getResolveEngine().getSettings().getResolverName(mid) + "\">");
            for (Iterator it2 = report.getNodes(mid).iterator(); it2.hasNext();) {
                IvyNode dep = (IvyNode) it2.next();
                ModuleDescriptor md = null;
                if (dep.getModuleRevision() != null) {
                    md = dep.getModuleRevision().getDescriptor();
                }
                StringBuffer details = new StringBuffer();
                if (dep.isLoaded()) {
                    details.append(" status=\"").append(dep.getDescriptor().getStatus()).append(
                        "\"").append(" pubdate=\"").append(
                        Ivy.DATE_FORMAT.format(new Date(dep.getPublication()))).append("\"")
                            .append(" resolver=\"").append(
                                dep.getModuleRevision().getResolver().getName()).append("\"")
                            .append(" artresolver=\"").append(
                                dep.getModuleRevision().getArtifactResolver().getName()).append(
                                "\"");
                }
                if (dep.isEvicted(report.getConfiguration())) {
                    EvictionData ed = dep.getEvictedData(report.getConfiguration());
                    if (ed.getConflictManager() != null) {
                        details.append(" evicted=\"").append(ed.getConflictManager()).append("\"");
                    } else {
                        details.append(" evicted=\"transitive\"");
                    }
                }
                if (dep.hasProblem()) {
                    details.append(" error=\"").append(dep.getProblem().getMessage()).append("\"");
                }
                if (md != null && md.getHomePage() != null) {
                    details.append(" homepage=\"").append(md.getHomePage()).append("\"");
                }
                extraAttributes = md != null ? md.getExtraAttributes() : dep.getResolvedId()
                        .getExtraAttributes();
                for (Iterator iterator = extraAttributes.keySet().iterator(); iterator.hasNext();) {
                    String attName = (String) iterator.next();
                    details.append(" extra-").append(attName).append("=\"").append(
                        extraAttributes.get(attName)).append("\"");
                }
                String defaultValue = dep.getDescriptor() != null ? " default=\""
                        + dep.getDescriptor().isDefault() + "\"" : "";
                int position = dependencies.indexOf(dep.getResolvedId());
                out.println("\t\t\t<revision name=\""
                        + dep.getResolvedId().getRevision()
                        + "\""
                        + (dep.getResolvedId().getBranch() == null ? "" : " branch=\""
                                + dep.getResolvedId().getBranch() + "\"") + details
                        + " downloaded=\"" + dep.isDownloaded() + "\"" + " searched=\""
                        + dep.isSearched() + "\"" + defaultValue + " conf=\""
                        + toString(dep.getConfigurations(report.getConfiguration())) + "\""
                        + " position=\"" + position + "\">");
                if (md != null) {
                    License[] licenses = md.getLicenses();
                    for (int i = 0; i < licenses.length; i++) {
                        String lurl;
                        if (licenses[i].getUrl() != null) {
                            lurl = " url=\"" + licenses[i].getUrl() + "\"";
                        } else {
                            lurl = "";
                        }
                        out.println("\t\t\t\t<license name=\"" + licenses[i].getName() + "\""
                                + lurl + "/>");
                    }
                }
                if (dep.isEvicted(report.getConfiguration())) {
                    EvictionData ed = dep.getEvictedData(report.getConfiguration());
                    Collection selected = ed.getSelected();
                    if (selected != null) {
                        for (Iterator it3 = selected.iterator(); it3.hasNext();) {
                            IvyNode sel = (IvyNode) it3.next();
                            out.println("\t\t\t\t<evicted-by rev=\""
                                    + sel.getResolvedId().getRevision() + "\"/>");
                        }
                    }
                }
                Caller[] callers = dep.getCallers(report.getConfiguration());
                for (int i = 0; i < callers.length; i++) {
View Full Code Here

        ModuleRevisionId resolvedMrid = mrid;

        // first check if this dependency has not yet been resolved
        if (getSettings().getVersionMatcher().isDynamic(mrid)) {
            resolvedMrid = ModuleRevisionId.newInstance(mrid, ivyRef.getRevision());
            IvyNode node = getSystemNode(data, resolvedMrid);
            if (node != null && node.getModuleRevision() != null) {
                // this revision has already be resolved : return it
                if (node.getDescriptor() != null && node.getDescriptor().isDefault()) {
                    Message.verbose("\t" + getName() + ": found already resolved revision: "
                            + resolvedMrid
                            + ": but it's a default one, maybe we can find a better one");
                } else {
                    Message.verbose("\t" + getName() + ": revision already resolved: "
                            + resolvedMrid);
                    return searchedRmr(node.getModuleRevision());
                }
            }
        }

        // now let's see if we can find it in cache and if it is up to date
View Full Code Here

TOP

Related Classes of org.apache.ivy.core.resolve.IvyNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.