Add BndManifest support for every Jar task#79
Conversation
There was a problem hiding this comment.
This looks great overall, but needs a little more work before merge.
The main problem is the interaction between multiple Jar tasks and copying their manifests to one extension.copyTo place. They're going to overwrite each other, and it's not clear what the "right" behavior is.
A second problem is that some users might be using Goomph on their main jar but not their auxiliary jars, and they will be surprised when that changes if they didn't read the changelog carefully (which they don't for a minor version bump).
One solution is if BndManifestExtension adds a boolean field applyToAllJarTasks which defaults to false. Then we can throw an error if (applyToAllJarTasks && copyTo != null). Would that workaround address your needs?
|
Thanks for your review, you brought up good points! You are right, we should not change default behavior. |
|
Just FYI, Eclipse 4.9 is releasing September 19, 2018, so I plan to cut a new release that day. Easy to cut a release before or after too, so no rush. |
- added configuration properties to configure additional tasks - added a copyFromTask property
|
i had some time and thought about a possible solution which is more generic. i have committed my proposal.
Use Cases:
I have added some checks to avoid misconfiguration like
If you have some time i would be happy to get some feedback and review for this proposal. |
nedtwigg
left a comment
There was a problem hiding this comment.
This looks great! I have only a few very minor changes to request, I'll merge and release as soon as you are ready.
src/main/java/com/diffplug/gradle/osgi/BndManifestExtension.java
Outdated
Show resolved
Hide resolved
| SourceSetOutput main = javaConvention.getSourceSets().getByName(SourceSet.MAIN_SOURCE_SET_NAME).getOutput(); | ||
| // delete empty folders so that bnd doesn't make Export-Package entries for them | ||
| StringBuilder includeresource = new StringBuilder(); | ||
| Set<String> includeresource = new HashSet<>(); |
There was a problem hiding this comment.
HashSet<> has undefined order. Previous solution had determined order. I think Bnd is sorting these, so it shouldn't matter, but safer if this is either ArrayList<> or LinkedHashSet. You call which.
src/test/java/com/diffplug/gradle/osgi/BndManifestPluginTest.java
Outdated
Show resolved
Hide resolved
|
good eye, i should definitely add some todos while changing code for debugging. |
|
Just a few changes left :) I'll merge and release as soon as you're ready. |
|
Did not have the time yet, but I will let you know when I am finished ;) |
fixed review findings
|
Hi Ned, finally added some tests and ready for review. |
|
Looks great, thanks very much! Merging and releasing. |
|
Published. |
This is a feature to support BndManifest configuration for different Jar tasks.
jarwanted)jar: