Package org.eclipse.tycho.p2.facade.internal

Examples of org.eclipse.tycho.p2.facade.internal.DefaultTychoP2RuntimeResolver


                            reader.setLocalRepository(session.getLocalRepository());

                            String repositoryKey = getRepositoryKey(repository);
                            TychoRepositoryIndex index = repositoryCache.getRepositoryIndex(repositoryKey);
                            if (index == null) {
                                index = new DefaultTychoRepositoryIndex(reader);

                                repositoryCache.putRepositoryIndex(repositoryKey, index);
                            }

                            resolver.addMavenRepository(uri, index, reader);
View Full Code Here


                 * Since the p2artifacts.xml exists on disk, we can add the artifact to the (global)
                 * p2 artifact repository view of local Maven repository. Then, the artifact is
                 * available in the build.
                 */
                // TODO this should happen in resolution context
                p2ArtifactsInLocalRepo.addProject(new GAV(artifact.getGroupId(), artifact.getArtifactId(), artifact
                        .getVersion()));

            } else if (!p2Data.p2MetadataXml.isAvailable() && !p2Data.p2ArtifactsXml.isAvailable()) {
                /*
                 * The POM dependency has not been built by Tycho. If the dependency is a bundle,
View Full Code Here

                            MavenRepositoryReader reader = plexus.lookup(MavenRepositoryReader.class);
                            reader.setArtifactRepository(repository);
                            reader.setLocalRepository(session.getLocalRepository());

                            String repositoryKey = getRepositoryKey(repository);
                            TychoRepositoryIndex index = repositoryCache.getRepositoryIndex(repositoryKey);
                            if (index == null) {
                                index = new DefaultTychoRepositoryIndex(reader);

                                repositoryCache.putRepositoryIndex(repositoryKey, index);
                            }
View Full Code Here

        this.logger = logger;
    }

    void addPomDependenciesToResolutionContext(MavenProject project, Collection<Artifact> transitivePomDependencies,
            ResolutionContext resolutionContext) {
        final TychoRepositoryIndex p2ArtifactsInLocalRepo = loadIndexOfP2ArtifactsInLocalMavenRepo();

        for (Artifact artifact : transitivePomDependencies) {
            P2DataArtifacts p2Data = new P2DataArtifacts(artifact);
            p2Data.resolve(session, project.getRemoteArtifactRepositories());

            if (p2Data.p2MetadataXml.isAvailable() && p2Data.p2ArtifactsXml.isAvailable()) {
                /*
                 * The POM dependency has (probably) been built by Tycho, so we can re-use the
                 * existing p2 data in the target platform. The data is stored in the attached
                 * artifacts p2metadata.xml and p2artifacts.xml, which are now present in the local
                 * Maven repository.
                 */
                if (logger.isDebugEnabled()) {
                    logger.debug("P2TargetPlatformResolver: Using existing metadata of " + artifact.toString());
                }

                resolutionContext.addArtifactWithExistingMetadata(new ArtifactFacade(artifact), new ArtifactFacade(
                        p2Data.p2MetadataXml.artifact));

                /*
                 * Since the p2artifacts.xml exists on disk, we can add the artifact to the (global)
                 * p2 artifact repository view of local Maven repository. Then, the artifact is
                 * available in the build.
                 */
                // TODO this should happen in resolution context
                p2ArtifactsInLocalRepo.addProject(new GAV(artifact.getGroupId(), artifact.getArtifactId(), artifact
                        .getVersion()));

            } else if (!p2Data.p2MetadataXml.isAvailable() && !p2Data.p2ArtifactsXml.isAvailable()) {
                /*
                 * The POM dependency has not been built by Tycho. If the dependency is a bundle,
                 * run the p2 bundle publisher on it and add the result to the resolution context.
                 */
                if (logger.isDebugEnabled()) {
                    logger.debug("P2resolver.addMavenArtifact " + artifact.toString());
                }

                resolutionContext.publishAndAddArtifactIfBundleArtifact(new ArtifactFacade(artifact));

            } else {
                failDueToPartialP2Data(artifact, p2Data);
            }
        }

        try {
            p2ArtifactsInLocalRepo.save();
        } catch (IOException e) {
            throw new RuntimeException(
                    "I/O error while updating p2 artifact repository view on local Maven repository", e);
        }
    }
