Source

gradle-bnd-plugin /

Filename Size Date modified Message
src
14 B
2.0 KB
2.1 KB

Using gradle-bnd-plugin

Build

To build the plugin, just go to the plugin root directory and enter the command :

$ gradle jar

This should place the gradle-bnd-plugin-<version>.jar under build/libs.

Copy the same into an appropriate directory where you will install your gradle plugins (eg. ~/gradle-plugins)

Use

To use this plugin, make the following changes to your build.gradle.

a. Import

Add the following buildscript section and import statement

b. Use

Apply the plugin

apply plugin: GradleBndPlugin

c. Configure

You will need to configure the behaviour of the plugin as follows

bnd {
  condense = true // omit this or set to false if no uber jar is required to be built
  exclusions = ['groovy-all'] as Set // list of jar files (without version number or
                                     // extensions to not be included in the uberjar
                                     // in case the above condense parameter is set
                                     // to true (note: groovy-all is just a sample data)
  // note : the following are just sample data - customise as needed
  instructions = [
      'Import-Package': 'org.osgi.framework;version="[1.4,2)",*',
      'Export-Package': 'my.package.export,*',
      'Bundle-Activator':'my.package.BundleActivator',
      'Bundle-Description':'My Bundle Description',
      'Bundle-Vendor':'Vendor Name',
      'Bundle-Version':'1.0.0'
  ]
}

Profit

Have fun. Raise requests in the project issues or send me pull requests if you have some cool functionality to add.

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.