Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[tycho-dev] Querying IUs of given p2 repo from a Mojo

Hi all,

I would like to write a Mojo for the "verify" goal which takes as input a baseline, and compare output of the module build with a baseline to tell whether the version of current module should be bumped. So far the only criterion would simply be that for bundle x.y.z, if baseline already contains x.y.z2 with z2 >= z, then build would fail or warn to remind the developer to bump the version.

[  You'll notice there that this is not the process used by Eclipse platform, as it implies that versions should be bumped systematically whereas Platform build tends to re-use artifacts as much as possible. So the use-case mentioned about is not a baseline replacement, but more a version conformance taking baseline as reference  ]

This "ValidateVersionAgainstBaselineMojo" would simply need to execute a query against the baseline repositories. However, it's not very trivial to implement such p2 related task with Tycho as such actions have to be turned into services. So far, I've found that the service which seems the closest from the ability to make queries against a p2 repo is the BaselineService. However, it is too limited as it only checks bundles that match exactly (x.y.z.qualifier equal), whereas I'd like basically to put some version range. Is there currently a way to ask for a bundle of given version range from a Mojo or should I propose a patch that adds such a method to the BaselineService? The method would look like
public Collection<IP2Artifact> getBundles(Collection<MavenRepositoryLocation> baselineLocations, String bundleId, VersionRange range);

Does this use-case make sense to you? Is there any chance that if I write such a method, it gets integrated in Tycho so I can go ahead and write a Mojo?
When I'm done with this very simple Mojo, I'd like to go a step forward and implement another Mojo that gives hints about semantic versioning, as BND does , reusing recent BND improvements and API.

Mickael Istria
Eclipse developer at JBoss, by Red Hat
My blog - My Tweets

Back to the top