-
Notifications
You must be signed in to change notification settings - Fork 320
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
Gradle build failure with Java 15 #1968
Comments
we currently do not support any newer source and target compatibilities than 11 |
Thanks, Christian. The reason we're interested in Java 15 is that it offers nice syntax for (multi-line) string templates similar to what Xtend offers. We want to phase out our Xtend code, but we haven't yet found a reasonable alternative. We looked at Kotlin, but its integration with Eclipse is completely broken, and the IntelliJ support for Xtext is broken also. Do you have any suggestions for alternatives we might try? |
Unfortunately there is no templating that can compete with Xtend. |
Well, yes, we can switch to Java 11, I'm aware of that. (And I noticed you're doing the same #1952.) But that will make our code generator code (currently written in Xtend) a lot less readable, which is why we were hoping to use Java 15. In Java 15, one print "Hello World" using the following code:
or
which in Kotlin would look like:
I think all of these options (which also feature indentation-friendly multi-line string blocks, not covered here) seem very reasonable alternatives to Xtend, which would look like:
Notice that the Kotlin code is even more compact than the Xtend code, and it offers inlined expressions, too...
(It would print |
Hi @lhstrh if you want to continue experimenting (using Xtext 2.26.0-SNAPSHOT):
|
or for maven users (instead of sonatype oss)
|
It turned out that the Eclipse Kotlin plugin issue that I mentioned went away after switching to Java 11. So far, it looks like Kotlin could serve as a perfect drop-in replacement for our Xtend code. However, generated language artifacts such as |
Please have a look what the new Xtext project wizard creates in more recent Xtext versions and compare it with your workflow
|
Thanks! This works! |
Java 17 Update is tracked via #1982 so i will close this one |
Building an Xtext project with Gradle fails when
build.gradle
declares source and target compatibility with Java 15.To reproduce:
build.gradle
in the parent project and specify:sourceCompatibility = '15'
andtargetCompatibility = '15'
./gradlew build
This results in the following (not very helpful) error message:
Here's the stacktrace obtained by invoking
./gradlew build --stacktrace
:The text was updated successfully, but these errors were encountered: