Closed dmm9 closed 2 months ago
This is outside our control. We do the OSGI-OPT/src
but the other parts depend on your compiler settings. Compilers generally will copy resource in the source directory. Although they generally will not copy java files.
I doubt it. According to this post, Gradle only includes compiled classes by default:
Source here. Also documented in Gradle docs
So I guess the bnd-gradle-plugin is modifying the gradle task to include more than just the compiled classes. Does it make sense?
That could be right because Eclipse compiler is doing this so to get the same semantics we copy the resources in the source directory. However, this does not include the Java sources?
Please reopen if you want to pursue this further. As far as I am concerned I think bnd does the right thing
My bundle jar, created with the gradle plugin for bnd workspace build had not only one, but two copies of the source code. Adding
-sources: false
tobnd.bnd
only removes one of the copies of the source code.My assumption is that the gradle plugin takes the
src
param from bnd.bnd and adds all files to the jar, which is not the standard behavior of gradle. I have created my own workaround by adding build.gradle to the app folder in order to exclude all files, but I think this should be done by the bnd gradle plugin by default...Example
With the following repo:
and
Without -sources:false, the .jar has:
And with
-sources:false
, only theOSGI-OPT/src
disappears.My assumption is that the gradle plugin takes the
src
param and adds all files to the jar, which is not the standard behavior of gradle. I have created my own workaround by adding build.gradle to the app folder in order to exclude all files, but I think this should be done by the bnd gradle plugin by default...