use of org.eclipse.tycho.core.TargetPlatformConfiguration in project tycho by eclipse.
the class DefaultTargetPlatformConfigurationReaderTest method testExtraRequirementId.
@Test
public void testExtraRequirementId() throws Exception {
Xpp3Dom dom = createConfigurationDom("type", "versionRange");
try {
configurationReader.readExtraRequirements(new TargetPlatformConfiguration(), dom);
fail();
} catch (BuildFailureException e) {
assertTrue(e.getMessage().contains("Element <id> is missing in <extraRequirements><requirement> section."));
}
}
use of org.eclipse.tycho.core.TargetPlatformConfiguration in project tycho by eclipse.
the class DefaultTargetPlatformConfigurationReaderTest method testAddTargetWithMissingGroupInTargetDefinition.
@Test
public void testAddTargetWithMissingGroupInTargetDefinition() {
Xpp3Dom dom = createGavConfiguration(null, "myArtifactId", "myVersion");
MavenSession session = setupMockSession();
TargetPlatformConfiguration configuration = new TargetPlatformConfiguration();
try {
configurationReader.addTargetArtifact(configuration, session, null, dom);
fail();
} catch (BuildFailureException e) {
assertTrue(e.getMessage().contains("The target artifact configuration is invalid"));
}
}
use of org.eclipse.tycho.core.TargetPlatformConfiguration in project tycho by eclipse.
the class DefaultTargetPlatformConfigurationReaderTest method testAddTargetWithMissingArtifactIdInTargetDefinition.
@Test
public void testAddTargetWithMissingArtifactIdInTargetDefinition() {
Xpp3Dom dom = createGavConfiguration("myGroupId", null, "myVersion");
MavenSession session = setupMockSession();
TargetPlatformConfiguration configuration = new TargetPlatformConfiguration();
try {
configurationReader.addTargetArtifact(configuration, session, null, dom);
fail();
} catch (BuildFailureException e) {
assertTrue(e.getMessage().contains("The target artifact configuration is invalid"));
}
}
use of org.eclipse.tycho.core.TargetPlatformConfiguration in project tycho by eclipse.
the class TychoTest method testWithValidExplicitTargetEnvironment.
public void testWithValidExplicitTargetEnvironment() throws Exception {
File basedir = getBasedir("projects/explicitenvironment/valid");
List<MavenProject> projects = getSortedProjects(basedir);
assertEquals(1, projects.size());
assertEquals("valid", projects.get(0).getArtifactId());
DefaultTargetPlatformConfigurationReader resolver = lookup(DefaultTargetPlatformConfigurationReader.class);
MavenSession session = newMavenSession(projects.get(0), projects);
TargetPlatformConfiguration configuration;
List<TargetEnvironment> environments;
configuration = resolver.getTargetPlatformConfiguration(session, session.getCurrentProject());
environments = configuration.getEnvironments();
assertEquals(1, environments.size());
TargetEnvironment env = environments.get(0);
assertEquals("linux", env.getOs());
assertEquals("gtk", env.getWs());
assertEquals("arm", env.getArch());
}
use of org.eclipse.tycho.core.TargetPlatformConfiguration in project tycho by eclipse.
the class TestMojo method getExtraDependencies.
private List<Dependency> getExtraDependencies() {
final List<Dependency> dependencies = new ArrayList<>();
if (this.dependencies != null) {
dependencies.addAll(Arrays.asList(this.dependencies));
}
TargetPlatformConfiguration configuration = TychoProjectUtils.getTargetPlatformConfiguration(project);
dependencies.addAll(configuration.getDependencyResolverConfiguration().getExtraRequirements());
dependencies.addAll(getTestDependencies());
return dependencies;
}
Aggregations