use of org.eclipse.tycho.p2.target.facade.TargetDefinition in project tycho by eclipse.
the class TargetDefinitionResolverIncludeSourceTest method testConflictingIncludeSourceLocations.
@Test(expected = TargetDefinitionResolutionException.class)
public void testConflictingIncludeSourceLocations() throws Exception {
TargetDefinition definition = definitionWith(new WithSourceLocationStub(null, TestRepositories.SOURCES, BUNDLE_WITH_SOURCES), new WithoutSourceLocationStub(null, TestRepositories.SOURCES));
subject.resolveContentWithExceptions(definition);
}
use of org.eclipse.tycho.p2.target.facade.TargetDefinition in project tycho by eclipse.
the class TargetDefinitionResolverIncludeSourceTest method testCanResolveBundlesWithoutSourcesWithPlannerMode.
@Test
public void testCanResolveBundlesWithoutSourcesWithPlannerMode() throws Exception {
TargetDefinition definition = definitionWith(new WithSourceLocationStub(IncludeMode.PLANNER, TestRepositories.SOURCES, BUNDLE_WITH_SOURCES, NOSOURCE_BUNDLE));
TargetDefinitionContent content = subject.resolveContentWithExceptions(definition);
assertThat(versionedIdsOf(content), hasItem(NOSOURCE_BUNDLE));
assertThat(versionedIdsOf(content), hasItem(BUNDLE_WITH_SOURCES));
assertThat(versionedIdsOf(content), hasItem(SOURCE_BUNDLE));
assertThat(content.getUnits().size(), is(3));
}
use of org.eclipse.tycho.p2.target.facade.TargetDefinition in project tycho by eclipse.
the class TargetDefinitionResolverTest method testResolveMultipleLocations.
@Test
public void testResolveMultipleLocations() throws Exception {
TargetDefinition definition = definitionWith(new LocationStub(OPTIONAL_BUNDLE), new LocationStub(REFERENCED_BUNDLE_V1));
TargetDefinitionContent units = subject.resolveContent(definition);
assertThat(versionedIdsOf(units), bagEquals(versionedIdList(REFERENCED_BUNDLE_V1, OPTIONAL_BUNDLE)));
}
use of org.eclipse.tycho.p2.target.facade.TargetDefinition in project tycho by eclipse.
the class TargetPlatformFactoryImpl method resolveTargetDefinitions.
private List<TargetDefinitionContent> resolveTargetDefinitions(TargetPlatformConfigurationStub tpConfiguration, ExecutionEnvironmentResolutionHints eeResolutionHints) {
List<TargetDefinitionContent> result = new ArrayList<>();
for (TargetDefinition definition : tpConfiguration.getTargetDefinitions()) {
if (logger.isDebugEnabled()) {
logger.debug("Adding target definition file \"" + definition.getOrigin() + "\"");
}
TargetDefinitionContent targetFileContent = targetDefinitionResolverService.getTargetDefinitionContent(definition, tpConfiguration.getEnvironments(), eeResolutionHints, remoteAgent);
result.add(targetFileContent);
if (logger.isDebugEnabled()) {
logger.debug("Added " + targetFileContent.getUnits().size() + " units, the content of the target definition file, to the target platform");
}
}
return result;
}
use of org.eclipse.tycho.p2.target.facade.TargetDefinition in project tycho by eclipse.
the class TargetDefinitionResolverTest method testResolveDependenciesAcrossLocations.
@Test
public void testResolveDependenciesAcrossLocations() throws Exception {
TargetDefinition definition = definitionWith(new LocationStub(TestRepositories.UNSATISFIED, TARGET_FEATURE), new LocationStub(TestRepositories.V1_AND_V2));
TargetDefinitionContent units = subject.resolveContent(definition);
assertThat(versionedIdsOf(units), hasItem(MAIN_BUNDLE));
assertThat(versionedIdsOf(units), hasItem(REFERENCED_BUNDLE_V1));
}
Aggregations