• Intro Headers Instructions Macros Commands
Fork me on GitHub
    • Getting Started
      • How to install bnd
      • Guided Tour
      • Guided Tour Workspace & Projects
      • FAQ - Frequently Asked Questions
    • Concepts and Practices
      • Introduction
      • Concepts
      • Best practices
    • Build and Development
      • Project Setup
      • Generating JARs
      • Versioning
      • Baselining
      • Service Components
      • Metatype
      • Contracts
      • Bundle Annotations
      • Accessor Properties
      • SPI Annotations
    • Dependency and Launching
      • Resolving Dependencies
      • Launching
      • Startlevels
    • Testing
      • Testing
      • Testing with Launchpad
    • Packaging and Distribution
      • Packaging Applications
      • JPMS Libraries
      • Wrapping Libraries to OSGi Bundles
    • Documentation and Tools
      • Generating Documentation
      • Commands
      • For Developers
      • Templates for Workspaces
      • Tips for Windows users
      • Tools bound to bnd
    • Reference Material
      • Reference
      • Headers
      • Instruction Reference
      • Instruction Index
      • Macro Reference
      • Macro Index
      • Plugins
      • External Plugins
    • Configuration and Troubleshooting
      • Settings
      • Errors
      • Warnings
  • -upto VERSION
    Project

    Specify the highest compatibility version, will disable any incompatible features added after this version.

    /** * This method is about compatibility. New behavior can be conditionally * introduced by calling this method and passing what version this behavior * was introduced. This allows users of bnd to set the -upto instructions to * the version that they want to be compatible with. If this instruction is * not set, we assume the latest version. */

    Version	upto	= null;
    
    public boolean since(Version introduced) {
    	if (upto == null) {
    		String uptov = getProperty(UPTO);
    		if (uptov == null) {
    			upto = Version.HIGHEST;
    			return true;
    		}
    		if (!Version.VERSION.matcher(uptov).matches()) {
    			error("The %s given version is not a version: %s", UPTO, uptov);
    			upto = Version.HIGHEST;
    			return true;
    		}
    
    		upto = new Version(uptov);
    	}
    	return upto.compareTo(introduced) >= 0;
    }
    
Search
    • Home