in ideaSupport/src/main/scala/org/jetbrains/sbtidea/tasks/IdeaConfigBuilder.scala [111:143]
private def buildSplitModeRunConfigurationXml(configurationName: String): Either[String, String] = {
val programParams = s"${options.programParams} splitMode"
val bundledJre = IntellijAwareRunner.getBundledJRE(intellijBaseDir.toPath).getOrElse {
return Left(s"Can't detect bundled JRE path in $intellijBaseDir required for IDE client")
}
// NOTE: writing client properties to the run configuration directory just for simplicity,
// to keep related configurations close to each other
val ideClientPropertiesFile = runConfigDir / "idea_client.properties"
val envVars = options.ideaRunEnv ++ Map(
"JETBRAINS_CLIENT_JDK" -> s"${bundledJre.root}",
"JETBRAINS_CLIENT_PROPERTIES" -> s"$ideClientPropertiesFile"
)
//TODO: also configure location for logs & plugins
val clientSystemPath = s"$dataDir/system_client"
val clientConfigPath = s"""$dataDir/config_client"""
val clientDebugPort = "7777"
writeToFile(ideClientPropertiesFile,
s"""-Didea.system.path=$clientSystemPath
|-Didea.config.path=$clientConfigPath
|-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:$clientDebugPort
|""".stripMargin
)
Right(buildRunConfigurationXML(
configurationName = configurationName,
vmOptions = vmOptions,
programParams = programParams,
envVars = envVars
))
}