[rdct] take 'JETBRAINS_CLIENT_PROPERTIES' env variable into account when starting the embedded client not via launcher (RDCT-1375)

GitOrigin-RevId: 683a76f4acdb75e6f3bdf5af9a01beca142fb873
This commit is contained in:
Nikolay Chashnikov
2024-05-22 16:45:40 +02:00
committed by intellij-monorepo-bot
parent e8b2a0958f
commit 2876ac2ae4

View File

@@ -23,6 +23,7 @@ import com.intellij.platform.runtime.product.ProductMode
import com.intellij.platform.runtime.repository.RuntimeModuleId
import com.intellij.platform.runtime.repository.RuntimeModuleRepository
import com.intellij.remoteDev.util.ProductInfo
import com.intellij.util.EnvironmentUtil
import com.intellij.util.JavaModuleOptions
import com.intellij.util.PlatformUtils
import com.intellij.util.SystemProperties
@@ -149,6 +150,7 @@ class EmbeddedClientLauncher private constructor(private val moduleRepository: R
CodeWithMeClientDownloader.createLauncherDataForMacOs(appPath)
}
else {
LOG.info("Cannot use launcher because $homePath doesn't look like a path with installation")
null
}
}
@@ -165,7 +167,11 @@ class EmbeddedClientLauncher private constructor(private val moduleRepository: R
val javaParameters = SimpleJavaParameters()
javaParameters.jdk = SimpleJavaSdkType.getInstance().createJdk("", SystemProperties.getJavaHome())
javaParameters.setShortenCommandLine(ShortenCommandLine.ARGS_FILE)
if (ApplicationManager.getApplication().isUnitTestMode || SystemProperties.getBooleanProperty(USE_CUSTOM_PATHS_PROPERTY, false)) {
val customIdeaPropertiesPath = EnvironmentUtil.getValue("JETBRAINS_CLIENT_PROPERTIES")
if (customIdeaPropertiesPath != null) {
javaParameters.vmParametersList.addProperty(PathManager.PROPERTIES_FILE, customIdeaPropertiesPath)
}
else if (ApplicationManager.getApplication().isUnitTestMode || SystemProperties.getBooleanProperty(USE_CUSTOM_PATHS_PROPERTY, false)) {
val tempDir = Path(PathManager.getTempPath()) / "embedded-client"
val configDir = tempDir / "config"
if (!configDir.exists()) {