• 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
    • Headers
    • Instruction Reference
    • Instruction Index
    • Macro Reference
    • Macro Index
    • Plugins
    • External Plugins
    • Settings
    • Errors
    • Warnings
    • Frequently Asked Questions
  • -output FILE

    TODO how does this relate to -outputmask?

    /** * Calculate the output file for the given target. The strategy is: * * <pre> * parameter given if not null and not directory * if directory, this will be the output directory * based on bsn-version.jar * name of the source file if exists * Untitled-[n] * </pre> * * @param output * may be null, otherwise a file path relative to base */ public File getOutputFile(String output) {

    	if (output == null)
    		output = get(Constants.OUTPUT);
    
    	File outputDir;
    
    	if (output != null) {
    		File outputFile = getFile(output);
    		if (outputFile.isDirectory())
    			outputDir = outputFile;
    		else
    			return outputFile;
    	} else
    		outputDir = getBase();
    
    	Entry<String,Attrs> name = getBundleSymbolicName();
    	if (name != null) {
    		String bsn = name.getKey();
    		String version = getBundleVersion();
    		Version v = Version.parseVersion(version);
    		String outputName = bsn + "-" + v.getWithoutQualifier() + Constants.DEFAULT_JAR_EXTENSION;
    		return new File(outputDir, outputName);
    	}
    
    	File source = getJar().getSource();
    	if (source != null) {
    		String outputName = source.getName();
    		return new File(outputDir, outputName);
    	}
    
    	error("Cannot establish an output name from %s, nor bsn, nor source file name, using Untitled", output);
    	int n = 0;
    	File f = getFile(outputDir, "Untitled");
    	while (f.isFile()) {
    		f = getFile(outputDir, "Untitled-" + n++);
    	}
    	return f;
    }
    
    • GitHub