Discussion:
[tycho-user] generate target file from p2 target
Berryman, Eric
2017-12-21 16:07:45 UTC
Permalink
Hello!


Is it possible to; define a p2 url as a repository, and output a target file which "locks" in the build dependencies, which others build against?

ie. state in profile:
<repository>
<id>eclipse-updates</id>
<url>${eclipse-update-site}</url>
<layout>p2</layout>
</repository>

then, output target which another profile builds against.

For example, like the NPM package lock works.

Thank you!
Eric
Mickael Istria
2017-12-21 16:21:52 UTC
Permalink
Hi,

If you want the content of a .target file to be "locked", you'd better use
the slicer mode rather than the planner. This would enforce your .target to
list all dependencies instead of relying on dependency resolution (and its
variability).
Once you have slicer, you can specify the versions so you'll be almost 100%
sure about resolution being reproducible.
The target-platform-validation-plugin in tycho-extras provides some
analysis of a .target file to help you identifying and fixing
inconsistencies in your .target

For JBoss Tools, we have a couple of mojos to manipulate .target files and
ensure more stability:
* mirror-target-to-repo: takes a .target file, make a p2 repo from it with
the versions
* fix-versions-mojo: replaces 0.0.0 by the resolved versions
See
https://github.com/jbosstools/jbosstools-maven-plugins/tree/master/tycho-plugins/target-platform-utils/src/main/java/org/jboss/tools/tycho/targets

HTH,
Berryman, Eric
2017-12-21 16:37:03 UTC
Permalink
Thank you,

Maybe I'm misunderstanding, but I would like to produce a target file from the p2 resolution used for the build. This would be very nice.


On Dec 21, 2017 11:22, Mickael Istria <***@redhat.com> wrote:
Hi,

If you want the content of a .target file to be "locked", you'd better use the slicer mode rather than the planner. This would enforce your .target to list all dependencies instead of relying on dependency resolution (and its variability).
Once you have slicer, you can specify the versions so you'll be almost 100% sure about resolution being reproducible.
The target-platform-validation-plugin in tycho-extras provides some analysis of a .target file to help you identifying and fixing inconsistencies in your .target

For JBoss Tools, we have a couple of mojos to manipulate .target files and ensure more stability:
* mirror-target-to-repo: takes a .target file, make a p2 repo from it with the versions
* fix-versions-mojo: replaces 0.0.0 by the resolved versions
See https://github.com/jbosstools/jbosstools-maven-plugins/tree/master/tycho-plugins/target-platform-utils/src/main/java/org/jboss/tools/tycho/targets

HTH,
Mickael Istria
2017-12-21 16:39:14 UTC
Permalink
Ah ok. Sorry, I'm the one who didn't understand ;)
Berryman, Eric
2017-12-21 18:10:07 UTC
Permalink
Where does Tycho store this information during the build? Maybe I could write something to do this, but I don't see where this information kept.

Thank you!
Eric

On Dec 21, 2017 11:39, Mickael Istria <***@redhat.com> wrote:
Ah ok. Sorry, I'm the one who didn't understand ;)
Nick Boldt
2017-12-21 20:29:21 UTC
Permalink
Rather than starting with a <repository>, why not start with a .target file
like the one we use for JBoss Tools?

https://github.com/jbosstools/jbosstools-target-platforms/blob/4.72.x/jbosstools/multiple/jbosstools-multiple.target

Then you can define the URLs and IUs you want, and use the tool Mickael
mentioned to automatically IU versions it when you manually update URLs.

Here's how you run the automatic update script, using the JBoss Tools
target platform as an example:

https://github.com/jbosstools/jbosstools-devdoc/blob/master/building/target_platforms/target_platforms_updates.adoc#update-versions-of-ius-in-the-target-files

Nick
Post by Berryman, Eric
Where does Tycho store this information during the build? Maybe I could
write something to do this, but I don't see where this information kept.
Thank you!
Eric
Ah ok. Sorry, I'm the one who didn't understand ;)
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
--
Nick Boldt :: http://nick.divbyzero.com
FB, IG, Twitter, G+, LinkedIn, Freenode: @nickboldt
WhatsApp: +1 647 899 9879
Loading...