• Intro Headers Instructions Macros Commands
Fork me on GitHub
    • Introduction
    • How to install bnd
    • Guided Tour
    • Guided Tour Workspace & Projects
    • Concepts
    • Best practices
    • Build
    • Project Setup
    • Generating JARs
    • Versioning
    • Baselining
    • Service Components
    • Metatype
    • Contracts
    • Bundle Annotations
    • Accessor Properties
    • SPI Annotations
    • Resolving Dependencies
    • Launching
    • Startlevels
    • Testing
    • Testing with Launchpad
    • Packaging Applications
    • JPMS Libraries
    • Wrapping Libraries to OSGi Bundles
    • Generating Documentation
    • Commands
    • For Developers
    • Tips for Windows users
    • Tools bound to bnd
    • Reference
    • Headers
    • Instruction Reference
    • Instruction Index
    • Macro Reference
    • Macro Index
    • Plugins
    • External Plugins
    • Settings
    • Errors
    • Warnings
    • Frequently Asked Questions
  • Bundle-SymbolicName ::= symbolic-name ( ';' parameter ) *
    Header

    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_-]+)*";
    
    • GitHub