Skip to content

Commit

Permalink
Use bundled runtime for the session host
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelldi committed Nov 14, 2024
1 parent f74b7cb commit e344f8b
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,14 @@

## [Unreleased]

### Fixed

- [#292](https://github.com/JetBrains/aspire-plugin/issues/292) Fix no runner found for execution type 'IDE' error

## [1.6.3] - 2024-11-13

### Fixed

- Fix resource icon when healthStatus is null

## [1.6.2] - 2024-10-30
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pluginGroup = me.rafaelldi.aspire
pluginName = aspire-plugin
pluginRepositoryUrl = https://github.com/JetBrains/aspire-plugin
# SemVer format -> https://semver.org
pluginVersion = 1.6.3
pluginVersion = 1.6.4

# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
pluginSinceBuild = 243
Expand All @@ -15,7 +15,7 @@ pluginUntilBuild = 243.*
# Release: 2020.2
# EAP: 2020.3-EAP2-SNAPSHOT
# Nightly: 2020.3-SNAPSHOT
platformVersion = 2024.3-RC1-SNAPSHOT
platformVersion = 2024.3

dotnetBuildConfiguration = Release

Expand Down
2 changes: 1 addition & 1 deletion src/dotnet/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>

<RiderSDKVersion>2024.3.0-rc01</RiderSDKVersion>
<RiderSDKVersion>2024.3.0</RiderSDKVersion>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Debug'">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.jetbrains.rider.aspire.sessionHost

import com.intellij.execution.CantRunException
import com.intellij.execution.configurations.GeneralCommandLine
import com.intellij.execution.process.KillableColoredProcessHandler
import com.intellij.execution.process.ProcessEvent
Expand All @@ -15,16 +14,15 @@ import com.intellij.openapi.project.Project
import com.intellij.openapi.rd.createNestedDisposable
import com.intellij.openapi.util.Key
import com.jetbrains.rd.util.lifetime.LifetimeDefinition
import com.jetbrains.rider.NetCoreRuntime
import com.jetbrains.rider.aspire.run.AspireHostConfig
import com.jetbrains.rider.aspire.util.decodeAnsiCommandsToString
import com.jetbrains.rider.runtime.RiderDotNetActiveRuntimeHost
import com.jetbrains.rider.runtime.dotNetCore.DotNetCoreRuntime
import java.nio.charset.StandardCharsets
import java.nio.file.Path
import kotlin.io.path.div

@Service(Service.Level.PROJECT)
class SessionHostLauncher(private val project: Project) {
class SessionHostLauncher {
companion object {
fun getInstance(project: Project) = project.service<SessionHostLauncher>()

Expand All @@ -51,10 +49,9 @@ class SessionHostLauncher(private val project: Project) {
) {
LOG.info("Starting Aspire session host")

val dotnet = RiderDotNetActiveRuntimeHost.getInstance(project).dotNetCoreRuntime.value
?: throw CantRunException("Cannot find active .NET runtime")
val dotnetCliPath = NetCoreRuntime.cliPath.value

val commandLine = getCommandLine(dotnet, aspireHostConfig, sessionHostRdPort)
val commandLine = getCommandLine(dotnetCliPath, aspireHostConfig, sessionHostRdPort)
LOG.trace("Host command line: ${commandLine.commandLineString}")

val processHandler = KillableColoredProcessHandler(commandLine)
Expand Down Expand Up @@ -87,12 +84,12 @@ class SessionHostLauncher(private val project: Project) {
}

private fun getCommandLine(
dotnet: DotNetCoreRuntime,
dotnetCliPath: String,
aspireHostConfig: AspireHostConfig,
rdPort: Int
): GeneralCommandLine {
val commandLine = GeneralCommandLine()
.withExePath(dotnet.cliExePath)
.withExePath(dotnetCliPath)
.withCharset(StandardCharsets.UTF_8)
.withParameters(hostAssemblyPath.toString())
.withWorkDirectory(hostAssemblyPath.parent.toFile())
Expand Down

0 comments on commit e344f8b

Please sign in to comment.