Package org.apache.ivy.core.module.descriptor

Examples of org.apache.ivy.core.module.descriptor.Configuration


            DefaultModuleDescriptor md = new DefaultModuleDescriptor(ModuleRevisionId.newInstance(
                "apache", "ivy-install", "1.0"), settings.getStatusManager().getDefaultStatus(),
                    new Date());
            String resolveId = ResolveOptions.getDefaultResolveId(md);
            md.addConfiguration(new Configuration("default"));
            md.addConflictManager(new ModuleId(ExactPatternMatcher.ANY_EXPRESSION,
                    ExactPatternMatcher.ANY_EXPRESSION), ExactPatternMatcher.INSTANCE,
                new NoConflictManager());

            if (MatcherHelper.isExact(matcher, mrid)) {
View Full Code Here


                    String ext = ivy.substitute(attributes.getValue("extends"));
                    String transitiveValue = attributes.getValue("transitive");
                    boolean transitive = (transitiveValue == null) ? true : Boolean
                            .valueOf(attributes.getValue("transitive")).booleanValue();
                    String deprecated = attributes.getValue("deprecated");
                    Configuration configuration = new Configuration(conf,
                            Configuration.Visibility
                                    .getVisibility(visibility == null ? "public"
                                            : visibility), ivy.substitute(attributes
                                    .getValue("description")), ext == null ? null : ext
                                    .split(","), transitive, deprecated);
View Full Code Here

            }
        }

        private void checkConfigurations() {
            if (md.getConfigurations().length == 0) {
                md.addConfiguration(new Configuration("default"));
            }
        }
View Full Code Here

    private boolean handleConfiguration(boolean loaded, String rootModuleConf, IvyNode parent,
            String parentConf, String conf, boolean shouldBePublic) {
        if (md != null) {
            String[] confs = getRealConfs(conf);
            for (int i = 0; i < confs.length; i++) {
                Configuration c = md.getConfiguration(confs[i]);
                if (c == null) {
                    confsToFetch.remove(conf);
                    if (!conf.equals(confs[i])) {
                        problem = new RuntimeException("configuration(s) not found in " + this
                                + ": " + conf + ". Missing configuration: " + confs[i]
                                + ". It was required from " + parent + " " + parentConf);
                    } else {
                        problem = new RuntimeException("configuration(s) not found in " + this
                                + ": " + confs[i] + ". It was required from " + parent + " "
                                + parentConf);
                    }
                    return false;
                } else if (shouldBePublic && !isRoot()
                        && c.getVisibility() != Configuration.Visibility.PUBLIC) {
                    confsToFetch.remove(conf);
                    problem = new RuntimeException("configuration not public in " + this + ": " + c
                            + ". It was required from " + parent + " " + parentConf);
                    return false;
                }
View Full Code Here

            throw new IllegalStateException(
                    "impossible to get configuration when data has not been loaded");
        }
        String defaultConf = getDefaultConf(conf);
        conf = getMainConf(conf);
        Configuration configuration = md.getConfiguration(conf);
        if (configuration == null) {
            configuration = md.getConfiguration(defaultConf);
        }
        return configuration;
    }
View Full Code Here

            depConfs = new HashSet();
            rootModuleConfs.put(rootModuleConf, depConfs);
        }
        if (md != null) {
            // remove all given dependency configurations to the set + extended ones
            Configuration c = md.getConfiguration(conf);
            if (conf != null) {
                String[] exts = c.getExtends();
                for (int i = 0; i < exts.length; i++) {
                    discardConf(rootModuleConf, exts[i]); // recursive remove of extended
                    // configurations
                }
                depConfs.remove(c.getName());
            } else {
                Message.warn("unknown configuration in " + getId() + ": " + conf);
            }
        } else {
            depConfs.remove(conf);
View Full Code Here

            rootModuleConfs.put(rootModuleConf, depConfs);
        }
        if (md != null) {
            // add all given dependency configurations to the set + extended ones
            for (int i = 0; i < dependencyConfs.length; i++) {
                Configuration conf = md.getConfiguration(dependencyConfs[i]);
                if (conf != null) {
                    String[] exts = conf.getExtends();
                    addRootModuleConfigurations(rootModuleConf, exts); // recursive add of extended
                    // configurations
                    depConfs.add(conf.getName());
                } else {
                    Message.warn("unknown configuration in " + getId() + ": " + dependencyConfs[i]);
                }
            }
        } else {
View Full Code Here

    protected boolean isParentConfTransitive() {
        String conf = getParent().getRequestedConf();
        if (conf == null) {
            return true;
        }
        Configuration parentConf = getParentNode().getConfiguration(conf);
        return parentConf.isTransitive();

    }
View Full Code Here

                    + (System.currentTimeMillis() - start) + "ms)");
        }
    }

    private void doFetchDependencies(VisitNode node, String conf) {
        Configuration c = node.getConfiguration(conf);
        if (c == null) {
            Message.warn("configuration not found '" + conf + "' in " + node.getResolvedId()
                    + ": ignoring");
            if (node.getParent() != null) {
                Message.warn("it was required from " + node.getParent().getResolvedId());
            }
            return;
        }
        // we handle the case where the asked configuration extends others:
        // we have to first fetch the extended configurations

        // first we check if this is the actual requested conf (not an extended one)
        boolean requestedConfSet = false;
        if (node.getRequestedConf() == null) {
            node.setRequestedConf(conf);
            requestedConfSet = true;
        }
        // now let's recurse in extended confs
        String[] extendedConfs = c.getExtends();
        if (extendedConfs.length > 0) {
            node.updateConfsToFetch(Arrays.asList(extendedConfs));
        }
        for (int i = 0; i < extendedConfs.length; i++) {
            fetchDependencies(node, extendedConfs[i], false);
View Full Code Here

            Configuration[] configurations = md.getConfigurations();
            if (confs.size() != 0 && "*".equals(confs.get(0))) {
                confTableViewer.setCheckedElements(configurations);
            } else {
                for (int i = 0; i < confs.size(); i++) {
                    Configuration configuration = md.getConfiguration((String) confs.get(i));
                    if (configuration != null) {
                        confTableViewer.setChecked(configuration, true);
                    }
                }
            }
View Full Code Here

TOP

Related Classes of org.apache.ivy.core.module.descriptor.Configuration

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.