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 Feb 19, 2022
1 parent 1738f18 commit fb5e1db
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -230,12 +230,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 fb5e1db

Please sign in to comment.