def launchFor()

in ideaSupport/src/main/scala/org/jetbrains/sbtidea/productInfo/ProductInfo.scala [38:64]


  def launchFor(jbrPlatform: JbrPlatform): Launch = {
    val os = jbrPlatform.os
    val arch = jbrPlatform.arch

    val archInProductFormat = arch match {
      case JbrPlatform.Arch.x64 => "amd64"
      case JbrPlatform.Arch.aarch6 => "aarch64"
      case other =>
        throw new IllegalArgumentException(s"Unsupported JVM architecture: '$other'")
    }

    val osInProductFormat = os match {
      case  JbrPlatform.Os.windows => OS.Windows
      case  JbrPlatform.Os.linux => OS.Linux
      case  JbrPlatform.Os.osx => OS.macOs
      case other =>
        throw new IllegalArgumentException(s"Unsupported OS: $other")
    }

    val foundLaunch = launch.find(l => l.os == osInProductFormat && l.arch == archInProductFormat)
    foundLaunch.getOrElse {
      throw new IllegalArgumentException(
        s"""Could not find launch information for the OS: '$os' ($arch).
           |Available OS/architectures:
           |${launch.map(l => (l.os, l.arch)).mkString("\n")}""".stripMargin)
    }
  }