-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for Import-Package deps? #7
Comments
I've started with an implementation of this feature here. The basic functionality works, what's missing (at least for my use case) is tools for identifying and handling conflicts (e.g. when a package is provided by multiple bundles and only one should be used as dependency). How are the dependencies determined? Rather simple - an index is built over all exported packages of the bundles, which is then used to resolve candidates providing imported packages. This is based on the general assumption, that whatever you throw unpuzzle at is more or less self-contained, only dependencies in the configured sources can be found. Would be great if you can test it with your projects that rely on Import-Package. Any feedback is welcome, especially any hints on what you think needs to be done for this to make it into a pull request. |
Did a few updates and the current implementation does everything I need so far:
It's roughly documented in the README. A project using it can be found here if you are interested in an example. One thing I am unsure about is the handling of localization artifacts in respect to the artifact customization (delegating / changing group, name or version). I did not handle them yet at all in respect to that, mainly because I don't have any in my project. That's probably something to take care of to complete this. |
Hi Simon, |
@r-oldenburg No problem, I just thought if you had a use case that would be a good test. |
Hi guys. |
Hi @guai, if you want to set it up for local testing that should be fairly easy:
buildscript {
repositories {
mavenLocal()
jcenter()
}
dependencies {
classpath 'org.akhikhl.unpuzzle:unpuzzle-plugin:0.0.23-SNAPSHOT'
}
}
apply plugin: 'org.akhikhl.unpuzzle'
... See also the project where I am using it as an example. There is no need to provide any specific configuration to use the Import-Package based dependencies, just use unpuzzle like usual. |
Not great really. Some bundles become imported into maven with their full versions with build number. But other bundles export them with their short version like 1.2.3 or even 1.2 and therefore maven then cannot collect them all. |
@guai I'm not sure if I get correctly what your problem is. You just want different version numbers for the Maven artifacts generated from your bundles? |
@stempler, I'm not sure if maven can resolve version ranges in local repo. If it can then maybe version ranges should be added to metainfo, or else I see no way for maven to resolve dependencies correctly other than collect all the versions from all the paths to that particular bundle |
@guai I'm not sure where version ranges come into the picture here. My understanding is that unpuzzle generates Maven artifacts from each bundle, with the version defined in the bundle. The dependencies between the Maven artifacts are determined based in Require-Bundle and Import-Package, but the dependency version they point to is the corresponding Maven artifact version, which is a concrete version of an existing artifact (because it was created by unpuzzle). Sorry if I ask the question again, but I could not determine if your comment was a yes or a no: If so, you can achieve that, given that it is possible to derive the desired version numbers from the bundle version numbers, e.g. with something like this in the configuration: unpuzzle {
...
artifacts {
all {
def adaptVersion = { v ->
// TODO adapt version, e.g. strip qualifier
v
}
version = adaptVersion(version)
}
}
} |
@stempler, I think the problem is not in versions but in |
@guai I was wondering how unpuzzle handles creating artifacts from those (don't have those in my use cases), but if creating the artifacts works, the rest should work properly as well. Determining the dependencies is done the same way, just that the information comes from the MANIFEST.MF file in the directory, not from inside a Jar. |
@stempler, I've rechecked once again, there are actually version resolution issues in unpuzzle. You can reproduce it in eclipse mars with EMF Examples installed, try to resolve |
Hi there,
this is a great lib and even greater together with wuff as a new build tooling.
Very promising. In my current tests I stumbled across Import-Package dependencies between (Target-Platform)-Bundles.
Unpuzzle currently only create poms with "Require-Bundle" dependencies, correct?
I am sure unpuzzle will be far more usable if Import-Package would also be supported. I would even be willing to help with the implementation.
Regards and thumbs up for your already existing work!
The text was updated successfully, but these errors were encountered: