Search in sources :

Example 6 with TargetDefinition

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);
}
Also used : TargetDefinition(org.eclipse.tycho.p2.target.facade.TargetDefinition) Test(org.junit.Test)

Example 7 with TargetDefinition

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));
}
Also used : TargetDefinition(org.eclipse.tycho.p2.target.facade.TargetDefinition) Test(org.junit.Test)

Example 8 with TargetDefinition

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)));
}
Also used : TargetDefinition(org.eclipse.tycho.p2.target.facade.TargetDefinition) Test(org.junit.Test)

Example 9 with TargetDefinition

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;
}
Also used : ArrayList(java.util.ArrayList) TargetDefinition(org.eclipse.tycho.p2.target.facade.TargetDefinition)

Example 10 with TargetDefinition

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));
}
Also used : TargetDefinition(org.eclipse.tycho.p2.target.facade.TargetDefinition) Test(org.junit.Test)

Aggregations

TargetDefinition (org.eclipse.tycho.p2.target.facade.TargetDefinition)31 Test (org.junit.Test)30 ArrayList (java.util.ArrayList)2 IInstallableUnit (org.eclipse.equinox.p2.metadata.IInstallableUnit)2 InstallableUnitLocation (org.eclipse.tycho.p2.target.facade.TargetDefinition.InstallableUnitLocation)2 Location (org.eclipse.tycho.p2.target.facade.TargetDefinition.Location)2 URI (java.net.URI)1 IMetadataRepository (org.eclipse.equinox.p2.repository.metadata.IMetadataRepository)1 Repository (org.eclipse.tycho.p2.target.facade.TargetDefinition.Repository)1