use of org.eclipse.tycho.p2.util.resolution.ProjectorResolutionStrategy in project tycho by eclipse.
the class P2ResolverImpl method resolveMetadata.
@Override
public P2ResolutionResult resolveMetadata(TargetPlatformConfigurationStub tpConfiguration, String eeName) {
P2TargetPlatform contextImpl = targetPlatformFactory.createTargetPlatform(tpConfiguration, new ExecutionEnvironmentConfigurationStub(eeName), null, null);
ResolutionDataImpl data = new ResolutionDataImpl(contextImpl.getEEResolutionHints());
data.setAvailableIUs(contextImpl.getInstallableUnits());
data.setRootIUs(new HashSet<IInstallableUnit>());
data.setAdditionalRequirements(additionalRequirements);
ProjectorResolutionStrategy strategy = new ProjectorResolutionStrategy(logger);
strategy.setData(data);
MetadataOnlyP2ResolutionResult result = new MetadataOnlyP2ResolutionResult();
try {
for (IInstallableUnit iu : strategy.multiPlatformResolve(environments, monitor)) {
result.addArtifact(ArtifactType.TYPE_INSTALLABLE_UNIT, iu.getId(), iu.getVersion().toString(), iu);
}
} catch (ResolverException e) {
logger.error("Resolution failed:");
new MultiLineLogger(logger).error(e.getDetails(), " ");
throw new RuntimeException(e);
}
return result;
}
use of org.eclipse.tycho.p2.util.resolution.ProjectorResolutionStrategy in project tycho by eclipse.
the class P2ResolverImpl method resolveDependencies.
@Override
public List<P2ResolutionResult> resolveDependencies(TargetPlatform targetPlatform, ReactorProject project) {
setContext(targetPlatform, project);
if (project != null && PackagingType.TYPE_ECLIPSE_TEST_PLUGIN.equals(project.getPackaging())) {
addDependenciesForTests();
}
ArrayList<P2ResolutionResult> results = new ArrayList<>();
usedTargetPlatformUnits = new LinkedHashSet<>();
for (TargetEnvironment environment : environments) {
results.add(resolveDependencies(project, new ProjectorResolutionStrategy(logger), environment));
}
context.reportUsedLocalIUs(usedTargetPlatformUnits);
usedTargetPlatformUnits = null;
return results;
}
Aggregations