Package org.apache.ivyde.eclipse.cpcontainer

Examples of org.apache.ivyde.eclipse.cpcontainer.IvyClasspathContainer


        if (entry == null) {
            // cannot resolve without entry or project context
            return new IRuntimeClasspathEntry[0];
        }

        IvyClasspathContainer ivycp;

        IJavaProject project = entry.getJavaProject();
        if (project == null) {
            ivycp = new IvyClasspathContainer(null, entry.getPath(), null, null);
        } else {
            IClasspathContainer container = JavaCore
                    .getClasspathContainer(entry.getPath(), project);
            if (container == null) {
                String message = "Could not resolve classpath container: "
View Full Code Here


        // add clean cache
        if (!containers.isEmpty()) {
            if (totalSelected == 1 && containers.size() == 1
                    && ((Set) containers.values().iterator().next()).size() == 1) {
                // only one container
                IvyClasspathContainer ivycp = (IvyClasspathContainer) ((Set) containers.values()
                        .iterator().next()).iterator().next();
                Ivy ivy = ivycp.getState().getCachedIvy();
                if (ivy != null) {
                    addCleanableForSingleContainer(menuManager, items, ivy);
                }
            } else {
                addCleanableForManyContainers(menuManager, items, containers.values());
View Full Code Here

        }
    }

    private boolean collectContainer(Map/* <IProject, Set<IvyClasspathContainer>> */containers,
            ClassPathContainer element) {
        IvyClasspathContainer ivycp = IvyClasspathUtil.jdt2IvyCPC(element);
        if (ivycp == null) {
            return false;
        }
        doCollectContainer(containers, ivycp);
        return true;
View Full Code Here

        Iterator itSet = containerSets.iterator();
        while (itSet.hasNext()) {
            Set set = (Set) itSet.next();
            Iterator itContainer = set.iterator();
            while (itContainer.hasNext()) {
                IvyClasspathContainer ivycp = (IvyClasspathContainer) itContainer.next();
                Ivy ivy = ivycp.getState().getCachedIvy();
                if (ivy != null) {
                    addResolutionCleanable(allCleanables, ivy);
                    addResolutionCleanable(resolutionCleanables, ivy);

                    addRepositoryCleanable(allCleanables, ivy);
View Full Code Here

        MultiStatus errorStatuses = new MultiStatus(IvyPlugin.ID, IStatus.ERROR,
                "Failed to update one or more Ivy files.  See details.", null);

        IvyClasspathContainer[] containers = getIvyClasspathContainers();
        for (int i = 0; i < containers.length; i++) {
            IvyClasspathContainer container = containers[i];

            ModuleDescriptor md = container.getState().getCachedModuleDescriptor();
            if (md == null) {
                continue;
            }

            Map/* <ModuleRevisionId, String> */newRevisions = new HashMap();

            DependencyDescriptor[] dependencies = md.getDependencies();
            for (int j = 0; j < dependencies.length; j++) {
                for (int k = 0; k < multiRevisionDependencies.length; k++) {
                    MultiRevDependencyDescriptor multiRevision = multiRevisionDependencies[k];
                    ModuleRevisionId dependencyRevisionId = dependencies[j]
                            .getDependencyRevisionId();
                    if (dependencies[j].getDependencyId().equals(multiRevision.getModuleId())
                            && multiRevision.hasNewRevision()
                            && multiRevision.isForContainer(container)) {
                        newRevisions.put(dependencyRevisionId, multiRevisionDependencies[k]
                                .getNewRevision());
                        break; // move on to the next dependency
                    }
                }
            }
           
            UpdateOptions updateOptions = new UpdateOptions()
                .setResolvedRevisions(newRevisions)
                .setReplaceInclude(false)
                .setGenerateRevConstraint(false)
                .setNamespace(new RevisionPreservingNamespace());
            File ivyFile = container.getState().getIvyFile();
           
            File ivyTempFile = new File(ivyFile.toString() + ".temp");
            try {
                XmlModuleDescriptorUpdater.update(ivyFile.toURI().toURL(), ivyTempFile,
                    updateOptions);
                saveChanges(container, ivyFile, ivyTempFile);
            } catch (MalformedURLException e) {
                errorStatuses.add(new Status(IStatus.ERROR, IvyPlugin.ID, IStatus.ERROR,
                        "Failed to write Ivy file " + container.getState().getIvyFile().getPath()
                                + " (malformed URL)", e));
            } catch (IOException e) {
                errorStatuses.add(new Status(IStatus.ERROR, IvyPlugin.ID, IStatus.ERROR,
                        "Failed to write Ivy file " + container.getState().getIvyFile().getPath(),
                        e));
            } catch (SAXException e) {
                errorStatuses.add(new Status(IStatus.ERROR, IvyPlugin.ID, IStatus.ERROR,
                    "Failed to write Ivy file " + container.getState().getIvyFile().getPath(),
                    e));
            } finally {
                ivyTempFile.delete();
            }
        }
View Full Code Here

        IFile file = ((IvyFileEditorInput) getEditorInput()).getFile();
        List/* <IvyClasspathContainer> */containers = IvyClasspathUtil
                .getIvySettingsClasspathContainers(file);
        Iterator/* <IvyClasspathContainer> */itContainers = containers.iterator();
        while (itContainers.hasNext()) {
            IvyClasspathContainer ivycp = (IvyClasspathContainer) itContainers.next();
            ivycp.launchResolve(false, null);
        }
    }
View Full Code Here

        for (int i = 0; i < projects.length; i++) {
            List containers = IvyClasspathUtil.getIvyClasspathContainers(projects[i]);
            Iterator containerIter = containers.iterator();

            while (containerIter.hasNext()) {
                IvyClasspathContainer container = (IvyClasspathContainer) containerIter.next();
                ModuleDescriptor md = container.getState().getCachedModuleDescriptor();
                if (md == null) {
                    continue;
                }
                DependencyDescriptor[] descriptors = md.getDependencies();
                for (int j = 0; j < descriptors.length; j++) {
View Full Code Here

     * @return true if there is a project match
     */
    public boolean isForContainer(IvyClasspathContainer container) {
        IvyClasspathContainer[] containers = getIvyClasspathContainers();
        for (int i = 0; i < containers.length; i++) {
            IvyClasspathContainer currentContainer = containers[i];
            if (currentContainer.equals(container)) {
                return true;
            }
        }

        return false;
View Full Code Here

            }
            List/* <IvyClasspathContainer> */containers = IvyClasspathUtil
                    .getIvyClasspathContainers(javaProject);
            Iterator containerIter = containers.iterator();
            while (containerIter.hasNext()) {
                IvyClasspathContainer container = (IvyClasspathContainer) containerIter.next();
                File containerIvyFile = container.getState().getIvyFile();
                if (containerIvyFile.equals(resourceFile.getLocation().toFile())) {
                    container.launchResolve(false, null);
                    return;
                }
            }
        }
View Full Code Here

        for (int i = 0; i < projects.length; i++) {
            List/* <IvyClasspathContainer> */containers = IvyClasspathUtil
                    .getIvyClasspathContainers(projects[i]);
            Iterator/* <IvyClasspathContainer> */itContainers = containers.iterator();
            while (itContainers.hasNext()) {
                IvyClasspathContainer ivycp = (IvyClasspathContainer) itContainers.next();
                if (!ivycp.getConf().isSettingsProjectSpecific()) {
                    ivycp.launchResolve(false, null);
                }
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.ivyde.eclipse.cpcontainer.IvyClasspathContainer

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.