Skip to content

Commit

Permalink
mainclass: Version attributes must be of type Version
Browse files Browse the repository at this point in the history
Signed-off-by: BJ Hargrave <bj@bjhargrave.com>
  • Loading branch information
bjhargrave committed Jun 5, 2020
1 parent fa75a43 commit 3bec7fd
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package aQute.bnd.osgi.resource;

import org.osgi.framework.Constants;
import org.osgi.framework.Version;
import org.osgi.framework.VersionRange;

import aQute.bnd.osgi.Domain;
Expand Down Expand Up @@ -30,9 +30,11 @@ public static void build(CapabilityBuilder mc, Domain manifest) {
mainClass = mainClass.replace('/', '.'); // yeah, it happens!

mc.addAttribute(MainClassNamespace.MAINCLASS_NAMESPACE, mainClass);
String version = manifest.get(Constants.BUNDLE_VERSION);
if (version != null)
String versionString = manifest.getBundleVersion();
if ((versionString != null) && aQute.bnd.version.Version.isVersion(versionString)) {
Version version = Version.parseVersion(versionString);
mc.addAttribute(VERSION_ATTRIBUTE, version);
}
}

public static String filter(String mainClass, VersionRange range) {
Expand Down

0 comments on commit 3bec7fd

Please sign in to comment.