use of org.eclipse.tycho.p2.target.facade.TargetDefinition in project tycho by eclipse.
the class TargetDefinitionResolverIncludeSourceTest method testIncludeSourceWithPlannerMode.
@Test
public void testIncludeSourceWithPlannerMode() throws Exception {
TargetDefinition definition = definitionWith(new WithSourceLocationStub(IncludeMode.PLANNER, TestRepositories.SOURCES, BUNDLE_WITH_SOURCES));
TargetDefinitionContent content = subject.resolveContentWithExceptions(definition);
assertThat(versionedIdsOf(content), hasItem(BUNDLE_WITH_SOURCES));
assertThat(versionedIdsOf(content), hasItem(SOURCE_BUNDLE));
assertThat(content.getUnits().size(), is(2));
}
use of org.eclipse.tycho.p2.target.facade.TargetDefinition in project tycho by eclipse.
the class TargetDefinitionResolver method resolveContentWithExceptions.
TargetDefinitionContent resolveContentWithExceptions(TargetDefinition definition) throws TargetDefinitionSyntaxException, TargetDefinitionResolutionException, ResolverException {
List<URI> artifactRepositories = new ArrayList<>();
ResolverRun resolverRun = new ResolverRun();
for (Location locationDefinition : definition.getLocations()) {
if (locationDefinition instanceof InstallableUnitLocation) {
resolverRun.addLocation((InstallableUnitLocation) locationDefinition);
for (Repository repository : ((InstallableUnitLocation) locationDefinition).getRepositories()) {
artifactRepositories.add(repository.getLocation());
}
} else {
logger.warn("Target location type '" + locationDefinition.getTypeDescription() + "' is not supported");
}
}
if (definition.hasIncludedBundles()) {
// the bundle selection list is currently not taken into account (see bug 373776)
logger.warn("De-selecting bundles in a target definition file is not supported. See http://wiki.eclipse.org/Tycho_Messages_Explained#Target_File_Include_Bundles for alternatives.");
}
return new TargetDefinitionContent(resolverRun.resolve(), artifactRepositories);
}
Aggregations