Examples of ResolveOptions


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

    protected void setUp() throws Exception {
        settings = new IvySettings();
        engine = new ResolveEngine(settings, new EventManager(), new SortEngine(settings));
        cache = new File("build/cache");
        data = new ResolveData(engine, new ResolveOptions());
        cache.mkdirs();
        settings.setDefaultCache(cache);
    }
View Full Code Here

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

    private ResolveOptions getResolveOptions(String[] confs) {
        return getResolveOptions(ivy.getSettings(), confs);
    }

    private ResolveOptions getResolveOptions(IvySettings settings, String[] confs) {
        return new ResolveOptions().setConfs(confs);
    }
View Full Code Here

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

    protected void setUp() throws Exception {
        settings = new IvySettings();
        engine = new ResolveEngine(settings, new EventManager(), new SortEngine(settings));
        cache = new File("build/cache");
        data = new ResolveData(engine, new ResolveOptions());
        cache.mkdirs();
        settings.setDefaultCache(cache);
        cacheManager = (DefaultRepositoryCacheManager) settings.getDefaultRepositoryCacheManager();
    }
View Full Code Here

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

                    + parentMrid.toString());
            DependencyDescriptor dd = new DefaultDependencyDescriptor(parentMrid, true);
            ResolveData data = IvyContext.getContext().getResolveData();
            if (data == null) {
                ResolveEngine engine = IvyContext.getContext().getIvy().getResolveEngine();
                ResolveOptions options = new ResolveOptions();
                options.setDownload(false);
                data = new ResolveData(engine, options);
            }
            DependencyResolver resolver = getSettings().getResolver(parentMrid);
            dd = NameSpaceHelper.toSystem(dd, getSettings().getContextNamespace());
            ResolvedModuleRevision otherModule = resolver.getDependency(dd, data);
View Full Code Here

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

    }

    private ResolveResult doResolve(Ivy ivy, ModuleDescriptor md) throws ParseException,
            IOException {
        IvyDEMessage.debug("Doing a full resolve...");
        ResolveOptions resolveOption = new ResolveOptions();
        resolveOption.setConfs(confs);
        resolveOption.setValidate(ivy.getSettings().doValidate());
        resolveOption.setUseCacheOnly(useCacheOnly);
        resolveOption.setResolveId(IvyClasspathUtil.buildResolveId(useExtendedResolveId, md));
        resolveOption.setTransitive(transitiveResolve);
        ResolveReport report = ivy.getResolveEngine().resolve(md, resolveOption);

        if (report.hasError()) {
            IvyDEMessage.verbose("Resolve ended with errors");
        } else {
View Full Code Here

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

                + dependencyMrdis.length + " dependencie(s)");
        for (int iDep = 0; iDep < dependencyMrdis.length; iDep++) {
            DependencyResolver depResolver = ivy.getSettings().getResolver(dependencyMrdis[iDep]);
            DefaultDependencyDescriptor depDescriptor = new DefaultDependencyDescriptor(
                    dependencyMrdis[iDep], false);
            ResolveOptions options = new ResolveOptions();
            options.setRefresh(true);
            options.setUseCacheOnly(true);
            IvyDEMessage.debug("Fetching dependency " + dependencyMrdis[iDep]);
            ResolvedModuleRevision dependency = depResolver.getDependency(depDescriptor,
                new ResolveData(ivy.getResolveEngine(), options));
            if (dependency != null) {
                Artifact[] artifacts = dependency.getDescriptor().getAllArtifacts();
View Full Code Here

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

                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) {
                        return new String[] {"*"};
                    }
                    indexes = ivyFile.getParentTagIndex(indexes[0]);
                    if (indexes == null) {
                        return new String[] {"*"};
                    }
                    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) {
                        return new String[] {"*"};
                    }
                    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)
View Full Code Here

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

        RepositoryCacheManager[] caches = settings.getRepositoryCacheManagers();
        for (int i = 0; i < caches.length; i++) {
            caches[i].clean();
        }

        data = new ResolveData(ivy.getResolveEngine(), new ResolveOptions());
    }
View Full Code Here

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

        RepositoryCacheManager[] caches = settings.getRepositoryCacheManagers();
        for (int i = 0; i < caches.length; i++) {
            caches[i].clean();
        }

        data = new ResolveData(ivy.getResolveEngine(), new ResolveOptions());
    }
View Full Code Here

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

        RepositoryCacheManager[] caches = settings.getRepositoryCacheManagers();
        for (int i = 0; i < caches.length; i++) {
            caches[i].clean();
        }

        data = new ResolveData(ivy.getResolveEngine(), new ResolveOptions());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.