-
Notifications
You must be signed in to change notification settings - Fork 96
Switch to Maven/Tycho (EXPERIMENT) #2052
Comments
I started working on that in my fork, this branch https://github.com/LorenzoBettini/xtext-core/tree/lb_2052_maven_tycho For the moment org.eclipse.xtext.util and org.eclipse.xtext are compiling! I also set up a GitHub Actions workflow since I'll deal with Jenkins later. |
This is the build log https://github.com/LorenzoBettini/xtext-core/actions |
@cdietrich in xtext.ide the MANIFEST wants org.eclipse.lsp4j with at least 0.19. I can't find a p2 repo providing that. Do you know where I can find it? |
Please check Xtext.setup it contains the url |
Right! Thanks! I'm currently not using Xtext.setup and haven't thought about that. |
|
|
@cdietrich should the Xtend files be processed during the build? If so, I guess I should use the latest released version of the |
|
regarding xtend: yes we do the same with the gradle build. |
|
Build and tests are performed also on macOS and Windows |
In the current maven build script I see
I guess it's useless since the Jenkins workspace is ephemeral anyway, so I removed that. It's installing in
but it should not harm anything else... do you want to me to put it back anyway? |
i assue its there to be on the safe side, also locally |
? |
i assume its there to be on safe side also in local builds |
OK, I restored that. We have a green build on Jenkins as well :) (just Maven/Tycho, NO gradle involved at all) https://ci.eclipse.org/xtext/job/xtext-core/job/lb_2052_maven_tycho/ And the archived artifacts are there as well: https://ci.eclipse.org/xtext/job/xtext-core/job/lb_2052_maven_tycho/lastSuccessfulBuild/artifact/ If I'm not wrong, with the same layout. |
looks like there are still 7 tests missing |
OK, I'll create the WIP PR, detailing first the (temporary) manual steps to use the project from Eclipse and then, hopefully later today, I'll leave a few notes in the PR on the relevant changes and things that I think are still left to do |
I'll write a few additional details about that in the PR. |
for missing tests. might be a naming convention problem e.g. LexerSLComment |
For sure! I thought I caught them all, but that one escaped me! |
caught also other two classes that I've just renamed |
This one package org.eclipse.xtext.testing.tests.junit5;
import org.junit.platform.runner.JUnitPlatform;
import org.junit.platform.suite.api.SelectPackages;
import org.junit.platform.suite.api.UseTechnicalNames;
import org.junit.runner.RunWith;
/**
* Test suite that will pick up all Junit5 tests from the listed package and run them
* when the suite is executed with Junit4.
*/
@RunWith(JUnitPlatform.class)
@UseTechnicalNames
@SelectPackages("org.eclipse.xtext.testing.tests.junit5")
@SuppressWarnings("deprecation")
public class RunJUnit5Suite {
} is currently not executed in Eclipse either; in particular, I don't understand why we should want to do that. For example, @ExtendWith(InjectionExtension.class)
@InjectWith(InjectionExtensionNested3Test.MyInjectorProvider.class)
public class InjectionExtensionNested3Test { why do we want to do that? |
Now it's 4735 instead of 4738. |
in gradle this executes the junit5 tests from junit4 |
but then the should be run? |
yes, I spotted now that one as well, looks like
I'm trying that now... |
what is with FileAwareTestLanguageValidationJunit5Test? |
Yes, that was the culprit: all tests in .xtext.testing are now executed just like in Eclipse. |
I guess that's the one that remains to be investigated. |
Now it's 4736 instead of 4738. The two tests of FileAwareTestLanguageValidationJunit5Test are missing. In the Maven output, I see that JUnit 4 is used (while in .xtext.testing JUnit 5 was used). I'll have to investigate that (maybe tomorrow or this evening) |
Done! 4738 as before! :) It took me the whole evening to solve that, so further notes on the PR will have to wait til tomorrow. |
@LorenzoBettini Just out of curiosity: why are you switching to Maven/Tycho? We've been working with Maven/Tycho for a couple of years now, and we are actually planning to switch to Gradle at this very moment. We've had too many problems with Tycho in the past (e.g., corrupting the |
there are multiple problems with gradle
|
@cdietrich thanks for the update, that's interesting. Luckily for me, all of these problems don't apply, so that's a reassurance. :) This still means that building Xtext projects with Gradle is supported, right? |
@SimonCockx IMHO (and experience) Maven has the main feature of being ONLY a build tool, based on a simple concept of lifecycle (which can be shown in a single presentation slide) that is as rigid as possible, forcing you to do things in a single way, without any flexibility... but it also has drawbacks... ;) jokes aside, I think that's how a build tool must be. Not to mention that if you know Maven and look at any POM out there you'll immediately understand what's going on (and you know where to look at). From what I know of Gradle, you definitely cannot say that. If you also deploy Maven artifacts, you have to disable Tycho pom preprocessing, otherwise you have the problems you mention. The idea is that you can't do strange and complex things because if you try to fight Maven you'll lose. That's another great positive feature ;) Finally, if you deploy Maven projects that are meant to be also bundles and Eclipse plugins (and so you also publish p2 sites), stick with Maven/Tycho, because that's native to these mechanisms. Gradle flexibility is just a drawback, not a positive thing. Fight me ;) |
well at least when nobody shows mercy and fixes xtext/xtext-gradle-plugin#207 and xtext/xtext-gradle-plugin#203 only if you wont use any xtend at all in your codebase |
@LorenzoBettini well, if we ignore performance for a moment, for one the documentation on Gradle is fantastic, which I really can't say about Tycho. ;) Seriously though, I know there are solutions to the problems I've mentioned, but there are really no good guides explaining them, and our team lacks a person with good knowledge about it. Which is another important reason for our plan to switch to Gradle. I get your point on having too much flexibility, but as someone relatively new to Java build systems, I must say that a graph-based representation of tasks comes much more naturally to me than a (seemingly arbitrary, at least for me :) ) rigid lifecycle line. With the additional benefit of parallelization; another performance boost and less waste of precious development time! That being said, I lack experience of working with Gradle in a big project, so I'll stop fighting. Maybe in a couple of years I'll get back in the ring ;) |
@LorenzoBettini I totally agree with your mvn vs gradle argument. I have seen massively over engineered build systems built with gradle ('with great power comes the ability to screw things up'). That being said - using maven tycho has been a PITA for @SimonCockx and our team and we want to move off it. We thought that gradle was the strategic way forward but it sounds like we just need to convert out build to be pure (no tycho) mvn. |
with repo merge this is done |
As said here eclipse/xtext#2133 I'd like to try to switch to Maven/Tycho
The text was updated successfully, but these errors were encountered: