in ideaSupport/src/main/scala/org/jetbrains/sbtidea/runIdea/IntellijVMOptionsBuilder.scala [189:251]
private def buildOld(
@nowarn("cat=deprecation")
options: IntellijVMOptions,
quoteValues: Boolean,
escapeXml: Boolean,
forTests: Boolean
): Seq[String] = {
import options.*
val intellijVersion = IntelliJVersionDetector.detectIntellijVersion(intellijDirectory.toFile)
def OQ(str: String): String =
if (quoteValues) {
if (escapeXml) str.xmlQuote else "\"" + str + "\""
} else str
val buffer = new mutable.ArrayBuffer[String]()
buffer ++= defaultOptions
val jnaFolderName = System.getProperty("os.arch") match {
case "aarch64" => "aarch64"
case _ => "amd64" //currently there are only two possible folders in `lib/jna`
}
//if the version is not detected, assume as if it's the latest
if (intellijVersion.forall(_ > Version("223.6160"))) {
val pty4jFolderPath = (intellijDirectory / "lib/pty4j").toString.replace("\\", "/")
val jnaFolderPath = (intellijDirectory / "lib/jna" / jnaFolderName).toString.replace("\\", "/")
buffer += s"-Dpty4j.preferred.native.folder=${OQ(pty4jFolderPath)}"
buffer += s"-Djna.boot.library.path=${OQ(jnaFolderPath)}"
buffer += s"-Djna.nounpack=true"
buffer += s"-Djna.nosys=true"
}
buffer += s"-Xms${xms}m"
buffer += s"-Xmx${xmx}m"
buffer += s"-XX:ReservedCodeCacheSize=${reservedCodeCacheSize}m"
buffer += s"-XX:SoftRefLRUPolicyMSPerMB=$softRefLRUPolicyMSPerMB"
buffer += gc
buffer += gcOpt
val (system, config) =
if (forTests) (ideaHome.resolve("test-system"), ideaHome.resolve("test-config"))
else (ideaHome.resolve("system"), ideaHome.resolve("config"))
buffer += s"-Didea.system.path=${OQ(system.toString)}"
buffer += s"-Didea.config.path=${OQ(config.toString)}"
val customPlugins = intellijDirectory.resolve(IdeInstallationContext.customPluginsDirName)
buffer += s"-Didea.plugins.path=${OQ(customPlugins.toString)}"
buffer += s"-Dplugin.path=${OQ(pluginPath.toString)}"
if (forTests) {
buffer += "-Didea.use.core.classloader.for.plugin.path=true"
buffer += "-Didea.force.use.core.classloader=true"
}
if (!forTests)
buffer += "-Didea.is.internal=true"
if (debug) {
val suspendValue = if (suspend) "y" else "n"
buffer += s"-agentlib:jdwp=transport=dt_socket,server=y,suspend=$suspendValue,address=$debugPort"
}
val platformPrefix = platform.platformPrefix
if (platformPrefix.nonEmpty)
buffer += s"-Didea.platform.prefix=$platformPrefix"
buffer
}