tycho icon indicating copy to clipboard operation
tycho copied to clipboard

p2.inf is only considered if included in the binary build

Open laeubi opened this issue 2 years ago • 2 comments

p2.inf is only considered if it is part of the binary build. As the p2.inf infos are only needed to generate the P2 data it should not be necessary to include it at all.

Reproduce:

  1. create a feature project
  2. create p2.inf inside and define a property
  3. if not included in build.properties -> property is missing
  4. if included in build.properties -> property is present

laeubi avatar Jun 12 '22 15:06 laeubi

That would be welcome. I guess anyone who creates a p2.inf is bitten by this issue of "why aren't the metadata here" and then 1 hour later "damn, I forgot the build.properties...".

The reason for this at the moment is that the p2 pubisher does look for p2.inf inside the artifact it's building and Tycho relies on its default behavior on that matter. One possibility would be to have Tycho programatically generating an org.eclipse.equinox.p2.publisher.eclipse.AdviceFileAdvice when a p2.inf is found and injecting it into the publisher request programatically with IPublisherInfo.addAdvice().

mickaelistria avatar Jun 13 '22 08:06 mickaelistria

I guess anyone who creates a p2.inf is bitten by this issue of "why aren't the metadata here" and then 1 hour later "damn, I forgot the build.properties...".

Guess how I found out :-D

One possibility would be to have Tycho programatically generating an org.eclipse.equinox.p2.publisher.eclipse.AdviceFileAdvice when a p2.inf is found and injecting it into the publisher

Yep, something like that, I just wanted to open the ticket without looking at the details so it dont get lost :-)

laeubi avatar Jun 13 '22 08:06 laeubi

Thanks for opening this issue - I too was stuck as to why p2.inf with a feature was ignored for my Tycho build.

I had looked at https://github.com/eclipse-tycho/tycho/tree/master/tycho-its/projects/p2Inf.extraUnits/feature which has a p2.inf not mentioned in build.properties, so I didn't think I needed to do so.

ajohnson1 avatar Nov 23 '22 14:11 ajohnson1

@ajohnson1 Would you be interested in trying to contribute a patch?

mickaelistria avatar Nov 23 '22 14:11 mickaelistria