In general you find the interesting stuff in aQute.lib.osgi.*. Look at the test cases for how the API can be used.
Builder b = new Builder(); b.setProperty( EXPORT_PACKAGE, “org.osgi.framework” ); b.addClasspath( new File(“jar/osgi.jar”) );
Jar jar = b.build(); Manifest m = jar.getManifest(); jar.write( new File(b.getBsn()+”.jar”));