use of org.eclipse.tycho.core.ee.shared.SystemCapability in project tycho by eclipse.
the class CustomExecutionEnvironmentTest method testOsgiEeCapabilityStrangeVersion.
@Test
public void testOsgiEeCapabilityStrangeVersion() throws Exception {
createExecutionEnvironment(new SystemCapability(Type.OSGI_EE, "JavaSE", "1.6.1"));
assertThat(customExecutionEnvironment.getProfileProperties().size(), is(3));
assertProperty(Constants.FRAMEWORK_EXECUTIONENVIRONMENT, "JavaSE-1.6.1");
assertProperty(Constants.FRAMEWORK_SYSTEMCAPABILITIES, "osgi.ee; osgi.ee=\"JavaSE\"; version:Version=\"1.6.1\"");
}
use of org.eclipse.tycho.core.ee.shared.SystemCapability in project tycho by eclipse.
the class CustomExecutionEnvironmentTest method testCDCNameMapping.
@Test
public void testCDCNameMapping() throws Exception {
createExecutionEnvironment(new SystemCapability(Type.OSGI_EE, "CDC/Foundation", "1.0"), new SystemCapability(Type.OSGI_EE, "CDC/Foundation", "1.1.0"));
assertProperty(Constants.FRAMEWORK_EXECUTIONENVIRONMENT, "CDC-1.0/Foundation-1.0,CDC-1.1/Foundation-1.1");
assertProperty(Constants.FRAMEWORK_SYSTEMCAPABILITIES, "osgi.ee; osgi.ee=\"CDC/Foundation\"; version:List<Version>=\"1.0, 1.1\"");
}
use of org.eclipse.tycho.core.ee.shared.SystemCapability in project tycho by eclipse.
the class CustomEEResolutionHandler method readCapabilities.
private List<SystemCapability> readCapabilities(IInstallableUnit specificationUnit) {
List<SystemCapability> result = new ArrayList<>();
for (IProvidedCapability capability : specificationUnit.getProvidedCapabilities()) {
String namespace = capability.getNamespace();
String name = capability.getName();
String version = capability.getVersion().toString();
if (JREAction.NAMESPACE_OSGI_EE.equals(namespace)) {
result.add(new SystemCapability(Type.OSGI_EE, name, version));
} else if (PublisherHelper.CAPABILITY_NS_JAVA_PACKAGE.equals(namespace)) {
result.add(new SystemCapability(Type.JAVA_PACKAGE, name, version));
} else {
// ignore
}
}
return result;
}
use of org.eclipse.tycho.core.ee.shared.SystemCapability in project tycho by eclipse.
the class CustomExecutionEnvironment method setSystemPackages.
private void setSystemPackages(List<SystemCapability> systemCapabilities) {
StringBuilder systemPackagesProperty = new StringBuilder();
for (SystemCapability capability : systemCapabilities) {
if (capability.getType() == Type.JAVA_PACKAGE) {
final String packageName = capability.getName();
systemPackages.add(packageName);
append(systemPackagesProperty, toPackageSpecifier(packageName, capability.getVersion()));
}
}
setPropertyIfNotEmpty(Constants.FRAMEWORK_SYSTEMPACKAGES, systemPackagesProperty);
}
use of org.eclipse.tycho.core.ee.shared.SystemCapability in project tycho by eclipse.
the class CustomExecutionEnvironmentTest method testOsgiEeCapabilityAlphanumericVersion.
@Test
public void testOsgiEeCapabilityAlphanumericVersion() throws Exception {
createExecutionEnvironment(new SystemCapability(Type.OSGI_EE, "JavaSE", "AlphaRelease.beta-245.0"));
assertThat(customExecutionEnvironment.getProfileProperties().size(), is(3));
assertProperty(Constants.FRAMEWORK_EXECUTIONENVIRONMENT, "JavaSE-AlphaRelease.beta-245.0");
assertProperty(Constants.FRAMEWORK_SYSTEMCAPABILITIES, "osgi.ee; osgi.ee=\"JavaSE\"; version:Version=\"AlphaRelease.beta-245.0\"");
}
Aggregations