use of org.eclipse.tycho.core.ee.EEVersion.EEType in project tycho by eclipse.
the class StandardExecutionEnvironment method parseEEVersion.
private EEVersion parseEEVersion(String systemCaps) {
List<EEVersion> eeVersions = new ArrayList<>();
try {
ManifestElement[] systemCapValues = ManifestElement.parseHeader("org.osgi.framework.system.capabilities", systemCaps);
for (int i = 0; i < systemCapValues.length; i++) {
Version version;
String singleVersion = systemCapValues[i].getAttribute("version:Version");
if (singleVersion != null) {
version = Version.parseVersion(singleVersion);
} else {
String[] versions = systemCapValues[i].getAttribute("version:List<Version>").split(",");
List<Version> osgiVersions = new ArrayList<>(versions.length);
for (String currentVersion : versions) {
osgiVersions.add(Version.parseVersion(currentVersion));
}
version = Collections.max(osgiVersions);
}
String execEnv = systemCapValues[i].getAttribute("osgi.ee");
EEType eeType = EEType.fromName(execEnv);
if (eeType != null) {
eeVersions.add(new EEVersion(version, eeType));
}
}
return Collections.max(eeVersions);
} catch (BundleException e) {
throw new RuntimeException(e);
}
}
Aggregations