use of org.eclipse.tycho.artifacts.TargetPlatform in project tycho by eclipse.
the class IUXmlTransformerTest method testExpandReferences.
@Test
public void testExpandReferences() throws Exception {
subject = new IUXmlTransformer();
IU iu = IU.read(new File(TestUtil.getBasedir("projects/iuXmlValueReplacement/"), "p2iu.xml"));
TargetPlatform tp = mock(TargetPlatform.class);
when(tp.resolveArtifact("p2-installable-unit", "org.junit4", "0.0.0")).thenReturn(junit4InTP);
when(tp.resolveArtifact("p2-installable-unit", "org.hamcrest.core", "1.1.0.qualifier")).thenReturn(hamcrestInTP);
subject.replaceZerosInRequirements(iu, tp);
subject.replaceQualifierInRequirements(iu, tp);
assertThat(iu.getRequiredCapabilites(), hasItem(requirement("org.junit4", "4.8.1.v20100302")));
assertThat(iu.getRequiredCapabilites(), hasItem(requirement("org.hamcrest.core", "1.1.0.v20090501071000")));
}
use of org.eclipse.tycho.artifacts.TargetPlatform in project tycho by eclipse.
the class PackageFeatureMojo method expandVersionQualifiers.
private void expandVersionQualifiers(Feature feature) throws MojoFailureException {
feature.setVersion(DefaultReactorProject.adapt(project).getExpandedVersion());
TargetPlatform targetPlatform = TychoProjectUtils.getTargetPlatformIfAvailable(project);
if (targetPlatform == null) {
getLog().warn("Skipping version reference expansion in eclipse-feature project using the deprecated -Dtycho.targetPlatform configuration");
return;
}
featureXmlTransformer.expandReferences(feature, targetPlatform);
}
Aggregations