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;
}
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;
}
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);
}
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)));
}
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();
}
Aggregations