use of org.eclipse.tycho.core.resolver.shared.OptionalResolutionAction in project tycho by eclipse.
the class P2DependencyResolver method getThisReactorProject.
private ReactorProject getThisReactorProject(MavenSession session, MavenProject project, TargetPlatformConfiguration configuration) {
// 'this' project should obey optionalDependencies configuration
final List<TargetEnvironment> environments = configuration.getEnvironments();
final OptionalResolutionAction optionalAction = configuration.getDependencyResolverConfiguration().getOptionalResolutionAction();
Map<String, IDependencyMetadata> dependencyMetadata = getDependencyMetadata(session, project, environments, optionalAction);
final Set<Object> metadata = new LinkedHashSet<>();
final Set<Object> secondaryMetadata = new LinkedHashSet<>();
for (Map.Entry<String, IDependencyMetadata> entry : dependencyMetadata.entrySet()) {
metadata.addAll(entry.getValue().getMetadata(true));
secondaryMetadata.addAll(entry.getValue().getMetadata(false));
}
ReactorProject reactorProjet = new DefaultReactorProject(project) {
@Override
public Set<?> getDependencyMetadata(boolean primary) {
return primary ? metadata : secondaryMetadata;
}
};
return reactorProjet;
}
Aggregations