Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mainclass: Version attributes must be of type Version #4145

Merged
merged 1 commit into from
Jun 5, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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