-
Notifications
You must be signed in to change notification settings - Fork 18
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
Regex for extracting xtext version fails on actual published versions. #81
Comments
@oehme any news on this. there are more and more people stumbling on this |
I don't have time to look into this, could you fix the regex and add some unit tests? |
is there an option to specify the version explictely? |
Sure, but that's inconvenient for the user. Instead, let's just fix the regex. |
i will have a look if the mwe regex fix we recently did might be applicable here as well |
The workaround is setting xtext.version explicitly. |
do we have some list of what we expect for the version extraction???
|
Is Xtext published with different versioning schemes for different artifacts now? I assumed that the version of ui and core should be exactly the same. |
Don't know where these strange schemes come from. It seems there is Xtext ui involved in both cases. But don't know where they've got it from I thought we don't publish them since 2.11 |
Looks like here the p2 bundles are consumes https://github.com/JPL-IMCE/gov.nasa.jpl.imce.oml.core/blob/master/build.gradle |
@cdietrich FYI: we used the Mavenized repos that that Xtext CI builds to resolve Xtext dependencies. It's a fragile hack; for details, see: https://github.com/JPL-IMCE/gov.nasa.jpl.imce.oml.core/blob/master/build.gradle#L68 We switched to Tycho because there is better support for resolving against P2 and/or Maven repos; however, it isn't a whole lot better either. It would be a lot easier if everything about Xtext were published properly to both P2 & Maven repos. That way, we could use Xtext without having to use P2-specific workarounds. |
Xtext P2 Artifacts indeed have versioning like |
We're facing the same issue and have made the same observation as @NicolasRouquette. We've been using gradle to compile our command line compilers, because we lack experience with tycho; so we have to use p2 workarounds (such as p2asmaven). |
Does the workaround mentioned above work? |
I'm in a slightly different context than the reports above since this bug affects one of my own variable which ends up being inspected by the xtext gradle plugin because it appears in a mwe2 task (as in this example: https://blogs.itemis.com/en/using-xtext-with-xcore-and-gradle). But yes, changing the variable content from "2.13.0.v20171020-0732" (version published by xtext for 2.13) to "2.13.0" did workaround this bug. But then gradle fails at downloading the dependencies, which I believe was mentioned elsewhere already: https://www.eclipse.org/forums/index.php?t=msg&th=1084098&goto=1753808&#msg_1753808 (2.13.0 vs 2.13.0.vFOO mismatch). So in the end we've ended up specifying the jars explicitly like this:
i.e. we're just using gradle to download the p2 repos automatically (thanks to p2asmaven), but xtext dependency management cannot be handled gracefully. |
i dont get that. the plugin stuff (finding out the xtext version and download it) and having xtext.builder somethere (which is an eclipse plugin) are different things arent they? => can you be more explicit that you are doing? |
btw pull requests are welcome, but i cannot tell you how to fix this without breaking anything |
(@smelc speaking) Our gradle script is roughly as follows (see "xtextVersion" definition and its usages below).
But unfortunately there's no way to get it working right. If we set "xtextVersion" to 2.13 or to "2.13.0.v20171020-0920", it doesn't work. With the latter it fails with the bug detailed in this ticket; while with 2.13 it fails at finding some jars (org.eclipse.xtext.builder being the most prominent one, but there should be others). Note that we're not gradle experts, so maybe we're not doing things right; but it was working well with xtext 2.9 and things broke when updating to 2.13 (mainly because 2.9 is better published on maven centtral). Hence we started using p2asmaven to try to get things working (so that our nightly regression tests become available again). We know that our dependencies extend a bit too far in the UI (org.eclipse.xtext.builder being an example), but it's part an historical issue (we're working on it for this one) and part intended (our command line tests include quickfixes, for which we emulate part of Eclipse UI). Surely something that would help would be to have well defined maven-consumable xtext repos. |
i dont see where you set xtext version explicitely to the gradle plugin |
@cdietrich> as I said we don't use the xtext version from the xtext plugin (as the recipe from https://blogs.itemis.com/en/using-xtext-with-xcore-and-gradle doesn't apply since we don't use xcore, but simply generates our classes out of an .xtext grammar). If you're talking about the version of the gradle xtext plugin (1.0.19), it's set in the snippet below. As I've said already, we're not gradle experts; so if there's a reference way to do these things, I'll be happy to try it.
|
i simply mean: if you set it explicitely you can use for xtext dependencies you use whatever you like |
@cdietrich > oh I get your comment now. Indeed I wasn't setting xtext's version. I had in mind that the version was read from the global variable "xtextVersion", but it's "xtext.version". Setting it indeed workarounds this bug which I was hitting again in a different project. |
I've been stumped by a weird gradle dependency resolution failure:
Looking at XtendLanguageBasePlugin.automaticallyInferXtendCompilerClasspath which uses a regex version pattern matcher, I see that the problem comes from that regex:
When applied to "org.eclipse.xtext:org.eclipse.xtext.ui:2.11.1.v20170201-1233", it binds to the suffix, "1233".
For more details about this problem, see: http://stackoverflow.com/questions/43359398/gradle-fails-to-resolve-a-weird-dependency-from-a-detached-configuration
The text was updated successfully, but these errors were encountered: