Examples of IvyClasspathContainer


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

        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, false, null);
                }
            }
        }
    }
View Full Code Here

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

            String message = "Could not resolve classpath container: " + entry.getPath().toString();
            throw new CoreException(new Status(IStatus.ERROR, IvyPlugin.ID,
                    IJavaLaunchConfigurationConstants.ERR_INTERNAL_ERROR, message, null));
            // execution will not reach here - exception will be thrown
        }
        IvyClasspathContainer ivycp = (IvyClasspathContainer) container;
        if (ivycp.getConf().isInheritedResolveBeforeLaunch()) {
            IStatus status = ivycp.launchResolve(false, false, new NullProgressMonitor());
            if (status.getCode() != IStatus.OK) {
                throw new CoreException(status);
            }
        }
        IClasspathEntry[] cpes = container.getClasspathEntries();
View Full Code Here

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

        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 moduleDescriptor;
            try {
                moduleDescriptor = container.getState().getModuleDescriptor();
            } catch (IvyDEException e) {
                errorStatuses
                        .add(new Status(IStatus.ERROR, IvyPlugin.ID, IStatus.ERROR,
                                "Failed to get module descriptor at "
                                        + container.getConf().getIvyXmlPath(), e));
                continue;
            }

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

            DependencyDescriptor[] dependencies = moduleDescriptor.getDependencies();
            for (int j = 0; j < dependencies.length; j++) {
                for (int k = 0; k < multiRevisionDependencies.length; k++) {
                    MultiRevisionDependencyDescriptor 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

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

            IJavaProject javaProject = JavaCore.create((IProject) resource);
            List/* <IvyClasspathContainer> */containers = IvyClasspathUtil
                    .getIvyClasspathContainers(javaProject);
            Iterator/* <IvyClasspathContainer> */itContainer = containers.iterator();
            while (itContainer.hasNext()) {
                IvyClasspathContainer ivycp = (IvyClasspathContainer) itContainer.next();
                if (!ivycp.getConf().isInheritedResolveInWorkspace()) {
                    continue;
                }
                projects.add(resource);
            }
        }
View Full Code Here

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

            IJavaProject javaProject = projects[i];
            List/* <IvyClasspathContainer> */containers = IvyClasspathUtil
                    .getIvyClasspathContainers(javaProject);
            Iterator/* <IvyClasspathContainer> */itContainer = containers.iterator();
            while (itContainer.hasNext()) {
                IvyClasspathContainer ivycp = (IvyClasspathContainer) itContainer.next();
                IClasspathEntry[] containerEntries = ivycp.getClasspathEntries();
                for (int j = 0; j < containerEntries.length; j++) {
                    IClasspathEntry containerEntry = containerEntries[j];
                    if (containerEntry == null
                            || containerEntry.getEntryKind() != IClasspathEntry.CPE_PROJECT
                            || !containerEntry.getPath().equals(projectPath)) {
View Full Code Here

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

     * @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

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

        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();
                try {
                    DependencyDescriptor[] descriptors = container.getState().getModuleDescriptor()
                            .getDependencies();
                    for (int j = 0; j < descriptors.length; j++) {
                        DependencyDescriptor descriptor = descriptors[j];
                        MultiRevisionDependencyDescriptor syncableDependencyDescriptor
                                = (MultiRevisionDependencyDescriptor) moduleDescriptorMap
                                        .get(descriptor.getDependencyId());

                        if (syncableDependencyDescriptor == null) {
                            syncableDependencyDescriptor = new MultiRevisionDependencyDescriptor(
                                    descriptor.getDependencyId());

                            moduleDescriptorMap.put(descriptor.getDependencyId(),
                                syncableDependencyDescriptor);
                        }

                        syncableDependencyDescriptor.addDependencyDescriptor(container, descriptor);
                    }
                } catch (IvyDEException e) {
                    e.show(IStatus.ERROR, "Inconsistent Ivy Classpath Container",
                        "Unable to find a module descriptor associated with"
                                + container.getState().getIvyFile().getPath());
                    continue;
                }
            }
        }
View Full Code Here

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

            }
            List/* <IvyClasspathContainer> */containers = IvyClasspathUtil
                    .getIvyClasspathContainers(javaProject);
            Iterator/* <IvyClasspathContainer> */itContainer = containers.iterator();
            while (itContainer.hasNext()) {
                IvyClasspathContainer ivycp = (IvyClasspathContainer) itContainer.next();
                ModuleDescriptor md;
                try {
                    md = ivycp.getState().getCachedModuleDescriptor();
                } catch (IvyDEException e) {
                    IvyPlugin.log(IStatus.WARNING, "Resolve in workspace for '"
                            + resolvingJavaProject.getElementName() + "' cannot depend on "
                            + ivycp.getDescription() + " [" + e.getMessage() + "]", null);
                    continue;
                }

                if (!md.getModuleRevisionId().getModuleId().equals(dependencyMrid.getModuleId())) {
                    // it doesn't match org#module
View Full Code Here

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

            }
            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, false, null);
                    return;
                }
            }
        }
View Full Code Here

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

        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, false, null);
                }
            }
        }
    }
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.