if (!bpInfo.providesPackage(packageName)) {
log("Exported package not provided by bundle: " +packageName,
Project.MSG_WARN);
}
// The Version from the packageinfo-file or null
final Version piVersion =
bpInfo.getProvidedPackageVersion(packageName);
if (null!=piVersion) {
final String epVersionS = (String) exportPackage.get(packageName);
if (null==epVersionS) {
// Use the version form the packageinfo-file
exportPackage.put(packageName, piVersion.toString());
} else {
// Check that the versions match, if not trigger a build error
try {
final Version epVersion = Version.parseVersion(epVersionS);
if (0!=epVersion.compareTo(piVersion)) {
final String msg = "Multiple versions found for export of "
+"the package '" +packageName
+"'. The packageinfo file ("
+bpInfo.getProvidedPackageVersionSource(packageName)
+") states '" +piVersion.toString()
+"' but the <exportpackage> element says '"
+epVersion.toString() +"'.";
log(msg, Project.MSG_ERR);
throw new BuildException(msg);
}
} catch (IllegalArgumentException iae) {
final String msg = "Invalid version '" +epVersionS