Search in sources :

Example 6 with TargetPlatformConfigurationStub

use of org.eclipse.tycho.p2.target.facade.TargetPlatformConfigurationStub in project tycho by eclipse.

the class P2ResolverImpl method getTargetPlatformAsResolutionResult.

// TODO 412416 make this obsolete by adding appropriate getters in TargetPlatform interface
@Override
public P2ResolutionResult getTargetPlatformAsResolutionResult(TargetPlatformConfigurationStub tpConfiguration, String eeName) {
    P2TargetPlatform targetPlatform = targetPlatformFactory.createTargetPlatform(tpConfiguration, new ExecutionEnvironmentConfigurationStub(eeName), null, null);
    MetadataOnlyP2ResolutionResult result = new MetadataOnlyP2ResolutionResult();
    for (IInstallableUnit iu : targetPlatform.getInstallableUnits()) {
        result.addArtifact(ArtifactType.TYPE_INSTALLABLE_UNIT, iu.getId(), iu.getVersion().toString(), iu);
    }
    return result;
}
Also used : ExecutionEnvironmentConfigurationStub(org.eclipse.tycho.core.ee.shared.ExecutionEnvironmentConfigurationStub) P2TargetPlatform(org.eclipse.tycho.p2.target.P2TargetPlatform) IInstallableUnit(org.eclipse.equinox.p2.metadata.IInstallableUnit)

Example 7 with TargetPlatformConfigurationStub

use of org.eclipse.tycho.p2.target.facade.TargetPlatformConfigurationStub in project tycho by eclipse.

the class ReactorRepositoryManagerImpl method computePreliminaryTargetPlatform.

@Override
public TargetPlatform computePreliminaryTargetPlatform(ReactorProject project, TargetPlatformConfigurationStub tpConfiguration, ExecutionEnvironmentConfiguration eeConfiguration, List<ReactorProject> reactorProjects, PomDependencyCollector pomDependencies) {
    // at this point, there is only incomplete ("dependency-only") metadata for the reactor projects
    TargetPlatform result = tpFactory.createTargetPlatform(tpConfiguration, eeConfiguration, reactorProjects, pomDependencies);
    project.setContextValue(PRELIMINARY_TARGET_PLATFORM_KEY, result);
    return result;
}
Also used : P2TargetPlatform(org.eclipse.tycho.p2.target.P2TargetPlatform) TargetPlatform(org.eclipse.tycho.artifacts.TargetPlatform)

Example 8 with TargetPlatformConfigurationStub

use of org.eclipse.tycho.p2.target.facade.TargetPlatformConfigurationStub in project tycho by eclipse.

the class P2DependencyResolver method computePreliminaryTargetPlatform.

@Override
public TargetPlatform computePreliminaryTargetPlatform(MavenSession session, MavenProject project, List<ReactorProject> reactorProjects) {
    TargetPlatformConfiguration configuration = TychoProjectUtils.getTargetPlatformConfiguration(project);
    ExecutionEnvironmentConfiguration ee = TychoProjectUtils.getExecutionEnvironmentConfiguration(project);
    TargetPlatformConfigurationStub tpConfiguration = new TargetPlatformConfigurationStub();
    tpConfiguration.setIncludePackedArtifacts(configuration.isIncludePackedArtifacts());
    PomDependencyCollector pomDependencies = null;
    if (TargetPlatformConfiguration.POM_DEPENDENCIES_CONSIDER.equals(configuration.getPomDependencies())) {
        pomDependencies = collectPomDependencies(project, reactorProjects, session);
    } else {
        // TODO 412416 remove this when the setProjectLocation is no longer needed
        pomDependencies = resolverFactory.newPomDependencyCollector();
        pomDependencies.setProjectLocation(project.getBasedir());
    }
    for (ArtifactRepository repository : project.getRemoteArtifactRepositories()) {
        addEntireP2RepositoryToTargetPlatform(repository, tpConfiguration);
    }
    tpConfiguration.setEnvironments(configuration.getEnvironments());
    for (File file : configuration.getTargets()) {
        addTargetFileContentToTargetPlatform(file, configuration.getTargetDefinitionIncludeSourceMode(), tpConfiguration);
    }
    tpConfiguration.addFilters(configuration.getFilters());
    return reactorRepositoryManager.computePreliminaryTargetPlatform(DefaultReactorProject.adapt(project), tpConfiguration, ee, reactorProjects, pomDependencies);
}
Also used : TargetPlatformConfigurationStub(org.eclipse.tycho.p2.target.facade.TargetPlatformConfigurationStub) ExecutionEnvironmentConfiguration(org.eclipse.tycho.core.ee.shared.ExecutionEnvironmentConfiguration) PomDependencyCollector(org.eclipse.tycho.p2.target.facade.PomDependencyCollector) ArtifactRepository(org.apache.maven.artifact.repository.ArtifactRepository) TargetPlatformConfiguration(org.eclipse.tycho.core.TargetPlatformConfiguration) File(java.io.File)

