Skip to content

Commit

Permalink
[eclipse/xtext-core#1835] better treatment of unsupported Java versio…
Browse files Browse the repository at this point in the history
…ns in Xtext

Signed-off-by: Christian Dietrich <[email protected]>
  • Loading branch information
cdietrich committed Mar 31, 2023
1 parent c37d2db commit 7f9e7be
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -224,12 +224,16 @@ class XtextGradleBuilder implements IncrementalXtextBuilder {
attachToEmfObject(resourceSet)
language2GeneratorConfig.putAll(
gradleRequest.generatorConfigsByLanguage.mapValues [ gradleConfig |
val javaVersion = JavaVersion.fromQualifier(gradleConfig.javaSourceLevel.toString)
if (javaVersion === null) {
gradleRequest.logger.warn("Xtext does not support Java " + gradleConfig.javaSourceLevel.toString + ", falling back to " + JavaVersion.JAVA8.label)
}
new GeneratorConfig => [
generateSyntheticSuppressWarnings = gradleConfig.isGenerateSyntheticSuppressWarnings
generateGeneratedAnnotation = gradleConfig.isGenerateGeneratedAnnotation
includeDateInGeneratedAnnotation = gradleConfig.isIncludeDateInGeneratedAnnotation
includeDateInGeneratedAnnotation = gradleConfig.isIncludeDateInGeneratedAnnotation
generatedAnnotationComment = gradleConfig.generatedAnnotationComment
javaSourceVersion = JavaVersion.fromQualifier(gradleConfig.javaSourceLevel.toString)
javaSourceVersion = javaVersion ?: JavaVersion.JAVA8
]
]
)
Expand Down

0 comments on commit 7f9e7be

Please sign in to comment.