Skip to content

Commit

Permalink
Merge pull request #875 from JetBrains/rival/small-fixes
Browse files Browse the repository at this point in the history
Fix small issues
  • Loading branch information
rafaelldi authored Aug 9, 2024
2 parents 131bd35 + 2233cd9 commit 4bf3490
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ fun WebAppBase.getDotNetRuntime(): DotNetRuntime {
false
)
} else {
val stack = linuxFxVersion.substringBefore('|', "DOTNET")
val stack = linuxFxVersion.substringBefore('|', "DOTNETCORE")
val version = linuxFxVersion.substringAfter('|', "8.0")
return DotNetRuntime(
com.microsoft.azure.toolkit.lib.appservice.model.OperatingSystem.LINUX,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import com.microsoft.azure.toolkit.lib.appservice.plan.AppServicePlan
import com.microsoft.azure.toolkit.lib.appservice.plan.AppServicePlanDraft
import com.microsoft.azure.toolkit.lib.common.bundle.AzureString
import com.microsoft.azure.toolkit.lib.common.exception.AzureToolkitRuntimeException
import com.microsoft.azure.toolkit.lib.common.messager.AzureMessager
import com.microsoft.azure.toolkit.lib.common.model.Region
import com.microsoft.azure.toolkit.lib.common.operation.Operation
import com.microsoft.azure.toolkit.lib.common.operation.OperationContext
Expand Down Expand Up @@ -104,7 +103,7 @@ class CreateOrUpdateDotNetFunctionAppTask(

private fun getServicePlanTask(): AzureTask<AppServicePlan>? {
if (!config.deploymentSlotName().isNullOrEmpty()) {
AzureMessager.getMessager().info("Skip updating app service plan for deployment slot")
processHandlerMessager?.info("Skip updating app service plan for deployment slot")
return null
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import com.microsoft.azure.toolkit.lib.appservice.plan.AppServicePlanDraft
import com.microsoft.azure.toolkit.lib.appservice.webapp.*
import com.microsoft.azure.toolkit.lib.common.bundle.AzureString
import com.microsoft.azure.toolkit.lib.common.exception.AzureToolkitRuntimeException
import com.microsoft.azure.toolkit.lib.common.messager.AzureMessager
import com.microsoft.azure.toolkit.lib.common.operation.Operation
import com.microsoft.azure.toolkit.lib.common.operation.OperationContext
import com.microsoft.azure.toolkit.lib.common.task.AzureTask
Expand Down Expand Up @@ -79,7 +78,7 @@ class CreateOrUpdateDotNetWebAppTask(

private fun getServicePlanTask(): AzureTask<AppServicePlan>? {
if (!config.deploymentSlotName().isNullOrEmpty()) {
AzureMessager.getMessager().info("Skip updating app service plan for deployment slot")
processHandlerMessager?.info("Skip updating app service plan for deployment slot")
return null
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,18 @@ private val netFxAppVersionRegex = Regex("\\.NETFramework,Version=v([0-9](?:\\.[

fun PublishableProjectModel.getStackAndVersion(
project: Project,
operatingSystem: OperatingSystem
operatingSystem: OperatingSystem,
isFunction: Boolean
): Pair<RuntimeStack?, NetFrameworkVersion?>? {
if (operatingSystem == OperatingSystem.DOCKER) return null

if (isDotNetCore) {
val dotnetVersion = getProjectDotNetVersion(project, this)
if (operatingSystem == OperatingSystem.LINUX) {
val stackName = if (isFunction) "DOTNET" else "DOTNETCORE"
val stack =
if (dotnetVersion != null) RuntimeStack("DOTNET", dotnetVersion)
else RuntimeStack("DOTNET", "8.0")
if (dotnetVersion != null) RuntimeStack(stackName, dotnetVersion)
else RuntimeStack(stackName, "8.0")

return stack to null
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class FunctionDeploymentState(
DotNetRuntimeConfig().apply {
os(os)
isDocker = false
val stackAndVersion = publishableProject.getStackAndVersion(project, os)
val stackAndVersion = publishableProject.getStackAndVersion(project, os, true)
stack = stackAndVersion?.first
frameworkVersion = stackAndVersion?.second
functionStack = publishableProject.getFunctionStack(project, os)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class WebAppDeploymentState(
DotNetRuntimeConfig().apply {
os(os)
isDocker = false
val stackAndVersion = publishableProject.getStackAndVersion(project, os)
val stackAndVersion = publishableProject.getStackAndVersion(project, os, false)
stack = stackAndVersion?.first
frameworkVersion = stackAndVersion?.second
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ import com.microsoft.azure.toolkit.intellij.common.messager.IntellijAzureMessage
import com.microsoft.azure.toolkit.lib.common.messager.IAzureMessage

class RiderRunProcessHandlerMessager(private val handler: RunProcessHandler) : IntellijAzureMessager() {
override fun show(raw: IAzureMessage): Boolean {
override fun show(message: IAzureMessage): Boolean {
val raw = message.rawMessage
when (raw.type) {
IAzureMessage.Type.DEBUG -> handler.println(raw.message.toString(), ProcessOutputType.SYSTEM)
IAzureMessage.Type.ERROR -> handler.println(raw.message.toString(), ProcessOutputType.STDERR)
IAzureMessage.Type.ERROR -> handler.println(raw.content, ProcessOutputType.STDERR)
else -> handler.println(raw.message.toString(), ProcessOutputType.STDOUT)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ktor = "2.3.12"
kotlin = "2.0.0"
serialization = "1.7.1"
changelog = "2.2.1"
intelliJPlatform = "2.0.0"
intelliJPlatform = "2.0.1"
qodana = "2024.1.5"
aspectj = "8.6"

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 4bf3490

Please sign in to comment.