View Full Code Here

        resolver.setRepositoryCache(repositoryCache);

        resolver.setOffline(session.isOffline());

        resolver.setLogger(new P2Logger() {
            public void debug(String message) {
                if (message != null && message.length() > 0) {
                    getLogger().info(message); // TODO
                }
            }
View Full Code Here

            MultiEnvironmentTargetPlatform multiPlatform = new MultiEnvironmentTargetPlatform();

            // FIXME this is just wrong
            for (int i = 0; i < configuration.getEnvironments().size(); i++) {
                TargetEnvironment environment = configuration.getEnvironments().get(i);
                P2ResolutionResult result = results.get(i);

                DefaultTargetPlatform platform = newDefaultTargetPlatform(session, projects, result);

                // addProjects( session, platform );

                multiPlatform.addPlatform(environment, platform);
            }

            return multiPlatform;
        } else {
            P2ResolutionResult result = resolver.collectProjectDependencies(project.getBasedir());

            return newDefaultTargetPlatform(session, projects, result);
        }
    }
View Full Code Here

        return false;
    }

    public TargetPlatform resolvePlatform(MavenSession session, MavenProject project,
            List<ReactorProject> reactorProjects, List<Dependency> dependencies) {
        P2Resolver resolver = resolverFactory.createResolver();

        try {
            return doResolvePlatform(session, project, reactorProjects, dependencies, resolver);
        } finally {
            resolver.stop();
        }
    }
View Full Code Here

            MultiEnvironmentTargetPlatform multiPlatform = new MultiEnvironmentTargetPlatform();

            // FIXME this is just wrong
            for (int i = 0; i < configuration.getEnvironments().size(); i++) {
                TargetEnvironment environment = configuration.getEnvironments().get(i);
                P2ResolutionResult result = results.get(i);

                DefaultTargetPlatform platform = newDefaultTargetPlatform(session, projects, result);

                // addProjects( session, platform );

                multiPlatform.addPlatform(environment, platform);
            }

            return multiPlatform;
        } else {
            P2ResolutionResult result = resolver.collectProjectDependencies(resolutionContext, project.getBasedir());

            return newDefaultTargetPlatform(session, projects, result);
        }
    }
View Full Code Here

                .getContextValue(TychoConstants.CTX_TARGET_PLATFORM_CONFIGURATION);

        ResolutionContext resolutionContext = resolverFactory.createResolutionContext(localRepositoryRoot,
                session.isOffline(), configuration.isDisableP2Mirrors(), loggerForOsgiImpl);

        P2Resolver osgiResolverImpl = resolverFactory.createResolver(loggerForOsgiImpl);

        try {
            return doResolvePlatform(session, project, reactorProjects, dependencies, resolutionContext,
                    osgiResolverImpl, configuration);
        } finally {
View Full Code Here

        File localRepositoryRoot = new File(session.getLocalRepository().getBasedir());

        TargetPlatformConfiguration configuration = (TargetPlatformConfiguration) project
                .getContextValue(TychoConstants.CTX_TARGET_PLATFORM_CONFIGURATION);

        ResolutionContext resolutionContext = resolverFactory.createResolutionContext(localRepositoryRoot,
                session.isOffline(), configuration.isDisableP2Mirrors(), loggerForOsgiImpl);

        P2Resolver osgiResolverImpl = resolverFactory.createResolver(loggerForOsgiImpl);

        try {
            return doResolvePlatform(session, project, reactorProjects, dependencies, resolutionContext,
                    osgiResolverImpl, configuration);
        } finally {
            resolutionContext.stop();
        }
    }
View Full Code Here

TOP

Related Classes of org.eclipse.tycho.p2.facade.internal.DefaultTychoP2RuntimeResolver

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.