tycho icon indicating copy to clipboard operation
tycho copied to clipboard

Support autoIncludeRequirements="true/false" in products

Open laeubi opened this issue 3 years ago • 3 comments

PDE has a new flag autoIncludeRequirements Tycho should respect that flag when building products.

I think this requires probably updates in P2 or we have a ProductFile2 that might be used as an incubator.

@HannesWell do you like to take a look at the Tycho/P2 stuff or at least provide an integration-test to demonstrate the new feature and the expected outcomes?

laeubi avatar Jun 21 '22 05:06 laeubi

What's the effect of that flag? Tycho always include requirements for a product, doesn't it?

mickaelistria avatar Jun 21 '22 08:06 mickaelistria

What's the effect of that flag? Tycho always include requirements for a product, doesn't it?

Product could have (intentionally or by accident) "missing" requirements and you can have feature based products that do not fulfill the requirements of all bundles the include without a problem.

The flag controls if a product should include "what ever is required" or not by adding additional bundles to the product run/build.

laeubi avatar Jun 21 '22 08:06 laeubi

To track required work on that I have already opened https://github.com/eclipse-equinox/p2/issues/76.

What's the effect of that flag? Tycho always include requirements for a product, doesn't it?

Exactly that's what P2/Tycho does. The option would allow to disable that.

@HannesWell do you like to take a look at the Tycho/P2 stuff or at least provide an integration-test to demonstrate the new feature and the expected outcomes?

At the moment that has only very low priority for me since I only need autoIncludeRequirements=true which is what's done already. I can provide an integration test later, but if somebody else wants to do it before it is actually quite straight forward:

  • For Plug-in based products, add one plug-in that requires another one (via Require-Bundle or Import-Package) and don't include that and check that it is installed into the product or not depending on the flag.
  • For Feature based products basically do the same for Features and Plugins. Add a Feature to the product that includes one Plugin (and maybe another Feature) and requires third Feature and third Plugin not included in the Feature, which is included in the Plugin. The Plugin included in the Feature that is included in the Product can also have a requirement to a fourth Plug-in that is included in no feature at all. Then check again if all required or only included Plug-ins are installed depending on the value of autoIncludeRequirements.

There are many test cases in PDE for launching that should cover all aspects:

Looking at the testGetMergedBundleMap_automaticallyAddRequirements in both classes should be a good inspiration.

HannesWell avatar Jun 21 '22 08:06 HannesWell