• 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
  • -output FILE
    Analyzer

    Specify the output directory or 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;
    }
    
Search
    • Home