Git Product home page Git Product logo

Comments (2)

stempler avatar stempler commented on August 24, 2024

Generally the merge right now just checks all artifacts available if they should be included, based on the condition you provide in the closure.

The feature instruction serves only for the purpose to define which bundles should be included. It does not have any other effect.

In match you have the artifact, but you don't have any information there about what depends on this artifact. So if that information is not added there, I don't see an obvious way to handle that there with the current API.

One way to solve this would be to support this where the actual selection which artifacts are merged takes place. The configuration for the merge could probably be extended to add an option to include dependencies for a bundle.

Another way could be to do some preprocessing beforehand. Including all dependencies to a bundle also in one Jar sounds very much like what the Shadow Jar plugin would do. There you also have the option to rename packages which could help avoiding conflicts if you have these dependencies included somewhere else as well. So here would be the approach to create the Jar in another task and add the already merged Jar instead. If you let the bundles task depend on that task, it is ensured that the merged Jar is created early enough.

from bnd-platform.

qqilihq avatar qqilihq commented on August 24, 2024

Thank you once more for your very helpful feedback, Simon!

I had a look at the Shadow plugin, which looked helpful at first glance. But unfortunately it currently does not support creating source bundles (at least out of the box), as highlighted in this issue. And having the sources at hand was one of the many reasons which made me switch from my own (half baked) bundling solution to bnd-platform.

What I did at the end, was splitting up my bnd-platform gradle project into three sub projects:

  • sub project A creates an “uber” bundle for A’s entire dependency tree, by simply applying setting match { true }
  • sub project B creates the individual bundles (for those, the OSGi resolution black magic works fine, so no need to merge them)
  • finally, sub project updatesite pulls the bundles together using bundle fileTree(dir: '../A/build/plugins') and bundle fileTree(dir: '../B/build/plugins') and builds the update site

In the root’s build.grade I’ve defined a task to execute all the steps conveniently:

task create {
  dependsOn ':projectA:bundles'
  dependsOn ':projectB:bundles'
  dependsOn ':updatesite:updateSite'
}

This seems to work very fine so far, and I can entirely rely on the (awesome) bnd-platform plugin! In case of any improvement suggestions feel free to let me know!

from bnd-platform.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.