IJent: allow using WSL JDK when building installers from the monorepo on WSL

GitOrigin-RevId: 3b872339c8dde9967973ece6e413c3cae47a3ddc
This commit is contained in:
Vladimir Lagunov
2024-08-29 09:12:42 +00:00
committed by intellij-monorepo-bot
parent d0bab98c22
commit 66ab6956bb
@@ -450,7 +450,7 @@ private suspend fun defineJavaSdk(context: CompilationContext) {
for ((sdkRef, module) in sdkReferenceToFirstModule) {
val sdkName = sdkRef.sdkName
val vendorPrefixEnd = sdkName.indexOf('-')
val sdkNameWithoutVendor = if (vendorPrefixEnd == -1) sdkName else sdkName.substring(vendorPrefixEnd + 1)
val sdkNameWithoutVendor = (if (vendorPrefixEnd == -1) sdkName else sdkName.substring(vendorPrefixEnd + 1)).removeSuffix(" (WSL)")
check(sdkNameWithoutVendor == "17") {
"Project model at ${context.paths.projectHome} [module ${module.name}] requested SDK $sdkNameWithoutVendor, " +
"but only '17' is supported as SDK in intellij project"