java.lang.Object
org.standardout.gradle.plugin.platform.internal.util.bnd.BndHelper

public class BndHelper extends Object
Utilities for working with bnd.
  • Constructor Details

    • BndHelper

      public BndHelper()
  • Method Details

    • createBuilder

      public static aQute.bnd.osgi.Builder createBuilder()
      Create a default builder.
    • buildAndClose

      public static void buildAndClose(aQute.bnd.osgi.Builder b, File target) throws Exception
      Build the bnd configuration present in the given builder and write the bundle to the target file.
      Parameters:
      b - the builder
      target - the target file
      Throws:
      Exception - if creating the bundle fails
    • wrap

      public static boolean wrap(File source, Collection<File> classpath, File target, Map<String,String> properties, boolean removeSignature) throws Exception
      Wrap a Jar as it is, only changing the manifest.
      Parameters:
      source - the source jar
      classpath - the class path
      target - the target file
      properties - the bnd properties
      Returns:
      if the target file was created, it will not be created if the source Jar is empty or invalid
      Throws:
      Exception - if wrapping the Jar fails
    • getSymbolicNameAndPackageImports

      public static aQute.libg.tuple.Pair<String,List<String>> getSymbolicNameAndPackageImports(File bundle) throws Exception
      Creates a Pair with the "Bundle-SymbolicName" as first value and a list of imported packages as second value of the given bundle, but without meta data like version and others .
      Parameters:
      bundle - File which is an OSGi bundle
      Returns:
      Pair containing the bundle's Bundle-SymbolicName and a list of imported packages
      Throws:
      Exception