Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Oomph » Generating PDE Target Definition files for a targlet located in the workspace
Generating PDE Target Definition files for a targlet located in the workspace [message #1803707] Thu, 07 March 2019 10:03 Go to next message
Vincent Hemery is currently offline Vincent HemeryFriend
Messages: 7
Registered: April 2013
Junior Member
Hello,

I tried and successfully generated the PDE .target file from a setup targlet, as indicated in https://wiki.eclipse.org/Eclipse_Oomph_Authoring#Generating_PDE_Target_Definition_files_.28.2A.target.29_and_their_use_by_Tycho

I've also had a look at https://wiki.eclipse.org/Oomph_Targlets and am able to use a targlet-based target platform definition file located in the workspace.

I like the second approach, because it means that my target platform requirements are located in the workspace and belong to the same svn/git repo as the sources.
But with this approach, I didn't find a way to generate the P2-site .target file for using with Tycho.

Is there a way to either :

  • generate the .target file with P2 sites from the targlet-based target platform definition in the workspace ?
    This way, I no longer need the setup to worry about it and use the workspace's targlet target platform definition.
  • make the setup Modular Target point to the a targlet file in the workspace ?
    This way, I simply use the setup's Modular Target, but my requirements are described in the targlet file, versioned with the sources.


Thanks in advance for your advice.
Re: Generating PDE Target Definition files for a targlet located in the workspace [message #1803709 is a reply to message #1803707] Thu, 07 March 2019 11:06 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
How the contents of the workspace related to team repositories is completely arbitrary. I.e., there is never a need to physically locate workspace projects in a repository and it's generally never a good ideal to put the entire workspace under version control...

Is your setup itself in one of the projects that is under SVN/Git control? That's of course simple to achieve and is generally how most projects maintain their setup. Oomph targlet task uses these annotations:
<?xml version="1.0" encoding="UTF-8"?>
<base:Annotation
    xmi:version="2.0"
    xmlns:xmi="http://www.omg.org/XMI"
    xmlns:base="http://www.eclipse.org/oomph/base/1.0"
    source="http:/www.eclipse.org/oomph/targlets/TargetDefinitionGenerator">
  <detail key="location">
    <value>${git.clone.oomph.location/releng/org.eclipse.oomph.parent/tp/org.eclipse.oomph.tp.target}</value>
  </detail>
  <detail key="extraUnits">
    <value>org.eclipse.equinox.executable.feature.group</value>
  </detail>
  <detail key="singleLocation">
    <value>true</value>
  </detail>
  <detail key="includeAllPlatforms">
    <value>false</value>
  </detail>
  <detail key="includeSource">
    <value>true</value>
  </detail>
</base:Annotation>
where ${git.clone.oomph.location/releng/org.eclipse.oomph.parent/tp/org.eclipse.oomph.tp.target makes it create the file in a project that is itself imported into the workspace, i.e., the .target file is in the workspace and is under Git control.

I think this is all you need/want right?


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Generating PDE Target Definition files for a targlet located in the workspace [message #1803716 is a reply to message #1803709] Thu, 07 March 2019 13:29 Go to previous messageGo to next message
Vincent Hemery is currently offline Vincent HemeryFriend
Messages: 7
Registered: April 2013
Junior Member
My Setup file is located on a separate GIT.
Whereas my project sources and the target definition are located on an SVN (which will soon be migrated to another GIT).

I already achieved generating the .target from the setup to the project's sources. So my annotation is already in worksform.

My issue was how I may move the target requirements definition (the targlet) to the project's sources. So that whenever I switch to another project's branch or tag, I can rely on the appropriate definition, without using a different setup.

I'd like to keep 2 separated repositories, with :

  • My setup in one git, which knows nothing about the project's versions and dependencies. (I always use the master branch during checkout, but may eventually switch manually later in the workspace)
  • My project in a separate repository, along with the target platform requirements. Which may evolve from a version to another, and gets tagged at each new delivered version.



I could control the targlet definition to locate it in the project's repository, but then, that would mean the setup file (in the setup repository) points to the project's repository's head. So whenever I launch a perform Setup Tasks, target platform would be reset to the head one. Hence it would not be easy to work with older versions of the project.
Which is the reason why I was looking for a way to move the targlet itself to the workspace (or ${git.clone.location}).

A simple workaround would be to use the control described above and declare that anyone working on older versions must set the generated target platform manually and not use the Modular Target. But that would be quite painful for these cases, when I know the appropriate targlet is here in the workspace/git clone, just at reach of hand.

[Updated on: Thu, 07 March 2019 13:30]

Report message to a moderator

Re: Generating PDE Target Definition files for a targlet located in the workspace [message #1803739 is a reply to message #1803716] Fri, 08 March 2019 02:05 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
I'm not sure how you are expressing your requirements but the "best" way to use targlets is to simply reuse the requirements already present in the projects themselves. That doesn't work so well with SVN though, but with Git you can use a source locator that points at the local Git clone and use a wildcard requirement to include all projects in that clone. You'll see many examples of this in the existing project setups. If there are additional requirements not already directly expressed by the bundle and feature requirements one can use a component.ext to express those requirements, e.g., https://git.eclipse.org/c/oomph/org.eclipse.oomph.git/tree/plugins/org.eclipse.oomph.setup.core/component.ext is an example where that is used...

In general when authoring a setup it's a good idea to redirect the setup URI to its URI in the local Git clone. (There are lots of examples of this as well.) Then you can test changes to the setup locally, and also, if you check out a different branch, the setup reflects that state of that branch...


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Generating PDE Target Definition files for a targlet located in the workspace [message #1803743 is a reply to message #1803739] Fri, 08 March 2019 06:54 Go to previous message
Vincent Hemery is currently offline Vincent HemeryFriend
Messages: 7
Registered: April 2013
Junior Member
OK.
I was using the targlet as I was using the .tpd, to express the whole target platform requirements, without the Source Locator, and checkouting the sources independently.
That did not come to my mind that I could use the features from my project in the Targlet to take their dependencies dynamically without redunding them in the requirements.

Now, that makes much more sense. I'll try that as soon as I move my project sources to GIT.
Many thanks Ed.
Previous Topic:Java Code Formatter is installed but not activated
Next Topic:Execute org.eclipse.core.commands in oomph task
Goto Forum:
  


Current Time: Thu Apr 25 19:20:05 GMT 2024

Powered by FUDForum. Page generated in 0.04476 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top