The Bundle-SymbolicName header can be set by the user. The default is the name of the main bnd file, or if the main bnd file is called bnd.bnd, it will be the name of the directory of the bnd file. An interesting variable is ${project} that will be set to this default name.
private void verifySymbolicName() {
Parameters bsn = parseHeader(main.get(Analyzer.BUNDLE_SYMBOLICNAME));
if (!bsn.isEmpty()) {
if (bsn.size() > 1)
error("More than one BSN specified " + bsn);
String name = bsn.keySet().iterator().next();
if (!isBsn(name)) {
error("Symbolic Name has invalid format: " + name);
}
}
}
/**
* @param name
* @return
*/
public static boolean isBsn(String name) {
return SYMBOLICNAME.matcher(name).matches();
}
public final static String SYMBOLICNAME_STRING = "[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)*";