It depends. One important bit boils down to what level of 'accuracy'
you wish to have in your OSGi Manifest. I have found from experience
that it is unwise to try to have algorithmic resolution of the Imports
and Exports, and instead it is better to maintain it manually, but
have BND report 'missing' and 'superfluous' references.
In my multi-module build, where a large number of plugins follows a
naming convention, I have ended up with;
Top level;
jar {
manifest {
license = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
docURL = 'http://www.qi4j.org'
description = 'Qi4j is a platform for Composite Oriented Programming'
vendor = 'Qi4j Community, http://www.qi4j.org'
}
}
Each Project;
jar {
manifest {
name = "Qi4j Core Runtime"
instruction 'Private-Package',
'org.qi4j.runtime;version=' + version,
'org.qi4j.runtime.bootstrap;version=' + version,
'org.qi4j.runtime.composite;version=' + version
instruction 'Import-Package',
'org.qi4j.api.composite;version=' + version
:
(and applying the 'osgi' plugin)
Now, if you care less, then you can instruct BND to "import all I
might need" and "export all I have", which will give you something
that is likely to work, but not necessarily appreciated by your
users... For instance; upstream dependencies won't have good version
ranges.
HTH
Niclas
On Sun, Feb 27, 2011 at 4:44 PM, Russel Winder <[email protected]> wrote:
> I am not sure I have seen anything in the documentation which answers
> this question, apologies if I missed it.
>
> Context: a project with multiple artefacts each managed by a separate
> project, with all the project specification in a single top-level Gradle
> file. Building the OSGi manifest for each of the projects is
> parameterizable as the structure and fundamental content is identical.
>
> What is the idiomatic way of creating a single bit of code for this to
> obviate the need to replicate the OSGi manifest specification in each
> project specification?
>
> Thanks.
> --
> Russel.
> =============================================================================
> Dr Russel Winder t: +44 20 7585 2200 voip: sip:[email protected]
> 41 Buckmaster Road m: +44 7770 465 077 xmpp: [email protected]
> London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
>
--
Niclas Hedhman, Software Developer
http://www.qi4j.org - New Energy for Java
I live here; http://tinyurl.com/3xugrbk
I work here; http://tinyurl.com/24svnvk
I relax here; http://tinyurl.com/2cgsug
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email