[FIR] Consider JVM_TARGET in tests
This commit is contained in:
committed by
TeamCityServer
parent
f397553e94
commit
b5ff49c903
@@ -33,6 +33,8 @@ object JvmPlatforms {
|
||||
|
||||
val jvm16: TargetPlatform = jvmTargetToJdkPlatform[JvmTarget.JVM_1_6]!!
|
||||
val jvm18: TargetPlatform = jvmTargetToJdkPlatform[JvmTarget.JVM_1_8]!!
|
||||
val jvm9: TargetPlatform = jvmTargetToJdkPlatform[JvmTarget.JVM_9]!!
|
||||
val jvm15: TargetPlatform = jvmTargetToJdkPlatform[JvmTarget.JVM_15]!!
|
||||
|
||||
fun jvmPlatformByTargetVersion(targetVersion: JvmTarget): TargetPlatform =
|
||||
jvmTargetToJdkPlatform[targetVersion]!!
|
||||
|
||||
+4
@@ -56,4 +56,8 @@ object ModuleStructureDirectives : SimpleDirectivesContainer() {
|
||||
val TARGET_PLATFORM by enumDirective<TargetPlatformEnum>(
|
||||
"Declares target platform for current module"
|
||||
)
|
||||
|
||||
val JVM_TARGET by stringDirective(
|
||||
"Declares JVM target platform for current module"
|
||||
)
|
||||
}
|
||||
|
||||
+17
@@ -236,6 +236,23 @@ class ModuleStructureExtractorImpl(
|
||||
}
|
||||
}
|
||||
}
|
||||
ModuleStructureDirectives.JVM_TARGET -> {
|
||||
if (currentModuleTargetPlatform != null) {
|
||||
assertions.fail { "Target platform already specified twice for module $currentModuleName" }
|
||||
}
|
||||
currentModuleTargetPlatform = if (values.size != 1) {
|
||||
assertions.fail { "JVM target should be single" }
|
||||
} else {
|
||||
when (values.single()) {
|
||||
"1.6" -> JvmPlatforms.jvm16
|
||||
"1.8" -> JvmPlatforms.jvm18
|
||||
"9" -> JvmPlatforms.jvm9
|
||||
"15" -> JvmPlatforms.jvm15
|
||||
else -> assertions.fail { "Incorrect value for JVM target" }
|
||||
}
|
||||
}
|
||||
return false // Workaround for FE and FIR
|
||||
}
|
||||
else -> return false
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user