From 2f338d3a1f9fcfe6b057ce65d03bfb5dbaeb0dec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yann=20C=C3=A9bron?= Date: Tue, 23 May 2023 16:42:02 +0200 Subject: [PATCH] IDEA-302414 2022.3 EAP SDK issue - Run configs created against a 2022.3 EAP SDK don't use the correct classpath add missing replacements GitOrigin-RevId: 89f26837c063d09055d15307e7d8f9d4ef5a759f --- plugins/devkit/devkit-core/src/run/ProductInfo.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/devkit/devkit-core/src/run/ProductInfo.kt b/plugins/devkit/devkit-core/src/run/ProductInfo.kt index 99394c7f1a72..4768ba0342f6 100644 --- a/plugins/devkit/devkit-core/src/run/ProductInfo.kt +++ b/plugins/devkit/devkit-core/src/run/ProductInfo.kt @@ -1,6 +1,7 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package org.jetbrains.idea.devkit.run +import com.intellij.openapi.application.ex.ApplicationEx import com.intellij.openapi.diagnostic.logger import com.intellij.openapi.util.SystemInfo import org.jetbrains.io.JsonReaderEx @@ -15,8 +16,8 @@ import java.nio.file.Path internal fun loadProductInfo(ideaJdkHome: String): ProductInfo? { val ideHomePath = Path.of(ideaJdkHome) val productInfoJsonPath = when { - SystemInfo.isMac -> ideHomePath.resolve("Resources/product-info.json") - else -> ideHomePath.resolve("product-info.json") + SystemInfo.isMac -> ideHomePath.resolve(ApplicationEx.PRODUCT_INFO_FILE_NAME_MAC) + else -> ideHomePath.resolve(ApplicationEx.PRODUCT_INFO_FILE_NAME) } if (Files.notExists(productInfoJsonPath)) return null @@ -29,6 +30,8 @@ internal fun loadProductInfo(ideaJdkHome: String): ProductInfo? { var additionalJvmArguments = launchMap["additionalJvmArguments"] as? MutableList ?: return null additionalJvmArguments = additionalJvmArguments.map { s: String -> s.replace("\$APP_PACKAGE", ideaJdkHome) + .replace("\$IDE_HOME", ideaJdkHome) + .replace("%IDE_HOME%", ideaJdkHome) .replace("Contents/Contents", "Contents") }.toMutableList()