-
Notifications
You must be signed in to change notification settings - Fork 194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for overriding a Target Platform location from the command-line #1711
Comments
If you just want to override a location, you can define a mirror in your For real variable support there is a feature-request to enhance the target-file-format: |
Hello, I have similar need, I'd just like to use environment variable rather than system variable
Currently this does not work because TargetDefinitionFile tries to parse the string to URI directly. What we'd need is to pass the location string through TargetDefinitionResolver same as it is done e.g. for paths. I had a quick look at the sources and it seems to me this particular case (i.e. ability to use variables in repository location) could be handled by changing Would you take a PR which does this? It solves way less general problem than the proposal eclipse-pde/eclipse.pde#204 you linked above, but I think it would be a useful addition for now before that one gets implemented |
As mentioned first PDE needs to support this because otherwise the target file would be invalid. Also your example seem to indicate you wanted to actually use a different (mirror) location, therefore you can simply define a mirror in your settings.xml and use any maven supported variable replacement there. |
With the env_var eclipse seems to process the target file (almost) correctly. Content of the locations gets resolved fine, just their title in the UI is messed up I'm running
Problem with the maven mirrors replacement is the settings.xml file does not get picked up by eclipse and I'd like to be able to pick any location in there also, not only when building via mvn. Another downside of the mirror-via-settings.xml is we have around 15 different repos we wish to mirror and occasionally need to add more. With the templating approach I just add the new location into the target and given I use the correct env_var in its location it will be directed at the correct URL. With the settings.xml I need to add full new URL with matching ID into the settings.xml and everyone needs to update their environment (since settings.xml is not in git) to get the new repo mirrored correctly. If it were at least possible to pass multiple settings files into |
Okay, then we can support this as well, would be good to report the issue with the title to PDE, but you should |
Here is the PR #2421 |
I jsut see you are targeting 2.7.x branch, the best is to start at master and if that succeeds head over to probably any older branches. |
I almost have PR for master branch ready, last thing I have trouble with is how to inject into Mojos. @Mojo(name = "update-target")
public class UpdateTargetMojo extends AbstractUpdateMojo {
@Requirement
private TargetDefinitionResolverService definitionResolver; in 2.7.x I did injecting by Any hint how to do this please @laeubi ? |
For Mojo use |
well there are three places I found where I need to update the URI handling
In all three cases I pass the raw uri String throught |
At least from the initial report you want to have variable in target files (even though the sound similar that are different things to target platform), so any variable support must go into the |
Here is PR into master #2425 For now I kept the modifications to Mojos I did in the PR but if you say so I can remove them. When you say the validation mojo is outdated does that mean it would be safe for us to remove this from our build as its function has somehow been moved into other parts of tycho? I think we originally added the validation into our build as it caught some errors that otherwise bubbled up during the build much later after the initial resolution phase |
If you don't know why you use it, you should remove it :-) |
…ar and system_property variables
This is now possible and will soon appear in the snapshots, thanks @vaclavHala for taking care here. |
I'd like to be able to override the
location
of a<repository>
element in my Target Platform without resorting to text manipulations.Let's say I have this .target with:
and GEF Classic has published a new nightly build that I'd like to test against.
I'd like to be able to do something like this (from inside the GMF sources):
and get Tycho to transparently use the specified location instead of what's written in the
.target
.I know it's doable with some text rewriting prior to launching Tycho, so it's more of a nice-to-have.
The overall idea is to facilitate the kind of scenarios described in eclipse-gef/gef-classic#107 where an upstream project (here GEF Classic) would like to validate changes on their side by building/testing a downstream project (here GMF) against the result of their own PR.
Ideally, as part of their build they could clone GMF and run a complete GMF build (with tests) against the result of their build.
The text was updated successfully, but these errors were encountered: