Support maven.compiler.release parameter in Xtext/Xtend Maven plugins#3607
Support maven.compiler.release parameter in Xtext/Xtend Maven plugins#3607HannesWell wants to merge 1 commit intoeclipse-xtext:mainfrom
Conversation
| <properties> | ||
| <maven.compiler.source>21</maven.compiler.source> | ||
| <maven.compiler.target>21</maven.compiler.target> | ||
| <maven.compiler.release>21</maven.compiler.release> |
There was a problem hiding this comment.
I only adapted the test-cases in this directory because I expect them to be the only ones to 'use' the changed code immediately.
Test Results 6 461 files + 1 609 6 461 suites +1 609 3h 21m 16s ⏱️ + 1h 4m 50s For more details on these failures, see this check. Results for commit d871f11. ± Comparison against base commit 99a5c22. ♻️ This comment has been updated with latest results. |
|
@cdietrich, @LorenzoBettini, @szarnekow any chance this will land in the upcoming release? |
4cdff03 to
7b56609
Compare
|
As for me, the PR is fine! I think there's an important aspect to clear: the Xtend compiler and also the Xtext maven plugin infrastructure do not really honor the semantics of "release". That is, they don't check that in the Xtend code or in an Xbase DSL code you only use Java API up to the specified release. Am I right, @szarnekow ? If that's the case, it should be clearly documented in the Javadoc and possibly in the release notes and documentation. |
That's my understanding too. At least at the moment it's implemented as basically just an alias for the source respectively source+target option in the xtend-compiler and xtext-generator mojos. On the other hand, since the Xtext/Xbase compiler receives type information from JDT and if the JDT configuration of the project is set accordingly, Xtext should just inherit that capability. So I naively assume that it's just a matter of configuring JDT accordingly. |
7b56609 to
0d2ff7a
Compare
|
For me it's fine. |
| * | ||
| * Supported values: 11, 17, 21 and so forth | ||
| */ | ||
| @Parameter(property = "maven.compiler.release", defaultValue = "11") |
There was a problem hiding this comment.
what about /org.eclipse.xtext.xtext.wizard/src/org/eclipse/xtext/xtext/wizard/ParentProjectDescriptor.xtend
There was a problem hiding this comment.
should we switch to new style there?
There was a problem hiding this comment.
release has been available since Java 9, so it might be the case to use the new style
There was a problem hiding this comment.
|
@cdietrich and @LorenzoBettini (and maybe @szarnekow), |
|
i dont have time to think how we could verify this with
|
That's a very good point. Probably it does indeed use the Java-11 default as the parameter should actually never be null.
The first and last option basically have the same out-come: If not set the target/source attributes are used and since their default is 11 too, that default is used again. |
Add support for reading the maven.compiler.release parameter and grant it precedence over a maven.compiler.source or maven.compiler.target configuration (similar to the Java compiler).
0d2ff7a to
d871f11
Compare
Add support for reading the maven.compiler.release parameter and grant it precedence over a
maven.compiler.sourceormaven.compiler.targetconfiguration (similar to the Java compiler).As suggested in