Example 9 with TargetPlatformConfigurationStub

use of org.eclipse.tycho.p2.target.facade.TargetPlatformConfigurationStub in project tycho by eclipse.

the class TargetPlatformFactoryTest method setUpSubjectAndContext.

@Before
public void setUpSubjectAndContext() throws Exception {
    subject = new TestResolverFactory(logVerifier.getLogger()).getTargetPlatformFactoryImpl();
    tpConfig = new TargetPlatformConfigurationStub();
    // dummy value for target file resolution
    tpConfig.setEnvironments(Collections.singletonList(new TargetEnvironment(null, null, null)));
}
Also used : TargetPlatformConfigurationStub(org.eclipse.tycho.p2.target.facade.TargetPlatformConfigurationStub) TargetEnvironment(org.eclipse.tycho.core.shared.TargetEnvironment) Before(org.junit.Before)

Example 10 with TargetPlatformConfigurationStub

use of org.eclipse.tycho.p2.target.facade.TargetPlatformConfigurationStub in project tycho by eclipse.

the class CustomEEResolutionHandlerTest method setUpContext.

@Before
public void setUpContext() throws Exception {
    tpFactory = new TestResolverFactory(logVerifier.getLogger()).getTargetPlatformFactory();
    tpConfig = new TargetPlatformConfigurationStub();
}
Also used : TargetPlatformConfigurationStub(org.eclipse.tycho.p2.target.facade.TargetPlatformConfigurationStub) TestResolverFactory(org.eclipse.tycho.p2.target.TestResolverFactory) Before(org.junit.Before)

Aggregations

TargetPlatformConfigurationStub (org.eclipse.tycho.p2.target.facade.TargetPlatformConfigurationStub)6 IInstallableUnit (org.eclipse.equinox.p2.metadata.IInstallableUnit)4 P2TargetPlatform (org.eclipse.tycho.p2.target.P2TargetPlatform)4 ExecutionEnvironmentConfigurationStub (org.eclipse.tycho.core.ee.shared.ExecutionEnvironmentConfigurationStub)3 Before (org.junit.Before)3 ReactorProjectIdentities (org.eclipse.tycho.ReactorProjectIdentities)2 MavenRepositoryLocation (org.eclipse.tycho.core.resolver.shared.MavenRepositoryLocation)2 File (java.io.File)1 ArrayList (java.util.ArrayList)1 ArtifactRepository (org.apache.maven.artifact.repository.ArtifactRepository)1 ReactorProject (org.eclipse.tycho.ReactorProject)1 TargetPlatform (org.eclipse.tycho.artifacts.TargetPlatform)1 TargetPlatformFilter (org.eclipse.tycho.artifacts.TargetPlatformFilter)1 TargetPlatformConfiguration (org.eclipse.tycho.core.TargetPlatformConfiguration)1 ExecutionEnvironmentConfiguration (org.eclipse.tycho.core.ee.shared.ExecutionEnvironmentConfiguration)1 MultiLineLogger (org.eclipse.tycho.core.shared.MultiLineLogger)1 TargetEnvironment (org.eclipse.tycho.core.shared.TargetEnvironment)1 DefaultDependencyMetadataGenerator (org.eclipse.tycho.p2.impl.publisher.DefaultDependencyMetadataGenerator)1 P2GeneratorImpl (org.eclipse.tycho.p2.impl.publisher.P2GeneratorImpl)1 ReactorProjectStub (org.eclipse.tycho.p2.impl.test.ReactorProjectStub)1