I'm wanting to make use of bnd baselining for an existing java project not originally developed using bnd/bndtools.
At the same time, I want to make the jar I am building a "proper" OSGi bundle.
So I'm trying to manually set up gradle and bnd to build the project, and then do the baselining.
I have got gradle and the bnd plugin set up to the point that it builds me a bundle, and is reading in the bnd.bnd file and clearly making of of:
Bundle-Version
Bundle-SymbolicName
Export-Package
etc
There are two bits that I'm stuck on though.
First is that I don't seem to be able to "release" from a "non-workspace" build.
"Workspace builds"
section but not the
"non-workspace builds"
section.
The other problem I've got is that I don't appear to be able to make it attempt to do any baselining.
I am using the "plugin" method, so my gradle file is essentially:
apply plugin: 'biz.aQute.bnd.builder'
sourceSets {
main {
java {
srcDirs = ['src']
}
}
}
repositories {
mavenCentral()
}
dependencies {
compile 'javax.websocket:javax.websocket-api:1.0'
}
In my bnd.bnd file I have:
-baseline:*
-baselinerepo:Release
-plugin.repo.main: aQute.bnd.repository.maven.provider.MavenBndRepository; releaseUrl=...; snapshotUrl=...; name=Release;
I can't see any evidence of it attempting to perform a baseline when I run
gradle baseline
Removing the "-baselinerepo:", changing it to "-baselinerepo:garbage", using "-releaserepo" instead etc (documentation is inconsistent on whether it's 'baselinerep', 'baselinerepo', or 'baselinerepository'), I can't get it to give me any indication that it's actually performing a baselineing operation.
If I do it the "manual" way, copying the "Create a task of the Baseline type" example in the README, then it does appear to make some attempt to contact a repository and tells me it can't find anything (not surprising, as it's trying to contact maven to find a version of my bundle). It doesn't do this though if I use the "plugin" instead.
The README gives me every indication that using the "apply the plugin" method and indeed I get a "baseline" task that I can run, but I'm obviously needing to supply some extra configuration or something to make it do anything useful?
Any suggestions?
Thanks.