Package org.apache.ivy.core.cache

Examples of org.apache.ivy.core.cache.ResolutionCacheManager


        this.md = md;
        this.conf = conf;
        this.date = date;

        // parse previous deps from previous report file if any
        ResolutionCacheManager cache = options.getCache();
        String resolveId = options.getResolveId();
        File previousReportFile = cache.getConfigurationResolveReportInCache(resolveId, conf);
        if (previousReportFile.exists()) {
            try {
                XmlReportParser parser = new XmlReportParser();
                parser.parse(previousReportFile);
                previousDeps = Arrays.asList(parser.getDependencyRevisionIds());
View Full Code Here


            if (parent == null) {
                throw new ParseException("Unable to parse included ivy file for "
                        + parentOrganisation + "#" + parentModule + ";" + parentRevision, 0);
            }

            ResolutionCacheManager cacheManager = settings.getResolutionCacheManager();

            File ivyFileInCache = cacheManager.getResolvedIvyFileInCache(parent
                    .getResolvedModuleRevisionId());
            //Generate the parent cache file if necessary
            if (parent.getResource() != null
                    && !parent.getResource().getName().equals(ivyFileInCache.toURI().toString())) {
                try {
View Full Code Here

            String outFile) {
        try {
            String pathSeparator = System.getProperty("path.separator");
            StringBuffer buf = new StringBuffer();
            Collection all = new LinkedHashSet();
            ResolutionCacheManager cacheMgr = ivy.getResolutionCacheManager();
            XmlReportParser parser = new XmlReportParser();
            for (int i = 0; i < confs.length; i++) {
                String resolveId = ResolveOptions.getDefaultResolveId(md);
                File report = cacheMgr.getConfigurationResolveReportInCache(resolveId, confs[i]);
                parser.parse(report);

                all.addAll(Arrays.asList(parser.getArtifactReports()));
            }
            for (Iterator iter = all.iterator(); iter.hasNext();) {
View Full Code Here

            }
        }
       
        try {
            Collection all = new LinkedHashSet();
            ResolutionCacheManager cacheMgr = ivy.getResolutionCacheManager();
            XmlReportParser parser = new XmlReportParser();
            for (int i = 0; i < confs.length; i++) {
                String resolveId = ResolveOptions.getDefaultResolveId(md);
                File report = cacheMgr.getConfigurationResolveReportInCache(resolveId, confs[i]);
                parser.parse(report);

                all.addAll(Arrays.asList(parser.getArtifactReports()));
            }
            for (Iterator iter = all.iterator(); iter.hasNext();) {
View Full Code Here

        if (options.getResolveId() == null) {
            options.setResolveId(ResolveOptions.getDefaultResolveId(moduleId));
        }

        ResolutionCacheManager cacheManager = getCache();
        String[] confs = getConfs(mrid, options);
        String destIvyPattern = IvyPatternHelper.substituteVariables(options.getDestIvyPattern(),
            settings.getVariables());

        // find what we must retrieve where

        // ArtifactDownloadReport source -> Set (String copyDestAbsolutePath)
        final Map artifactsToCopy = new HashMap();
        // String copyDestAbsolutePath -> Set (ArtifactRevisionId source)
        final Map conflictsMap = new HashMap();
        // String copyDestAbsolutePath -> Set (ArtifactDownloadReport source)
        final Map conflictsReportsMap = new HashMap();
        // String copyDestAbsolutePath -> Set (String conf)
        final Map conflictsConfMap = new HashMap();
       
        XmlReportParser parser = new XmlReportParser();
        for (int i = 0; i < confs.length; i++) {
            final String conf = confs[i];

            File report = cacheManager.getConfigurationResolveReportInCache(options.getResolveId(),
                conf);
            parser.parse(report);

            Collection artifacts = new ArrayList(Arrays.asList(parser.getArtifactReports()));
            if (destIvyPattern != null) {
View Full Code Here

                new ResolveOptions()
                    .setResolveId(resolveId)
                    .setCache(ivy.getCacheManager(cache))
                    .setValidate(doValidate(settings)));

            ResolutionCacheManager cacheMgr = getIvyInstance().getCacheManager(cache);
            new XmlReportOutputter().output(report, cacheMgr);
            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());
View Full Code Here

        return style;
    }

    private void genStyled(File cache, String organisation, String module, String[] confs,
            File style, String ext) throws IOException {
        ResolutionCacheManager cacheMgr = getIvyInstance().getCacheManager(cache);

        // process the report with xslt to generate dot file
        File out;
        if (todir != null) {
            out = todir;
        } else {
            out = new File(".");
        }
       
        InputStream xsltStream = null;
        try {
            // create stream to stylesheet
            xsltStream = new BufferedInputStream(new FileInputStream(style));
            Source xsltSource = new StreamSource(xsltStream, JAXPUtils.getSystemId(style));
           
            // create transformer
            TransformerFactory tFactory = TransformerFactory.newInstance();
            Transformer transformer = tFactory.newTransformer(xsltSource);
           
            // add standard parameters
            transformer.setParameter("confs", conf);
            transformer.setParameter("extension", xslext);
           
            // add the provided XSLT parameters
            for (Iterator it = params.iterator(); it.hasNext();) {
                XSLTProcess.Param param = (XSLTProcess.Param) it.next();
                transformer.setParameter(param.getName(), param.getExpression());
            }
           
            // create the report
            for (int i = 0; i < confs.length; i++) {
                File reportFile =
                    cacheMgr.getConfigurationResolveReportInCache(resolveId, confs[i]);
                File outFile =
                    new File(out, IvyPatternHelper.substitute(outputpattern, organisation, module,
                    "", "", "", ext, confs[i]));
               
                log("Processing " + reportFile + " to " + outFile);
View Full Code Here

   
    public void doExecute() throws BuildException {
        prepareAndCheck();

        try {
            ResolutionCacheManager cacheMgr = getIvyInstance().getCacheManager(getCache());
            String[] confs = splitConfs(getConf());
            String resolveId = getResolveId();
            if (resolveId == null) {
                resolveId = ResolveOptions.getDefaultResolveId(getResolvedModuleId());
            }
            XmlReportParser parser = new XmlReportParser();
            for (int i = 0; i < confs.length; i++) {
                File report = cacheMgr.getConfigurationResolveReportInCache(resolveId, confs[i]);
                parser.parse(report);

                Artifact[] artifacts = parser.getArtifacts();
                for (int j = 0; j < artifacts.length; j++) {
                    Artifact artifact = artifacts[j];
View Full Code Here

            }
        } else {
            Message.debug("using stored report to get artifacts list");

            XmlReportParser parser = new XmlReportParser();
            ResolutionCacheManager cacheMgr = getIvyInstance().getCacheManager(getCache());
            String resolvedId = getResolveId();
            if (resolvedId == null) {
                resolvedId = ResolveOptions.getDefaultResolveId(getResolvedModuleId());
            }
            for (int i = 0; i < confs.length; i++) {
                File reportFile = cacheMgr.getConfigurationResolveReportInCache(resolvedId,
                    confs[i]);
                parser.parse(reportFile);

                Artifact[] artifacts = parser.getArtifacts();
                all.addAll(Arrays.asList(artifacts));
View Full Code Here

        }
    }

    private void genxml(File cache, String organisation, String module, String[] confs)
            throws IOException {
        ResolutionCacheManager cacheMgr = getIvyInstance().getCacheManager(cache);
        for (int i = 0; i < confs.length; i++) {
            File xml = cacheMgr.getConfigurationResolveReportInCache(resolveId, confs[i]);

            File out;
            if (todir != null) {
                out = new File(todir, IvyPatternHelper.substitute(outputpattern, organisation,
                    module, "", "", "", "xml", confs[i]));
View Full Code Here

TOP

Related Classes of org.apache.ivy.core.cache.ResolutionCacheManager

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.