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

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


        boolean log = settings.logNotConvertedExclusionRule();
        try {
            settings.setLogNotConvertedExclusionRule(true);
            resolveEngine.setDictatorResolver(fromResolver);

            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)) {
                DefaultDependencyDescriptor dd = new DefaultDependencyDescriptor(md, mrid, false,
                        false, transitive);
                dd.addDependencyConfiguration("default", "*");
                md.addDependency(dd);
            } else {
                Collection mrids = searchEngine.findModuleRevisionIds(fromResolver, mrid, matcher);

                for (Iterator iter = mrids.iterator(); iter.hasNext();) {
                    ModuleRevisionId foundMrid = (ModuleRevisionId) iter.next();
                    Message.info("\tfound " + foundMrid + " to install: adding to the list");
                    DefaultDependencyDescriptor dd = new DefaultDependencyDescriptor(md, foundMrid,
                            false, false, transitive);
                    dd.addDependencyConfiguration("default", "*");
                    md.addDependency(dd);
                }
            }

            // resolve using appropriate resolver
            ResolveReport report = new ResolveReport(md, resolveId);
View Full Code Here


            }
           
            // create a new temporary parser to read the configurations from
            // the specified file.
            Parser parser = new Parser(getModuleDescriptorParser(), ivy, false, url);
            parser.md = new DefaultModuleDescriptor(getModuleDescriptorParser(),
                    new URLResource(url));
            XMLHelper.parse(url , null, parser);

            // add the configurations from this temporary parser to this module descriptor
            Configuration[] configs = parser.getModuleDescriptor().getConfigurations();
View Full Code Here

            }
        }

        protected void setResource(Resource res) {
            this.res = res; // used for log and date only
            md = new DefaultModuleDescriptor(parser, res);
            md.setLastModified(ResourceHelper.getLastModifiedOrDefault(res));
        }
View Full Code Here

    public void toIvyFile(InputStream is, Resource res, File destFile, ModuleDescriptor md)
            throws IOException, ParseException {
        try {
            Namespace ns = null;
            if (md instanceof DefaultModuleDescriptor) {
                DefaultModuleDescriptor dmd = (DefaultModuleDescriptor) md;
                ns = dmd.getNamespace();
            }
            XmlModuleDescriptorUpdater.update(IvyContext.getContext().getSettings(), is, res,
                    destFile, Collections.EMPTY_MAP, md.getStatus(),
                    md.getResolvedModuleRevisionId().getRevision(),
                    md.getResolvedPublicationDate(), ns, true, null);
View Full Code Here

     * Resolves the module identified by the given mrid with its dependencies if transitive is set
     * to true.
     */
    public ResolveReport resolve(final ModuleRevisionId mrid, ResolveOptions options,
            boolean changing) throws ParseException, IOException {
        DefaultModuleDescriptor md;
        ResolveOptions optionsToUse = new ResolveOptions(options);

        if (options.useSpecialConfs()) {
            // create new resolve options because this is a different resolve than the real resolve
            // (which will be a resolve of a newCallerInstance module)
View Full Code Here

    public ResolvedModuleRevision findModule(ModuleRevisionId id, ResolveOptions options) {
        DependencyResolver r = settings.getResolver(id);
        if (r == null) {
            throw new IllegalStateException("no resolver found for " + id.getModuleId());
        }
        DefaultModuleDescriptor md = DefaultModuleDescriptor.newCallerInstance(id,
            new String[] {"*"}, false, false);

        if (options.getResolveId() == null) {
            options.setResolveId(ResolveOptions.getDefaultResolveId(md));
        }
View Full Code Here

                    mrids[i] = new ModuleRevisionId(mids[i], branch, revision);
                } else {
                    mrids[i] = new ModuleRevisionId(mids[i], revision);
                }
            }
            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) {
                gendot(cacheMgr, md.getModuleRevisionId().getOrganisation(), md
                        .getModuleRevisionId().getName());
            }
            if (xml) {

                FileUtil.copy(cacheMgr.getConfigurationResolveReportInCache(resolveId, "default"),
                    new File(todir, outputname + ".xml"), null);
            }
            if (xsl) {
                genreport(cacheMgr, md.getModuleRevisionId().getOrganisation(), md
                        .getModuleRevisionId().getName());
            }
        } catch (Exception e) {
            throw new BuildException("impossible to generate graph for " + mrid + ": " + e, e);
        }
View Full Code Here

    public void toIvyFile(InputStream is, Resource res, File destFile, ModuleDescriptor md)
            throws IOException, ParseException {
        try {
            Namespace ns = null;
            if (md instanceof DefaultModuleDescriptor) {
                DefaultModuleDescriptor dmd = (DefaultModuleDescriptor) md;
                ns = dmd.getNamespace();
            }
            XmlModuleDescriptorUpdater.update(IvyContext.getContext().getSettings(), is, res,
                    destFile, Collections.EMPTY_MAP, md.getStatus(),
                    md.getResolvedModuleRevisionId().getRevision(),
                    md.getResolvedPublicationDate(), ns, true, null);
View Full Code Here

                    }
                   
                    // create a new temporary parser to read the configurations from
                    // the specified file.
                    Parser parser = new Parser(getModuleDescriptorParser(), _ivy, false, url);
                    parser.md = new DefaultModuleDescriptor(getModuleDescriptorParser(),
                            new URLResource(url));
                    XMLHelper.parse(url , null, parser);

                    // add the configurations from this temporary parser to this module descriptor
                    Configuration[] configs = parser.getModuleDescriptor().getConfigurations();
View Full Code Here

                    + Ivy.DATE_FORMAT.format(md.getResolvedPublicationDate()) + "\"");
            if (md.isDefault()) {
                out.println("\t\tdefault=\"true\"");
            }
            if (md instanceof DefaultModuleDescriptor) {
                DefaultModuleDescriptor dmd = (DefaultModuleDescriptor) md;
                if (dmd.getNamespace() != null && !dmd.getNamespace().getName().equals("system")) {
                    out.println("\t\tnamespace=\"" + dmd.getNamespace().getName() + "\"");
                }
            }
            out.println("\t/>");
            Configuration[] confs = md.getConfigurations();
            if (confs.length > 0) {
View Full Code Here

TOP

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

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.