Package org.apache.ivy.core.resolve

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


                }
            }

            // check dependencies
            DependencyDescriptor[] dds = md.getDependencies();
            ResolveData data = new ResolveData(resolveEngine, new ResolveOptions());
            for (int i = 0; i < dds.length; i++) {
                // check master confs
                String[] masterConfs = dds[i].getModuleConfigurations();
                for (int j = 0; j < masterConfs.length; j++) {
                    if (!"*".equals(masterConfs[j].trim())
 
View Full Code Here


            }

            if (line.hasOption("useOrigin")) {
                ivy.getSettings().useDeprecatedUseOrigin();
            }
            ResolveOptions resolveOptions = new ResolveOptions().setConfs(confs)
                .setValidate(validate);
            ResolveReport report = ivy.resolve(ivyfile.toURL(), resolveOptions);
            if (report.hasError()) {
                System.exit(1);
            }
View Full Code Here

                md = (ModuleDescriptor) getResolvedDescriptor(getOrganisation(), getModule()
                        , false);
            }
            IvyNode[] dependencies = getIvyInstance().getResolveEngine().getDependencies(
                md,
                new ResolveOptions().setConfs(confs).setResolveId(
                    getResolveId()).setValidate(doValidate(getSettings())), null);

            Map artifactsToCopy = getIvyInstance().getRetrieveEngine().determineArtifactsToCopy(
                ModuleRevisionId.newInstance(getOrganisation(), getModule(), getRevision()),
                pattern,
View Full Code Here

    private ResolveOptions getResolveOptions(Ivy ivy, String[] confs, IvySettings settings) {
        if (useOrigin) {
            settings.useDeprecatedUseOrigin();
        }
        return ((ResolveOptions) new ResolveOptions()
                .setLog(log))
                .setConfs(confs)
                .setValidate(doValidate(settings))
                .setArtifactFilter(FilterHelper.getArtifactTypeFilter(type))
                .setRevision(revision)
View Full Code Here

            }
            DefaultModuleDescriptor md = DefaultModuleDescriptor.newCallerInstance(mrids, true,
                false);
            String resolveId = ResolveOptions.getDefaultResolveId(md);
            ResolveReport report = ivy.resolve(md,
                new ResolveOptions()
                    .setResolveId(resolveId)
                    .setValidate(doValidate(settings)));

            ResolutionCacheManager cacheMgr = getIvyInstance().getResolutionCacheManager();
            new XmlReportOutputter().output(report, cacheMgr, new ResolveOptions());
            if (graph) {
                gengraph(cacheMgr, md.getModuleRevisionId().getOrganisation(), md
                        .getModuleRevisionId().getName());
            }
            if (dot) {
View Full Code Here

                qualifier = qualifier.substring(comma);
                while (qualifier.length() > 0 && qualifier.charAt(0) == ' ') {
                    base.append(' ');
                    qualifier = qualifier.substring(1);
                }
                ResolveData data = new ResolveData(ivy.getResolveEngine(), new ResolveOptions());
                ModuleRevisionId mrid = ModuleRevisionId.newInstance(org, name, branch, rev,
                    otherAtts);
                DefaultDependencyDescriptor ddd = new DefaultDependencyDescriptor(mrid, false);
                try {
                    DependencyResolver resolver = ivy.getSettings().getResolver(mrid);
                    if (resolver == null) {
                        return null;
                    }
                    ResolvedModuleRevision dep = resolver.getDependency(ddd, data);
                    if (dep == null) {
                        return null;
                    }
                    String[] confs = dep.getDescriptor().getConfigurationsNames();
                    for (int i = 0; i < confs.length; i++) {
                        confs[i] = base + confs[i];
                    }
                    List ret = new ArrayList(Arrays.asList(confs));
                    ret.add("*");
                    return (String[]) ret.toArray(new String[ret.size()]);
                } catch (ParseException e) {
                    getSettings().logError("The dependencies of " + mrid + " could not be parsed",
                        e);
                    return null;
                }
            }

        });
        IvyTag conf3 = new IvyTag("conf", "defines configuration mapping has sub element");
        conf3
                .addAttribute(new IvyTagAttribute(
                        "name",
                        "the name of the master configuration to map. \n"
                                + "'*' wildcard can be used to designate all configurations of this module",
                        true, masterConfValueProvider));
        conf3.addAttribute(new IvyTagAttribute("mapped",
                "a comma separated list of dependency configurations \n"
                        + "to which this master configuration should be mapped", false,
                new IValueProvider() {
                    public String[] getValuesfor(IvyTagAttribute att, IvyFile ivyFile) {
                        Ivy ivy = getIvy();
                        int[] indexes = ivyFile.getParentTagIndex();
                        if (indexes != null && ivy != null) {
                            Map otherAttValues = ivyFile.getAllAttsValues(indexes[0] + 1);
                            String org = ((IvyModuleDescriptorFile) ivyFile)
                                    .getDependencyOrganisation(otherAttValues);
                            if (org != null && otherAttValues != null
                                    && otherAttValues.get("name") != null
                                    && otherAttValues.get("rev") != null) {
                                StringBuffer base = new StringBuffer();
                                String qualifier = ivyFile.getAttributeValueQualifier();
                                // search for word after last comma
                                int comma = qualifier.lastIndexOf(",") + 1;
                                base.append(qualifier.substring(0, comma));
                                qualifier = qualifier.substring(comma);
                                while (qualifier.length() > 0 && qualifier.charAt(0) == ' ') {
                                    base.append(' ');
                                    qualifier = qualifier.substring(1);
                                }
                                ResolveData data = new ResolveData(ivy.getResolveEngine(),
                                        new ResolveOptions());
                                ModuleRevisionId mrid = ModuleRevisionId.newInstance(org,
                                    (String) otherAttValues.get("name"), (String) otherAttValues
                                            .get("rev"));
                                DefaultDependencyDescriptor ddd = new DefaultDependencyDescriptor(
                                        mrid, false);
                                try {
                                    String[] confs = ivy.getSettings().getResolver(mrid)
                                            .getDependency(ddd, data).getDescriptor()
                                            .getConfigurationsNames();
                                    for (int i = 0; i < confs.length; i++) {
                                        confs[i] = base + confs[i];
                                    }
                                    List ret = new ArrayList(Arrays.asList(confs));
                                    ret.add("*");
                                    return (String[]) ret.toArray(new String[ret.size()]);
                                } catch (ParseException e) {
                                    getSettings().logError(
                                        "The dependencies of " + mrid + " could not be parsed", e);
                                    return new String[] {"*"};
                                }
                            }
                        }
                        return new String[] {"*"};
                    }

                }));
        allConf.add(conf3);
        IvyTag mapped = new IvyTag("mapped",
                "map dependency configurations for this master configuration");
        mapped
                .addAttribute(new IvyTagAttribute(
                        "name",
                        "the name of the dependency configuration mapped. \n"
                                + "'*' wildcard can be used to designate all configurations of this module",
                        true, new IValueProvider() {
                            public String[] getValuesfor(IvyTagAttribute att, IvyFile ivyFile) {
                                Ivy ivy = getIvy();
                                int[] indexes = ivyFile.getParentTagIndex();
                                if (indexes != null && ivy != null) {
                                    indexes = ivyFile.getParentTagIndex(indexes[0]);
                                    if (indexes != null) {
                                        Map otherAttValues = ivyFile
                                                .getAllAttsValues(indexes[0] + 1);
                                        String org = ((IvyModuleDescriptorFile) ivyFile)
                                                .getDependencyOrganisation(otherAttValues);
                                        if (org != null && otherAttValues != null
                                                && otherAttValues.get("name") != null
                                                && otherAttValues.get("rev") != null) {
                                            ResolveData data = new ResolveData(ivy
                                                    .getResolveEngine(), new ResolveOptions());
                                            ModuleRevisionId mrid = ModuleRevisionId.newInstance(
                                                org, (String) otherAttValues.get("name"),
                                                (String) otherAttValues.get("rev"));
                                            DefaultDependencyDescriptor ddd = new DefaultDependencyDescriptor(
                                                    mrid, false);
View Full Code Here

                                    // no resolve previously done for at least
                                    // one conf... we do it now
                                    Message.info("\n\nIVYDE: previous resolve of "
                                            + md.getModuleRevisionId().getModuleId()
                                            + " doesn't contain enough data: resolving again\n");
                                    ResolveOptions resolveOption = new ResolveOptions()
                                            .setConfs((String[]) conf.confs
                                                    .toArray(new String[conf.confs.size()]));
                                    resolveOption.setValidate(ivy.getSettings().doValidate());
                                    ResolveReport r = ivy.resolve(md, resolveOption);
                                    all.addAll(Arrays.asList(r.getArtifactsReports(null, false)));
                                    confs = r.getConfigurations();
                                    dependencies = listDependencies(r);
                                    problemMessages.addAll(r.getAllProblemMessages());
                                    maybeRetrieve(md, confs);

                                    break;
                                }
                            }
                        } else {
                            Message.info("\n\nIVYDE: calling resolve on " + conf.ivyXmlPath + "\n");
                            ResolveOptions resolveOption = new ResolveOptions()
                                    .setConfs((String[]) conf.confs.toArray(new String[conf.confs
                                            .size()]));
                            resolveOption.setValidate(ivy.getSettings().doValidate());
                            ResolveReport report = ivy.resolve(md, resolveOption);
                            problemMessages = report.getAllProblemMessages();
                            all = new LinkedHashSet(Arrays.asList(report.getArtifactsReports(null,
                                false)));
                            confs = report.getConfigurations();
View Full Code Here

                            "[ org1 | mod1.2 | 2.1.0 ]:2.1 (needed by [[ apache | resolve-noconflict | 1.0 ]])") != -1);
        }
    }

    private ResolveOptions getResolveOptions() {
        return new ResolveOptions().setCache(CacheManager.getInstance(ivy.getSettings()))
                .setValidate(false);
    }
View Full Code Here

        assertTrue("XML doesn't contain extra attribute 1", xml.indexOf(extra1Attribute) != -1);
        assertTrue("XML doesn't contain extra attribute 2", xml.indexOf(extra2Attribute) != -1);
    }

    private ResolveOptions getResolveOptions(String[] confs) {
        return new ResolveOptions().setConfs(confs).setCache(
            CacheManager.getInstance(_ivy.getSettings(), _cache));
    }
View Full Code Here

            }
        }
    }

    private ResolveOptions getResolveOptions() {
        return new ResolveOptions().setCache(CacheManager.getInstance(ivy.getSettings()))
                .setValidate(false);
    }
View Full Code Here

TOP

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

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.