TomDmitriev / gradle-bundle-plugin

Apache License 2.0
47 stars 24 forks source link

Export of the sources only from classes folder #36

Open SOVALINUX opened 8 years ago

SOVALINUX commented 8 years ago

I can be mistaken about any tricks with Export-Package in this plugin. As for me default behavior from maven-bundle-plugin and gradle osgi plugin looks very handy with exporting all packages except impl and internal under source folder. Here corresponding doc for maven http://felix.apache.org/documentation/subprojects/apache-felix-maven-bundle-plugin-bnd.html#default-behavior

May be I miss something, since I haven't read plugin sources yet

Or may be you could give me example for Export-Package except the specifying concrete package for every module?

mbelling commented 8 years ago

I am also interested in this. So far the best I have come up with is exporting the unique part of the java package compared to other modules, and it auto-exports the rest underneath. If there was a mode where it would auto-detect this like you mentioned above, that would be great.

instruction 'Export-Package', 'com.company.appName.module.*'
SOVALINUX commented 8 years ago

I understand that such approach of writing down packages is ok, however I'm working on migration about 300 bundles from maven to gradle and manual handling is not an option Hopefully I can afford merge request of this functionality if no such

TomDmitriev commented 8 years ago

One of the reasons why this plugin was developed in the first place was that there were people who were unhappy with the default behaviour of the built-in osgi plugin, particularly with the default value it sets for Export-Package, which is "*;-noimport:=false;version=" + getVersion() (see https://github.com/gradle/gradle/blob/master/subprojects/osgi/src/main/groovy/org/gradle/api/internal/plugins/osgi/DefaultOsgiManifest.java). In this plugin the same value can be set by hand.

On 11 November 2015 at 18:27, SOVALINUX notifications@github.com wrote:

I understand that such approach of writing down packages is ok, however I'm working on migration about 300 bundles from maven to gradle and manual handling is not an option Hopefully I can afford merge request of this functionality if no such

— Reply to this email directly or view it on GitHub https://github.com/TomDmitriev/gradle-bundle-plugin/issues/36#issuecomment-155815829 .

Yours sincerely, Artyom Dmitriev

SOVALINUX commented 8 years ago

Hm, looks like the trick not only in Export-Package. I think theirs analyzer.setJar(getClassesDir()); also plays significant role I still having all dependencies included in export-package and it becomes 250kb Also resulting bundle contains a lot of code included from the dependency jars