-
I was experimenting with PDE's new Target File support. Something like this works in the IDE:
But I doubt that will work when Tycho sees this during a build. The following works too, but only if Oomph is installed to provide/implement
Of course the above won't work in Tycho either. A relative URI is not supported either. And of course hard coding an absolute file: URI is unworkable. So the only general thing that seems to be workable in the IDE to refer to another *.target in the workspace is a platform:/resource URI, which I don't think user's will discover on their own. So all this makes me wonder if this feature is supported in Tycho and if so what form of URI can it handle? |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 5 replies
-
The location type is supported, the usual idiom is to use:
see for example https://github.com/eclipse/tycho/tree/master/tycho-its/projects/target.references/target.refs This is also what the PDE tooling suggests if you add such a target and open the drop-down for the target location (even though some more help like auto-complete for existing files would be useful). Other common ways that work across IDE/Tycho are:
I have proposed these to PDE (and corresponding Tycho ticket) but it does not got much attention:
It can handle anything that resolves to a valid URI (tycho only supports a limited set of variables) that can be transformed into an URL and that URL can produce an InputStream to read from. |
Beta Was this translation helpful? Give feedback.
-
That idiom doesn't work on Windows: Yes, I noticed PDE suggested that but on Windows a file system path doesn't look like a URI, hence the need for I did notice that an arbitrary URL works but that doesn't help me reference an target file elsewhere in the workspace (elsewhere in the clone), though it helps in that platform:/resource works as a result. But in the end, there is no reasonable solution for referring to a *.target elsewhere in the workspace, nor even within the same project (relative URI), in a way that works in the IDE and also works with Tycho. And because it doesn't work now, it's not likely to work any time soon. That makes the feature, which is really very cool, unfortunately just not useful for my intended purpose... Thanks for the quick answers! |
Beta Was this translation helpful? Give feedback.
-
The dialog shows the error I showed above with the latest PDE, so I assumed this would not work, but later the location actually works, i.e., it resolved properly, so only a bug in that the dialog should be going through the logic provided by the Gerrit changes, but it does not. But that's very good news! May I ask now the referenced |
Beta Was this translation helpful? Give feedback.
-
Very cool! This is super useful for my purposes! As a big thank you, I've opened this issue and will contribute a PR shortly: |
Beta Was this translation helpful? Give feedback.
-
FYI, via https://bugs.eclipse.org/bugs/show_bug.cgi?id=580054 I extended Oomph's targlet infrastructure to support references to other *.target files and then in the generated *.target, consumable by Tycho, I'm making use of this capability to reference another *.target file. |
Beta Was this translation helpful? Give feedback.
-
Even if you don't author targlets directly yourself, you've set up development environments that use them, so you have used them. :-P I think supporting targlets directly in Tycho would be super challenging because part of the design point is to be able to specify source locators that induce a p2 repository from the contents of bundles and features in the file system, e.g., from the contents of a git clone, and to resolve the requirements of those without needing to duplicate those requirements somewhere else. Furthermore, most users create the targlet container using targlet tasks, so there is no *.target file in the first place. So generating a Tycho-consumable *.target file is a good approach for capturing the information that is needed and already computed at development time... |
Beta Was this translation helpful? Give feedback.
The location type is supported, the usual idiom is to use:
uri="file:${project_loc:/target-platforms}/<some file relative to the project 'target-platforms'>.target"
see for example https://github.com/eclipse/tycho/tree/master/tycho-its/projects/target.references/target.refs
This is also what the PDE tooling suggests if you add such a target and open the drop-down for the target location (even though some more help like auto-complete for existing files would be useful).
Other common ways that work across IDE/Tycho are: