Search in sources :

Example 16 with TargetEnvironment

use of org.eclipse.tycho.core.shared.TargetEnvironment in project tycho by eclipse.

the class TargetDefinitionResolverWithPlatformSpecificUnitsTest method testPlannerResolutionWithMultiplePlatforms.

@Test
public void testPlannerResolutionWithMultiplePlatforms() throws Exception {
    List<TargetEnvironment> environments = Arrays.asList(new TargetEnvironment("linux", "gtk", "x86_64"), new TargetEnvironment("win32", "win32", "x86"), new TargetEnvironment("macosx", "carbon", "x86"));
    targetDefinition = definitionWith(new FilterRepoLocationStubWithLauncherUnit(IncludeMode.PLANNER));
    subject = createResolver(environments);
    TargetDefinitionContent units = subject.resolveContent(targetDefinition);
    assertThat(versionedIdsOf(units), bagEquals(versionedIdList(LAUNCHER_FEATURE, LAUNCHER_FEATURE_JAR, LAUNCHER_BUNDLE, LAUNCHER_BUNDLE_LINUX, LAUNCHER_BUNDLE_WINDOWS, LAUNCHER_BUNDLE_MAC)));
}
Also used : TargetEnvironment(org.eclipse.tycho.core.shared.TargetEnvironment) Test(org.junit.Test)

Example 17 with TargetEnvironment

use of org.eclipse.tycho.core.shared.TargetEnvironment in project tycho by eclipse.

the class TargetDefinitionResolverWithPlatformSpecificUnitsTest method testConflictingIncludeAllEnvironments.

@Test(expected = TargetDefinitionResolutionException.class)
public void testConflictingIncludeAllEnvironments() throws Exception {
    targetDefinition = definitionWith(new FilterRepoLocationStubWithLauncherUnit(IncludeMode.SLICER, true), new FilterRepoLocationStubWithLauncherUnit(IncludeMode.SLICER, false));
    subject = createResolver(Collections.singletonList(new TargetEnvironment(null, null, null)));
    subject.resolveContentWithExceptions(targetDefinition);
}
Also used : TargetEnvironment(org.eclipse.tycho.core.shared.TargetEnvironment) Test(org.junit.Test)

Example 18 with TargetEnvironment

use of org.eclipse.tycho.core.shared.TargetEnvironment in project tycho by eclipse.

the class TargetDefinitionResolverWithPlatformSpecificUnitsTest method testSlicerResolutionWithIncludeAllEnvironments.

@Test
public void testSlicerResolutionWithIncludeAllEnvironments() throws Exception {
    TargetEnvironment environment = new TargetEnvironment("gtk", "linux", "x86_64");
    targetDefinition = definitionWith(new FilterRepoLocationStubWithLauncherUnit(IncludeMode.SLICER, true));
    subject = createResolver(Collections.singletonList(environment));
    TargetDefinitionContent units = subject.resolveContent(targetDefinition);
    assertThat(versionedIdsOf(units), bagEquals(versionedIdList(LAUNCHER_FEATURE, LAUNCHER_FEATURE_JAR, LAUNCHER_BUNDLE, LAUNCHER_BUNDLE_LINUX, LAUNCHER_BUNDLE_WINDOWS, LAUNCHER_BUNDLE_MAC)));
}
Also used : TargetEnvironment(org.eclipse.tycho.core.shared.TargetEnvironment) Test(org.junit.Test)

Example 19 with TargetEnvironment

use of org.eclipse.tycho.core.shared.TargetEnvironment in project tycho by eclipse.

the class TargetDefinitionResolverWithPlatformSpecificUnitsTest method testSlicerResolutionWithOnePlatform.

@Test
public void testSlicerResolutionWithOnePlatform() throws Exception {
    TargetEnvironment environment = new TargetEnvironment("linux", "gtk", "x86_64");
    targetDefinition = definitionWith(new FilterRepoLocationStubWithLauncherUnit(IncludeMode.SLICER));
    subject = createResolver(Collections.singletonList(environment));
    TargetDefinitionContent units = subject.resolveContent(targetDefinition);
    assertThat(versionedIdsOf(units), bagEquals(versionedIdList(LAUNCHER_FEATURE, LAUNCHER_FEATURE_JAR, LAUNCHER_BUNDLE, LAUNCHER_BUNDLE_LINUX)));
}
Also used : TargetEnvironment(org.eclipse.tycho.core.shared.TargetEnvironment) Test(org.junit.Test)

Example 20 with TargetEnvironment

use of org.eclipse.tycho.core.shared.TargetEnvironment in project tycho by eclipse.

the class TargetDefinitionResolverWithPlatformSpecificUnitsTest method testResolutionWithGenericPlatform.

@Test
public void testResolutionWithGenericPlatform() throws Exception {
    targetDefinition = definitionWith(new FilterRepoLocationStubWithLauncherUnit(IncludeMode.PLANNER));
    subject = createResolver(Collections.singletonList(new TargetEnvironment(null, null, null)));
    TargetDefinitionContent units = subject.resolveContent(targetDefinition);
    assertThat(versionedIdsOf(units), bagEquals(versionedIdList(LAUNCHER_FEATURE, LAUNCHER_FEATURE_JAR, LAUNCHER_BUNDLE)));
}
Also used : TargetEnvironment(org.eclipse.tycho.core.shared.TargetEnvironment) Test(org.junit.Test)

Aggregations

TargetEnvironment (org.eclipse.tycho.core.shared.TargetEnvironment)38 Test (org.junit.Test)14 File (java.io.File)10 ArrayList (java.util.ArrayList)6 TargetPlatformConfiguration (org.eclipse.tycho.core.TargetPlatformConfiguration)6 HashMap (java.util.HashMap)4 LinkedHashMap (java.util.LinkedHashMap)3 LinkedHashSet (java.util.LinkedHashSet)3 MojoExecutionException (org.apache.maven.plugin.MojoExecutionException)3 MojoFailureException (org.apache.maven.plugin.MojoFailureException)3 Xpp3Dom (org.codehaus.plexus.util.xml.Xpp3Dom)3 P2ResolutionResult (org.eclipse.tycho.p2.resolver.facade.P2ResolutionResult)3 IOException (java.io.IOException)2 Map (java.util.Map)2 Properties (java.util.Properties)2 MavenSession (org.apache.maven.execution.MavenSession)2 MavenProject (org.apache.maven.project.MavenProject)2 ArtifactDescriptor (org.eclipse.tycho.ArtifactDescriptor)2 ArtifactKey (org.eclipse.tycho.ArtifactKey)2 ReactorProject (org.eclipse.tycho.ReactorProject)2