diff --git a/components/ide/jetbrains/toolbox/BUILD.yaml b/components/ide/jetbrains/toolbox/BUILD.yaml new file mode 100644 index 00000000000000..2284e3a76d1a7a --- /dev/null +++ b/components/ide/jetbrains/toolbox/BUILD.yaml @@ -0,0 +1,30 @@ +packages: + - name: plugin-stable + type: generic + deps: + - components/supervisor-api/java:lib + - components/public-api/java:lib + srcs: + - "**/*.kt" + - "**/*.kts" + - src/main/resources/* + - gradle.properties + - gradlew + - gradle/* + - build.sh + env: + - JB_QUALIFIER=stable + - SDKMAN_DIR=/home/gitpod/.sdkman + config: + commands: + - - "bash" + - "-c" + - > + echo java=21.0.3.fx-zulu > .sdkmanrc + && source "$SDKMAN_DIR/bin/sdkman-init.sh" + && sdk env install + && ./build.sh "0.0.1-${version}" + && mv ./build/distributions/io.gitpod.toolbox.gateway.zip .toolbox.zip + && rm -rf * + && rm -rf .gradle .kotlin .sdkmanrc + && mv .toolbox.zip toolbox.zip diff --git a/components/ide/jetbrains/toolbox/build.gradle.kts b/components/ide/jetbrains/toolbox/build.gradle.kts index c3f02c4b64e150..ca6d994ef43969 100644 --- a/components/ide/jetbrains/toolbox/build.gradle.kts +++ b/components/ide/jetbrains/toolbox/build.gradle.kts @@ -7,14 +7,18 @@ import com.github.jk1.license.render.JsonReportRenderer import org.jetbrains.kotlin.com.intellij.openapi.util.SystemInfoRt import org.jetbrains.kotlin.gradle.dsl.JvmTarget import java.nio.file.Path +import java.time.LocalDateTime +import java.time.format.DateTimeFormatter import kotlin.io.path.div + plugins { alias(libs.plugins.kotlin) alias(libs.plugins.serialization) `java-library` alias(libs.plugins.dependency.license.report) id("com.github.johnrengelman.shadow") version "8.1.1" + alias(libs.plugins.gradle.wrapper) } buildscript { @@ -25,7 +29,17 @@ buildscript { repositories { mavenCentral() - maven("https://packages.jetbrains.team/maven/p/tbx/gateway") + maven("https://packages.jetbrains.team/maven/p/tbx/toolbox-api") +} + +jvmWrapper { + unixJvmInstallDir = "jvm" + winJvmInstallDir = "jvm" + linuxAarch64JvmUrl = "https://cache-redirector.jetbrains.com/intellij-jbr/jbr_jcef-21.0.5-linux-aarch64-b631.28.tar.gz" + linuxX64JvmUrl = "https://cache-redirector.jetbrains.com/intellij-jbr/jbr_jcef-21.0.5-linux-x64-b631.28.tar.gz" + macAarch64JvmUrl = "https://cache-redirector.jetbrains.com/intellij-jbr/jbr_jcef-21.0.5-osx-aarch64-b631.28.tar.gz" + macX64JvmUrl = "https://cache-redirector.jetbrains.com/intellij-jbr/jbr_jcef-21.0.5-osx-x64-b631.28.tar.gz" + windowsX64JvmUrl = "https://cache-redirector.jetbrains.com/intellij-jbr/jbr_jcef-21.0.5-windows-x64-b631.28.tar.gz" } dependencies { @@ -47,16 +61,19 @@ dependencies { // RD-Core https://mvnrepository.com/artifact/com.jetbrains.rd/rd-core implementation("com.jetbrains.rd:rd-core:2024.1.1") - implementation(libs.gateway.api) + compileOnly(libs.bundles.toolbox.plugin.api) +// implementation(libs.gateway.api) implementation(libs.slf4j) implementation(libs.bundles.serialization) implementation(libs.coroutines.core) implementation(libs.okhttp) } - val pluginId = "io.gitpod.toolbox.gateway" -val pluginVersion = "0.0.1-dev" +val defaultVersion = "0.0.1-local-${LocalDateTime.now().format(DateTimeFormatter.ofPattern("MMddHHmm"))}" +val pluginVersion = providers.gradleProperty("pluginVersion").map { it.ifBlank { defaultVersion } }.getOrElse(defaultVersion) + +println("Plugin version: $pluginVersion") tasks.shadowJar { archiveBaseName.set(pluginId) @@ -156,6 +173,7 @@ val copyPlugin by tasks.creating(Sync::class.java) { include("extension.json") include("dependencies.json") include("icon.svg") + include("icon-gray.svg") } into(targetDir) @@ -173,9 +191,10 @@ val pluginZip by tasks.creating(Zip::class) { } from("src/main/resources") { include("icon.svg") + include("icon-gray.svg") rename("icon.svg", "pluginIcon.svg") } - archiveBaseName.set("$pluginId-$pluginVersion") + archiveBaseName.set(pluginId) } val uploadPlugin by tasks.creating { diff --git a/components/ide/jetbrains/toolbox/build.sh b/components/ide/jetbrains/toolbox/build.sh new file mode 100755 index 00000000000000..82ea79dba27417 --- /dev/null +++ b/components/ide/jetbrains/toolbox/build.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# Copyright (c) 2024 Gitpod GmbH. All rights reserved. +# Licensed under the GNU Affero General Public License (AGPL). +# See License.AGPL.txt in the project root for license information. + +set -e + +JB_GP_VERSION=${1} + +./gradlew -PsupervisorApiProjectPath=components-supervisor-api-java--lib/ -PgitpodPublicApiProjectPath=components-public-api-java--lib/ -PenvironmentName="$JB_QUALIFIER" -Dgradle.user.home="/workspace/.gradle-tb-$JB_QUALIFIER" -Dplugin.verifier.home.dir="$HOME/.cache/pluginVerifier-tb-$JB_QUALIFIER" -PpluginVersion="$JB_GP_VERSION" pluginZip + +# # TODO(hw): Improve me +# tarDir="/tmp/tb-build" +# mkdir -p "$tarDir" +# mv ./build/distributions/io.gitpod.toolbox.gateway-0.0.1-dev.zip "$tarDir/io.gitpod.toolbox.gateway-0.0.1-dev.zip" +# echo "GITPOD_PLUGIN_ZIP=$tarDir/io.gitpod.toolbox.gateway-0.0.1-dev.zip" >> /tmp/__gh_output.txt +# # unzip ./build/distributions/io.gitpod.toolbox.gateway-0.0.1-dev.zip -d ./build diff --git a/components/ide/jetbrains/toolbox/gradle.properties b/components/ide/jetbrains/toolbox/gradle.properties index 9d45e708410982..1d898692293ac8 100644 --- a/components/ide/jetbrains/toolbox/gradle.properties +++ b/components/ide/jetbrains/toolbox/gradle.properties @@ -1,4 +1,4 @@ -pluginVersion=0.0.1 +pluginVersion= environmentName=latest supervisorApiProjectPath=../../../supervisor-api/java gitpodPublicApiProjectPath=../../../public-api/java diff --git a/components/ide/jetbrains/toolbox/gradle/libs.versions.toml b/components/ide/jetbrains/toolbox/gradle/libs.versions.toml index c80340a0cd18b9..9a46203b5c50ae 100644 --- a/components/ide/jetbrains/toolbox/gradle/libs.versions.toml +++ b/components/ide/jetbrains/toolbox/gradle/libs.versions.toml @@ -1,5 +1,5 @@ [versions] -gateway = "2.6.0.34606" +toolbox-plugin-api = "0.2" kotlin = "2.0.10" coroutines = "1.7.3" serialization = "1.5.0" @@ -7,10 +7,12 @@ okhttp = "4.10.0" slf4j = "2.0.3" dependency-license-report = "2.5" marketplace-client = "2.0.38" +gradle-wrapper = "0.14.0" [libraries] -kotlin-stdlib = { module = "com.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" } -gateway-api = { module = "com.jetbrains.toolbox.gateway:gateway-api", version.ref = "gateway" } +toolbox-core-api = { module = "com.jetbrains.toolbox:core-api", version.ref = "toolbox-plugin-api" } +toolbox-ui-api = { module = "com.jetbrains.toolbox:ui-api", version.ref = "toolbox-plugin-api" } +toolbox-remote-dev-api = { module = "com.jetbrains.toolbox:remote-dev-api", version.ref = "toolbox-plugin-api" } coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutines" } serialization-core = { module = "org.jetbrains.kotlinx:kotlinx-serialization-core", version.ref = "serialization" } serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "serialization" } @@ -21,9 +23,11 @@ slf4j = { module = "org.slf4j:slf4j-api", version.ref = "slf4j" } marketplace-client = { module = "org.jetbrains.intellij:plugin-repository-rest-client", version.ref = "marketplace-client" } [bundles] -serialization = [ "serialization-core", "serialization-json", "serialization-json-okio" ] +serialization = [ "serialization-core", "serialization-json" ] +toolbox-plugin-api = [ "toolbox-core-api", "toolbox-ui-api", "toolbox-remote-dev-api" ] [plugins] kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" } dependency-license-report = { id = "com.github.jk1.dependency-license-report", version.ref = "dependency-license-report" } +gradle-wrapper = { id = "me.filippov.gradle.jvm.wrapper", version.ref = "gradle-wrapper" } diff --git a/components/ide/jetbrains/toolbox/gradle/wrapper/gradle-wrapper.properties b/components/ide/jetbrains/toolbox/gradle/wrapper/gradle-wrapper.properties index 2617362fd0b8b3..a4413138c96c6e 100644 --- a/components/ide/jetbrains/toolbox/gradle/wrapper/gradle-wrapper.properties +++ b/components/ide/jetbrains/toolbox/gradle/wrapper/gradle-wrapper.properties @@ -2,5 +2,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/components/ide/jetbrains/toolbox/settings.gradle.kts b/components/ide/jetbrains/toolbox/settings.gradle.kts index 9732826b70f69c..a82e354dc8a54a 100644 --- a/components/ide/jetbrains/toolbox/settings.gradle.kts +++ b/components/ide/jetbrains/toolbox/settings.gradle.kts @@ -1,3 +1,7 @@ +// Copyright (c) 2024 Gitpod GmbH. All rights reserved. +// Licensed under the GNU Affero General Public License (AGPL). +// See License.AGPL.txt in the project root for license information. + rootProject.name = "gitpod-toolbox-gateway" include(":supervisor-api") diff --git a/components/ide/jetbrains/toolbox/src/main/kotlin/io/gitpod/toolbox/auth/GitpodAuthManager.kt b/components/ide/jetbrains/toolbox/src/main/kotlin/io/gitpod/toolbox/auth/GitpodAuthManager.kt index 42716b5fe2c253..fa1069e4686a93 100644 --- a/components/ide/jetbrains/toolbox/src/main/kotlin/io/gitpod/toolbox/auth/GitpodAuthManager.kt +++ b/components/ide/jetbrains/toolbox/src/main/kotlin/io/gitpod/toolbox/auth/GitpodAuthManager.kt @@ -6,7 +6,7 @@ package io.gitpod.toolbox.auth import com.connectrpc.Code import com.connectrpc.ConnectException -import com.jetbrains.toolbox.gateway.auth.* +import com.jetbrains.toolbox.api.core.auth.* import io.gitpod.publicapi.experimental.v1.UserServiceClient import io.gitpod.toolbox.service.GitpodPublicApiManager import io.gitpod.toolbox.service.Utils diff --git a/components/ide/jetbrains/toolbox/src/main/kotlin/io/gitpod/toolbox/auth/GitpodLoginPage.kt b/components/ide/jetbrains/toolbox/src/main/kotlin/io/gitpod/toolbox/auth/GitpodLoginPage.kt index 2eeac4f2878c83..ded12aeb3c4f0e 100644 --- a/components/ide/jetbrains/toolbox/src/main/kotlin/io/gitpod/toolbox/auth/GitpodLoginPage.kt +++ b/components/ide/jetbrains/toolbox/src/main/kotlin/io/gitpod/toolbox/auth/GitpodLoginPage.kt @@ -4,9 +4,14 @@ package io.gitpod.toolbox.auth -import com.jetbrains.toolbox.gateway.ui.* +import com.jetbrains.toolbox.api.core.ui.icons.SvgIcon +import com.jetbrains.toolbox.api.ui.actions.ActionDescription +import com.jetbrains.toolbox.api.ui.components.LinkField +import com.jetbrains.toolbox.api.ui.components.TextField +import com.jetbrains.toolbox.api.ui.components.UiField +import com.jetbrains.toolbox.api.ui.components.ValidationResult import io.gitpod.toolbox.components.AbstractUiPage -import io.gitpod.toolbox.components.GitpodIconColored +import io.gitpod.toolbox.components.GitpodIcon import io.gitpod.toolbox.components.SimpleButton import io.gitpod.toolbox.service.Utils @@ -25,8 +30,9 @@ class GitpodLoginPage(private val authManager: GitpodAuthManager) : AbstractUiPa return mutableListOf(hostField, LinkField("Learn more", "https://gitpod.io/docs")) } - override fun getActionButtons(): MutableList { - return mutableListOf(SimpleButton("Login") action@{ + + override fun getActionButtons(): List { + return listOf(SimpleButton("Login") action@{ val host = getFieldValue(hostField) ?: return@action val url = authManager.getOAuthLoginUrl(host) Utils.openUrl(url) @@ -37,7 +43,7 @@ class GitpodLoginPage(private val authManager: GitpodAuthManager) : AbstractUiPa override fun getDescription() = "Always ready to code." - override fun getSvgIcon(): ByteArray { - return GitpodIconColored() + override fun getSvgIcon(): SvgIcon { + return GitpodIcon() } } diff --git a/components/ide/jetbrains/toolbox/src/main/kotlin/io/gitpod/toolbox/components/AbstractUiPage.kt b/components/ide/jetbrains/toolbox/src/main/kotlin/io/gitpod/toolbox/components/AbstractUiPage.kt index 9f87467b4061a4..b90a582a343dc5 100644 --- a/components/ide/jetbrains/toolbox/src/main/kotlin/io/gitpod/toolbox/components/AbstractUiPage.kt +++ b/components/ide/jetbrains/toolbox/src/main/kotlin/io/gitpod/toolbox/components/AbstractUiPage.kt @@ -4,8 +4,8 @@ package io.gitpod.toolbox.components -import com.jetbrains.toolbox.gateway.ui.UiField -import com.jetbrains.toolbox.gateway.ui.UiPage +import com.jetbrains.toolbox.api.ui.components.UiField +import com.jetbrains.toolbox.api.ui.components.UiPage abstract class AbstractUiPage : UiPage { private var stateAccessor: UiPage.UiFieldStateAccessor? = null diff --git a/components/ide/jetbrains/toolbox/src/main/kotlin/io/gitpod/toolbox/components/Button.kt b/components/ide/jetbrains/toolbox/src/main/kotlin/io/gitpod/toolbox/components/Button.kt index 2814128842a584..0ca47ce289c79c 100644 --- a/components/ide/jetbrains/toolbox/src/main/kotlin/io/gitpod/toolbox/components/Button.kt +++ b/components/ide/jetbrains/toolbox/src/main/kotlin/io/gitpod/toolbox/components/Button.kt @@ -4,7 +4,7 @@ package io.gitpod.toolbox.components -import com.jetbrains.toolbox.gateway.ui.RunnableActionDescription +import com.jetbrains.toolbox.api.ui.actions.RunnableActionDescription open class SimpleButton(private val title: String, private val action: () -> Unit = {}): RunnableActionDescription { override fun getLabel(): String { diff --git a/components/ide/jetbrains/toolbox/src/main/kotlin/io/gitpod/toolbox/components/Icon.kt b/components/ide/jetbrains/toolbox/src/main/kotlin/io/gitpod/toolbox/components/Icon.kt index def482c1a51f45..c4cdec433901e5 100644 --- a/components/ide/jetbrains/toolbox/src/main/kotlin/io/gitpod/toolbox/components/Icon.kt +++ b/components/ide/jetbrains/toolbox/src/main/kotlin/io/gitpod/toolbox/components/Icon.kt @@ -4,14 +4,16 @@ package io.gitpod.toolbox.components +import com.jetbrains.toolbox.api.core.ui.icons.SvgIcon import io.gitpod.toolbox.gateway.GitpodGatewayExtension @Suppress("FunctionName") -fun GitpodIcon(): ByteArray { - return GitpodGatewayExtension::class.java.getResourceAsStream("/icon.svg")?.readAllBytes() ?: byteArrayOf() +fun GitpodIconGray(): SvgIcon { + return SvgIcon(GitpodGatewayExtension::class.java.getResourceAsStream("/icon-gray.svg")?.readAllBytes() ?: byteArrayOf()) } @Suppress("FunctionName") -fun GitpodIconColored(): ByteArray { - return GitpodGatewayExtension::class.java.getResourceAsStream("/icon-colored.svg")?.readAllBytes() ?: byteArrayOf() +fun GitpodIcon(): SvgIcon { + return SvgIcon(GitpodGatewayExtension::class.java.getResourceAsStream("/icon.svg")?.readAllBytes() ?: byteArrayOf()) } + diff --git a/components/ide/jetbrains/toolbox/src/main/kotlin/io/gitpod/toolbox/gateway/GitpodGatewayExtension.kt b/components/ide/jetbrains/toolbox/src/main/kotlin/io/gitpod/toolbox/gateway/GitpodGatewayExtension.kt index 1d9565e981784d..5bc48f223cbec1 100644 --- a/components/ide/jetbrains/toolbox/src/main/kotlin/io/gitpod/toolbox/gateway/GitpodGatewayExtension.kt +++ b/components/ide/jetbrains/toolbox/src/main/kotlin/io/gitpod/toolbox/gateway/GitpodGatewayExtension.kt @@ -4,14 +4,14 @@ package io.gitpod.toolbox.gateway -import com.jetbrains.toolbox.gateway.GatewayExtension -import com.jetbrains.toolbox.gateway.RemoteEnvironmentConsumer -import com.jetbrains.toolbox.gateway.RemoteProvider -import com.jetbrains.toolbox.gateway.ToolboxServiceLocator +import com.jetbrains.toolbox.api.core.ServiceLocator +import com.jetbrains.toolbox.api.remoteDev.RemoteDevExtension +import com.jetbrains.toolbox.api.remoteDev.RemoteEnvironmentConsumer +import com.jetbrains.toolbox.api.remoteDev.RemoteProvider import io.gitpod.toolbox.service.Utils -class GitpodGatewayExtension : GatewayExtension { - override fun createRemoteProviderPluginInstance(serviceLocator: ToolboxServiceLocator): RemoteProvider { +class GitpodGatewayExtension : RemoteDevExtension { + override fun createRemoteProviderPluginInstance(serviceLocator: ServiceLocator): RemoteProvider { Utils.initialize(serviceLocator) return GitpodRemoteProvider(serviceLocator.getService(RemoteEnvironmentConsumer::class.java)) } diff --git a/components/ide/jetbrains/toolbox/src/main/kotlin/io/gitpod/toolbox/gateway/GitpodRemoteEnvironment.kt b/components/ide/jetbrains/toolbox/src/main/kotlin/io/gitpod/toolbox/gateway/GitpodRemoteEnvironment.kt index e5a7ae16dd6a7e..44223cffa5ecae 100644 --- a/components/ide/jetbrains/toolbox/src/main/kotlin/io/gitpod/toolbox/gateway/GitpodRemoteEnvironment.kt +++ b/components/ide/jetbrains/toolbox/src/main/kotlin/io/gitpod/toolbox/gateway/GitpodRemoteEnvironment.kt @@ -4,14 +4,16 @@ package io.gitpod.toolbox.gateway -import com.jetbrains.toolbox.gateway.AbstractRemoteProviderEnvironment -import com.jetbrains.toolbox.gateway.EnvironmentVisibilityState -import com.jetbrains.toolbox.gateway.environments.EnvironmentContentsView -import com.jetbrains.toolbox.gateway.states.EnvironmentStateConsumer -import com.jetbrains.toolbox.gateway.states.StandardRemoteEnvironmentState -import com.jetbrains.toolbox.gateway.ui.ActionDescription -import com.jetbrains.toolbox.gateway.ui.ObservableList -import com.jetbrains.toolbox.gateway.ui.ObservablePropertiesFactory +import com.jetbrains.toolbox.api.remoteDev.AbstractRemoteProviderEnvironment +import com.jetbrains.toolbox.api.remoteDev.EnvironmentVisibilityState +import com.jetbrains.toolbox.api.remoteDev.environments.EnvironmentContentsView +import com.jetbrains.toolbox.api.remoteDev.states.CustomRemoteEnvironmentState +import com.jetbrains.toolbox.api.remoteDev.states.EnvironmentStateConsumer +import com.jetbrains.toolbox.api.remoteDev.states.EnvironmentStateIcons +import com.jetbrains.toolbox.api.remoteDev.states.StandardRemoteEnvironmentState +import com.jetbrains.toolbox.api.ui.actions.ActionDescription +import com.jetbrains.toolbox.api.ui.observables.ObservableList +import com.jetbrains.toolbox.api.ui.observables.ObservablePropertiesFactory import io.gitpod.publicapi.experimental.v1.Workspaces.WorkspaceInstanceStatus import io.gitpod.toolbox.auth.GitpodAuthManager import io.gitpod.toolbox.service.ConnectParams @@ -100,17 +102,16 @@ private class WorkspaceEnvState(val phase: WorkspaceInstanceStatus.Phase) { companion object { val phaseToStateMap = mapOf( - WorkspaceInstanceStatus.Phase.PHASE_UNSPECIFIED to StandardRemoteEnvironmentState.Unreachable, - WorkspaceInstanceStatus.Phase.PHASE_PREPARING to StandardRemoteEnvironmentState.Initializing, - WorkspaceInstanceStatus.Phase.PHASE_IMAGEBUILD to StandardRemoteEnvironmentState.Initializing, - WorkspaceInstanceStatus.Phase.PHASE_PENDING to StandardRemoteEnvironmentState.Initializing, - WorkspaceInstanceStatus.Phase.PHASE_CREATING to StandardRemoteEnvironmentState.Initializing, - WorkspaceInstanceStatus.Phase.PHASE_INITIALIZING to StandardRemoteEnvironmentState.Initializing, - WorkspaceInstanceStatus.Phase.PHASE_RUNNING to StandardRemoteEnvironmentState.Active, + WorkspaceInstanceStatus.Phase.PHASE_UNSPECIFIED to CustomRemoteEnvironmentState("Unknown", Utils.environmentStateColorPalette.getColor(StandardRemoteEnvironmentState.Inactive), false, EnvironmentStateIcons.Error), + WorkspaceInstanceStatus.Phase.PHASE_PREPARING to CustomRemoteEnvironmentState("Preparing", Utils.environmentStateColorPalette.getColor(StandardRemoteEnvironmentState.Initializing), false, EnvironmentStateIcons.Connecting), + WorkspaceInstanceStatus.Phase.PHASE_IMAGEBUILD to CustomRemoteEnvironmentState("Building", Utils.environmentStateColorPalette.getColor(StandardRemoteEnvironmentState.Initializing), false, EnvironmentStateIcons.Connecting), + WorkspaceInstanceStatus.Phase.PHASE_PENDING to CustomRemoteEnvironmentState("Initializing", Utils.environmentStateColorPalette.getColor(StandardRemoteEnvironmentState.Initializing), false, EnvironmentStateIcons.Connecting), + WorkspaceInstanceStatus.Phase.PHASE_CREATING to CustomRemoteEnvironmentState("Creating", Utils.environmentStateColorPalette.getColor(StandardRemoteEnvironmentState.Initializing), false, EnvironmentStateIcons.Connecting), + WorkspaceInstanceStatus.Phase.PHASE_INITIALIZING to CustomRemoteEnvironmentState("Initializing", Utils.environmentStateColorPalette.getColor(StandardRemoteEnvironmentState.Initializing), false, EnvironmentStateIcons.Connecting), + WorkspaceInstanceStatus.Phase.PHASE_RUNNING to CustomRemoteEnvironmentState("Running", Utils.environmentStateColorPalette.getColor(StandardRemoteEnvironmentState.Active), true, EnvironmentStateIcons.Active), WorkspaceInstanceStatus.Phase.PHASE_INTERRUPTED to StandardRemoteEnvironmentState.Error, - WorkspaceInstanceStatus.Phase.PHASE_STOPPING to StandardRemoteEnvironmentState.Unreachable, - WorkspaceInstanceStatus.Phase.PHASE_STOPPED to StandardRemoteEnvironmentState.Hibernated, + WorkspaceInstanceStatus.Phase.PHASE_STOPPING to CustomRemoteEnvironmentState("Stopping", Utils.environmentStateColorPalette.getColor(StandardRemoteEnvironmentState.Hibernating), false, EnvironmentStateIcons.Connecting), + WorkspaceInstanceStatus.Phase.PHASE_STOPPED to CustomRemoteEnvironmentState("Stopped", Utils.environmentStateColorPalette.getColor(StandardRemoteEnvironmentState.Hibernated), false, EnvironmentStateIcons.Hibernated), ) } - // TODO(hw): add customized state -} \ No newline at end of file +} diff --git a/components/ide/jetbrains/toolbox/src/main/kotlin/io/gitpod/toolbox/gateway/GitpodRemoteEnvironmentContentsView.kt b/components/ide/jetbrains/toolbox/src/main/kotlin/io/gitpod/toolbox/gateway/GitpodRemoteEnvironmentContentsView.kt index fc017fab27b406..5fab000b4e1982 100644 --- a/components/ide/jetbrains/toolbox/src/main/kotlin/io/gitpod/toolbox/gateway/GitpodRemoteEnvironmentContentsView.kt +++ b/components/ide/jetbrains/toolbox/src/main/kotlin/io/gitpod/toolbox/gateway/GitpodRemoteEnvironmentContentsView.kt @@ -4,14 +4,13 @@ package io.gitpod.toolbox.gateway -import com.jetbrains.toolbox.gateway.environments.CachedIdeStub -import com.jetbrains.toolbox.gateway.environments.CachedProjectStub -import com.jetbrains.toolbox.gateway.environments.ManualEnvironmentContentsView -import com.jetbrains.toolbox.gateway.environments.SshEnvironmentContentsView -import com.jetbrains.toolbox.gateway.ssh.SshConnectionInfo +import com.jetbrains.toolbox.api.remoteDev.environments.CachedIdeStub +import com.jetbrains.toolbox.api.remoteDev.environments.CachedProjectStub +import com.jetbrains.toolbox.api.remoteDev.environments.ManualEnvironmentContentsView +import com.jetbrains.toolbox.api.remoteDev.environments.SshEnvironmentContentsView +import com.jetbrains.toolbox.api.remoteDev.ssh.SshConnectionInfo import io.gitpod.publicapi.experimental.v1.Workspaces.WorkspaceInstanceStatus import io.gitpod.toolbox.service.* -import io.gitpod.toolbox.utils.GitpodLogger import java.util.concurrent.CompletableFuture class GitpodRemoteEnvironmentContentsView( @@ -34,7 +33,6 @@ class GitpodRemoteEnvironmentContentsView( }) private val connectionInfo = CompletableFuture.supplyAsync { - GitpodLogger.info("===============connectionInfo ${connectParams.uniqueID}") val (connInfo, cancel) = provider.connect() this.cancel = cancel connInfo diff --git a/components/ide/jetbrains/toolbox/src/main/kotlin/io/gitpod/toolbox/gateway/GitpodRemoteProvider.kt b/components/ide/jetbrains/toolbox/src/main/kotlin/io/gitpod/toolbox/gateway/GitpodRemoteProvider.kt index 2458cafaf01cd4..959c7b823def2c 100644 --- a/components/ide/jetbrains/toolbox/src/main/kotlin/io/gitpod/toolbox/gateway/GitpodRemoteProvider.kt +++ b/components/ide/jetbrains/toolbox/src/main/kotlin/io/gitpod/toolbox/gateway/GitpodRemoteProvider.kt @@ -4,12 +4,12 @@ package io.gitpod.toolbox.gateway -import com.jetbrains.toolbox.gateway.ProviderVisibilityState -import com.jetbrains.toolbox.gateway.RemoteEnvironmentConsumer -import com.jetbrains.toolbox.gateway.RemoteProvider -import com.jetbrains.toolbox.gateway.ui.AccountDropdownField -import com.jetbrains.toolbox.gateway.ui.ActionDescription -import com.jetbrains.toolbox.gateway.ui.UiPage +import com.jetbrains.toolbox.api.remoteDev.ProviderVisibilityState +import com.jetbrains.toolbox.api.remoteDev.RemoteEnvironmentConsumer +import com.jetbrains.toolbox.api.remoteDev.RemoteProvider +import com.jetbrains.toolbox.api.ui.actions.ActionDescription +import com.jetbrains.toolbox.api.ui.components.AccountDropdownField +import com.jetbrains.toolbox.api.ui.components.UiPage import io.gitpod.publicapi.experimental.v1.Workspaces import io.gitpod.toolbox.auth.GitpodAuthManager import io.gitpod.toolbox.auth.GitpodLoginPage @@ -66,7 +66,11 @@ class GitpodRemoteProvider( val joinLinkInfo = publicApi.fetchJoinLink2Info(workspaceId, workspace!!.getIDEUrl()) // TODO(hw): verify if it's working Utils.clientHelper.prepareClient(joinLinkInfo.ideVersion) - Utils.clientHelper.setAutoConnectOnEnvironmentReady(connectParams.uniqueID, joinLinkInfo.ideVersion, joinLinkInfo.projectPath) + Utils.clientHelper.setAutoConnectOnEnvironmentReady( + connectParams.uniqueID, + joinLinkInfo.ideVersion, + joinLinkInfo.projectPath + ) } private fun showWorkspacesList() { @@ -104,10 +108,10 @@ class GitpodRemoteProvider( override fun getOverrideUiPage(): UiPage? { authManger.addLoginListener { startup() - Utils.toolboxUi.showPluginEnvironmentsPage() + Utils.environmentUiPageManager.showPluginEnvironmentsPage(false) } authManger.addLogoutListener { - Utils.toolboxUi.showPluginEnvironmentsPage() + Utils.environmentUiPageManager.showPluginEnvironmentsPage(false) } val account = authManger.getCurrentAccount() account ?: return loginPage @@ -117,7 +121,7 @@ class GitpodRemoteProvider( return@launch } authManger.logout() - Utils.toolboxUi.showPluginEnvironmentsPage() + Utils.environmentUiPageManager.showPluginEnvironmentsPage(false) } return null } @@ -137,11 +141,14 @@ class GitpodRemoteProvider( } override fun getAdditionalPluginActions(): MutableList { - return mutableListOf( - SimpleButton("View documents") { - Utils.openUrl("https://gitpod.io/docs") - }, - ) + val list = mutableListOf() + val account = authManger.getCurrentAccount() + if (account != null) { + list.add(SimpleButton("Open Dashboard") { Utils.openUrl("https://${account.getHost()}/workspaces") }) + } + list.add(SimpleButton("View Documents") { Utils.openUrl("https://www.gitpod.io/docs/introduction/getting-started") }) + list.add(SimpleButton("About Gitpod Flex") { Utils.openUrl("https://www.gitpod.io/docs/flex/getting-started") }) + return list } override fun canCreateNewEnvironments(): Boolean = false diff --git a/components/ide/jetbrains/toolbox/src/main/kotlin/io/gitpod/toolbox/gateway/GitpodUriHandler.kt b/components/ide/jetbrains/toolbox/src/main/kotlin/io/gitpod/toolbox/gateway/GitpodUriHandler.kt index a9aa7fcfab6be7..4edf90c8b1caee 100644 --- a/components/ide/jetbrains/toolbox/src/main/kotlin/io/gitpod/toolbox/gateway/GitpodUriHandler.kt +++ b/components/ide/jetbrains/toolbox/src/main/kotlin/io/gitpod/toolbox/gateway/GitpodUriHandler.kt @@ -24,7 +24,7 @@ abstract class AbstractUriHandler : UriHandler { handle(data) true } catch (e: Exception) { - GitpodLogger.warn("cannot parse URI", e) + GitpodLogger.warn(e, "cannot parse URI") false } } diff --git a/components/ide/jetbrains/toolbox/src/main/kotlin/io/gitpod/toolbox/service/DataManager.kt b/components/ide/jetbrains/toolbox/src/main/kotlin/io/gitpod/toolbox/service/Data.kt similarity index 76% rename from components/ide/jetbrains/toolbox/src/main/kotlin/io/gitpod/toolbox/service/DataManager.kt rename to components/ide/jetbrains/toolbox/src/main/kotlin/io/gitpod/toolbox/service/Data.kt index d750c4b864ec01..39b1043a930271 100644 --- a/components/ide/jetbrains/toolbox/src/main/kotlin/io/gitpod/toolbox/service/DataManager.kt +++ b/components/ide/jetbrains/toolbox/src/main/kotlin/io/gitpod/toolbox/service/Data.kt @@ -7,7 +7,6 @@ package io.gitpod.toolbox.service import io.gitpod.publicapi.experimental.v1.Workspaces.Workspace import io.gitpod.publicapi.experimental.v1.Workspaces.WorkspaceInstanceStatus import java.net.URI -import java.net.URL fun Workspace.getConnectParams(): ConnectParams { return ConnectParams(workspaceId, getGitpodHost(), false) @@ -18,12 +17,15 @@ fun Workspace.getIDEUrl(): String { } fun Workspace.getGitpodHost(): String { - val ideUrl = URL(getIDEUrl()) + val ideUrl = URI(getIDEUrl()).toURL() val hostSegments = ideUrl.host.split(".") return hostSegments.takeLast(2).joinToString(".") } -fun WorkspaceInstanceStatus.usingToolbox() = editor.preferToolbox +val JetBrainsEditors = setOf("intellij", "pycharm", "webstorm", "clion", "goland", "rider", "phpstorm", "rubymine") +fun WorkspaceInstanceStatus.shouldListedInEnvironments() : Boolean { + return editor.preferToolbox && JetBrainsEditors.contains(editor.name) +} fun Workspace.getTunnelUrl(): String { val workspaceHost = URI.create(status.instance.status.url).host diff --git a/components/ide/jetbrains/toolbox/src/main/kotlin/io/gitpod/toolbox/service/GitpodConnectionProvider.kt b/components/ide/jetbrains/toolbox/src/main/kotlin/io/gitpod/toolbox/service/GitpodConnectionProvider.kt index daccac5d2cc452..3d34d7566f6df3 100644 --- a/components/ide/jetbrains/toolbox/src/main/kotlin/io/gitpod/toolbox/service/GitpodConnectionProvider.kt +++ b/components/ide/jetbrains/toolbox/src/main/kotlin/io/gitpod/toolbox/service/GitpodConnectionProvider.kt @@ -5,7 +5,7 @@ package io.gitpod.toolbox.service import com.jetbrains.rd.util.ConcurrentHashMap -import com.jetbrains.toolbox.gateway.ssh.SshConnectionInfo +import com.jetbrains.toolbox.api.remoteDev.ssh.SshConnectionInfo interface ConnectionInfoProvider { fun getUniqueID(): String diff --git a/components/ide/jetbrains/toolbox/src/main/kotlin/io/gitpod/toolbox/service/GitpodPublicApiManager.kt b/components/ide/jetbrains/toolbox/src/main/kotlin/io/gitpod/toolbox/service/GitpodPublicApiManager.kt index 8c99c7b9ea410e..812913a89f60fc 100644 --- a/components/ide/jetbrains/toolbox/src/main/kotlin/io/gitpod/toolbox/service/GitpodPublicApiManager.kt +++ b/components/ide/jetbrains/toolbox/src/main/kotlin/io/gitpod/toolbox/service/GitpodPublicApiManager.kt @@ -21,7 +21,7 @@ import kotlinx.serialization.Serializable import kotlinx.serialization.decodeFromString import kotlinx.serialization.json.Json import okhttp3.Request -import java.net.URL +import java.net.URI import java.time.Duration class GitpodPublicApiManager(private val authManger: GitpodAuthManager) { @@ -72,7 +72,7 @@ class GitpodPublicApiManager(private val authManger: GitpodAuthManager) { suspend fun listWorkspaces(): List { val workspaceApi = workspaceApi ?: throw IllegalStateException("No client") val resp = workspaceApi.listWorkspaces(Workspaces.ListWorkspacesRequest.newBuilder().build()) - return this.handleResp("listWorkspaces", resp).resultList.filter { it.status.instance.status.usingToolbox() } + return this.handleResp("listWorkspaces", resp).resultList.filter { it.status.instance.status.shouldListedInEnvironments() } } suspend fun getWorkspace(workspaceId: String): Workspaces.Workspace { @@ -92,7 +92,7 @@ class GitpodPublicApiManager(private val authManger: GitpodAuthManager) { suspend fun fetchJoinLink2Info(workspaceId: String, ideURL: String): JoinLink2Response { val token = getWorkspaceOwnerToken(workspaceId) - val backendUrl = "https://24000-${URL(ideURL).host}/joinLink2" + val backendUrl = "https://24000-${URI(ideURL).host}/joinLink2" val client = Utils.httpClient val req = Request.Builder().url(backendUrl).header("x-gitpod-owner-token", token) val response = client.newCall(req.build()).await() @@ -168,5 +168,3 @@ class AuthorizationInterceptor(private val token: String) : Interceptor { }, ) } - -// TODO: logger interceptor diff --git a/components/ide/jetbrains/toolbox/src/main/kotlin/io/gitpod/toolbox/service/GitpodWebSocketTunnelServer.kt b/components/ide/jetbrains/toolbox/src/main/kotlin/io/gitpod/toolbox/service/GitpodWebSocketTunnelServer.kt index dbabe589b91ae3..202e786cc60b27 100644 --- a/components/ide/jetbrains/toolbox/src/main/kotlin/io/gitpod/toolbox/service/GitpodWebSocketTunnelServer.kt +++ b/components/ide/jetbrains/toolbox/src/main/kotlin/io/gitpod/toolbox/service/GitpodWebSocketTunnelServer.kt @@ -43,13 +43,13 @@ class GitpodWebSocketTunnelServer(private val provider: ConnectionInfoProvider) } } catch (t: Throwable) { if (isActive) { - GitpodLogger.error("$logPrefix failed to accept", t) + GitpodLogger.error(t, "$logPrefix failed to accept") } } } } catch (t: Throwable) { if (isActive) { - GitpodLogger.error("$logPrefix failed to listen", t) + GitpodLogger.error(t, "$logPrefix failed to listen") } } finally { GitpodLogger.info("$logPrefix stopped") @@ -90,7 +90,7 @@ class GitpodWebSocketTunnelServer(private val provider: ConnectionInfoProvider) if (t is SocketException && t.message?.contains("Socket closed") == true) { return } - GitpodLogger.error("$logPrefix failed to pipe", t) + GitpodLogger.error(t, "$logPrefix failed to pipe") } finally { clients.remove(socketClient) socketClient.close() @@ -166,7 +166,11 @@ class GitpodWebSocketTunnelClient(private val logPrefix: String, private val tcp } override fun onError(session: Session?, thr: Throwable?) { - GitpodLogger.error("$logPrefix failed", thr) + if (thr != null) { + GitpodLogger.error(thr, "$logPrefix failed") + } else { + GitpodLogger.error("$logPrefix failed") + } this.doClose() } @@ -174,12 +178,12 @@ class GitpodWebSocketTunnelClient(private val logPrefix: String, private val tcp try { tcpSocket.close() } catch (t: Throwable) { - GitpodLogger.error("$logPrefix failed to close socket", t) + GitpodLogger.error(t, "$logPrefix failed to close socket") } try { container?.stop() } catch (t: Throwable) { - GitpodLogger.error("$logPrefix failed to stop container", t) + GitpodLogger.error(t, "$logPrefix failed to stop container") } } @@ -191,12 +195,12 @@ class GitpodWebSocketTunnelClient(private val logPrefix: String, private val tcp try { webSocketSession.close() } catch (t: Throwable) { - GitpodLogger.error("$logPrefix failed to close", t) + GitpodLogger.error(t, "$logPrefix failed to close") } try { container?.stop() } catch (t: Throwable) { - GitpodLogger.error("$logPrefix failed to stop container", t) + GitpodLogger.error(t, "$logPrefix failed to stop container") } } diff --git a/components/ide/jetbrains/toolbox/src/main/kotlin/io/gitpod/toolbox/service/Utils.kt b/components/ide/jetbrains/toolbox/src/main/kotlin/io/gitpod/toolbox/service/Utils.kt index bf3d9d60ff61cc..b862dfa24af63a 100644 --- a/components/ide/jetbrains/toolbox/src/main/kotlin/io/gitpod/toolbox/service/Utils.kt +++ b/components/ide/jetbrains/toolbox/src/main/kotlin/io/gitpod/toolbox/service/Utils.kt @@ -4,21 +4,25 @@ package io.gitpod.toolbox.service -import com.jetbrains.toolbox.gateway.PluginSettingsStore -import com.jetbrains.toolbox.gateway.ToolboxServiceLocator -import com.jetbrains.toolbox.gateway.connection.ClientHelper -import com.jetbrains.toolbox.gateway.connection.ToolboxProxySettings -import com.jetbrains.toolbox.gateway.ssh.validation.SshConnectionValidator -import com.jetbrains.toolbox.gateway.ui.ObservablePropertiesFactory -import com.jetbrains.toolbox.gateway.ui.ToolboxUi +import com.jetbrains.toolbox.api.core.PluginSettingsStore +import com.jetbrains.toolbox.api.core.ServiceLocator +import com.jetbrains.toolbox.api.core.os.LocalDesktopManager +import com.jetbrains.toolbox.api.remoteDev.connection.ClientHelper +import com.jetbrains.toolbox.api.remoteDev.connection.ToolboxProxySettings +import com.jetbrains.toolbox.api.remoteDev.ssh.validation.SshConnectionValidator +import com.jetbrains.toolbox.api.remoteDev.states.EnvironmentStateColorPalette +import com.jetbrains.toolbox.api.remoteDev.ui.EnvironmentUiPageManager +import com.jetbrains.toolbox.api.ui.ToolboxUi +import com.jetbrains.toolbox.api.ui.observables.ObservablePropertiesFactory import io.gitpod.toolbox.gateway.GitpodSettings import kotlinx.coroutines.CoroutineScope import okhttp3.OkHttpClient import java.net.Proxy +import java.net.URI import java.util.concurrent.atomic.AtomicBoolean object Utils { - lateinit var sharedServiceLocator: ToolboxServiceLocator private set + lateinit var sharedServiceLocator: ServiceLocator private set lateinit var coroutineScope: CoroutineScope private set lateinit var settingStore: PluginSettingsStore private set lateinit var sshConnectionValidator: SshConnectionValidator private set @@ -30,15 +34,21 @@ object Utils { lateinit var gitpodSettings: GitpodSettings private set lateinit var toolboxUi: ToolboxUi private set + lateinit var environmentStateColorPalette: EnvironmentStateColorPalette private set + lateinit var localDesktopManager: LocalDesktopManager private set + lateinit var environmentUiPageManager: EnvironmentUiPageManager private set - fun initialize(serviceLocator: ToolboxServiceLocator) { + fun initialize(serviceLocator: ServiceLocator) { if (!isInitialized.compareAndSet(false, true)) { return } sharedServiceLocator = serviceLocator coroutineScope = serviceLocator.getService(CoroutineScope::class.java) toolboxUi = serviceLocator.getService(ToolboxUi::class.java) + localDesktopManager = serviceLocator.getService(LocalDesktopManager::class.java) + environmentStateColorPalette = serviceLocator.getService(EnvironmentStateColorPalette::class.java) + environmentUiPageManager = serviceLocator.getService(EnvironmentUiPageManager::class.java) settingStore = serviceLocator.getService(PluginSettingsStore::class.java) sshConnectionValidator = serviceLocator.getService(SshConnectionValidator::class.java) httpClient = serviceLocator.getService(OkHttpClient::class.java) @@ -49,7 +59,7 @@ object Utils { } fun openUrl(url: String) { - toolboxUi.openUrl(url) + localDesktopManager.openUrl(URI(url).toURL()) } fun getProxyList(): List { diff --git a/components/ide/jetbrains/toolbox/src/main/kotlin/io/gitpod/toolbox/utils/GitpodLogger.kt b/components/ide/jetbrains/toolbox/src/main/kotlin/io/gitpod/toolbox/utils/GitpodLogger.kt index fad157ef56d5cf..dff49c1af92c23 100644 --- a/components/ide/jetbrains/toolbox/src/main/kotlin/io/gitpod/toolbox/utils/GitpodLogger.kt +++ b/components/ide/jetbrains/toolbox/src/main/kotlin/io/gitpod/toolbox/utils/GitpodLogger.kt @@ -4,10 +4,12 @@ package io.gitpod.toolbox.utils +import com.jetbrains.toolbox.api.core.diagnostics.Logger import org.slf4j.LoggerFactory import org.slf4j.spi.LocationAwareLogger +import java.util.function.Supplier -object GitpodLogger { +object GitpodLogger: Logger { private val logger: LocationAwareLogger = LoggerFactory.getLogger(javaClass) as LocationAwareLogger private val FQCN = GitpodLogger::class.java.name @@ -15,31 +17,84 @@ object GitpodLogger { return "[gitpod] $msg" } - fun info(message: String) { - logger.log(null, FQCN, LocationAwareLogger.INFO_INT, formatMessage(message), null, null) + override fun error(exception: Throwable, message: Supplier) { + logger.log(null, FQCN, LocationAwareLogger.ERROR_INT, formatMessage(message.get()), null, exception) } - fun debug(message: String) { - logger.log(null, FQCN, LocationAwareLogger.DEBUG_INT, formatMessage(message), null, null) + override fun error(exception: Throwable, message: String) { + logger.log(null, FQCN, LocationAwareLogger.ERROR_INT, formatMessage(message), null, exception) + } + + override fun error(message: Supplier) { + logger.log(null, FQCN, LocationAwareLogger.ERROR_INT, formatMessage(message.get()), null, null) + } + + override fun error(message: String) { + logger.log(null, FQCN, LocationAwareLogger.ERROR_INT, formatMessage(message), null, null) + } + + override fun warn(exception: Throwable, message: Supplier) { + logger.log(null, FQCN, LocationAwareLogger.WARN_INT, formatMessage(message.get()), null, exception) } - fun warn(message: String) { + override fun warn(exception: Throwable, message: String) { + logger.log(null, FQCN, LocationAwareLogger.WARN_INT, formatMessage(message), null, exception) + } + + override fun warn(message: Supplier) { + logger.log(null, FQCN, LocationAwareLogger.WARN_INT, formatMessage(message.get()), null, null) + } + + override fun warn(message: String) { logger.log(null, FQCN, LocationAwareLogger.WARN_INT, formatMessage(message), null, null) } - fun warn(message: String, throwable: Throwable?) { - logger.log(null, FQCN, LocationAwareLogger.WARN_INT, formatMessage(message), null, throwable) + override fun debug(exception: Throwable, message: Supplier) { + logger.log(null, FQCN, LocationAwareLogger.DEBUG_INT, formatMessage(message.get()), null, exception) } - fun error(message: String) { - logger.log(null, FQCN, LocationAwareLogger.ERROR_INT, formatMessage(message), null, null) + override fun debug(exception: Throwable, message: String) { + logger.log(null, FQCN, LocationAwareLogger.DEBUG_INT, formatMessage(message), null, exception) + } + + override fun debug(message: Supplier) { + logger.log(null, FQCN, LocationAwareLogger.DEBUG_INT, formatMessage(message.get()), null, null) } - fun error(message: String, throwable: Throwable?) { - logger.log(null, FQCN, LocationAwareLogger.ERROR_INT, formatMessage(message), null, throwable) + override fun debug(message: String) { + logger.log(null, FQCN, LocationAwareLogger.DEBUG_INT, formatMessage(message), null, null) } - fun trace(message: String) { + override fun info(exception: Throwable, message: Supplier) { + logger.log(null, FQCN, LocationAwareLogger.INFO_INT, formatMessage(message.get()), null, exception) + } + + override fun info(exception: Throwable, message: String) { + logger.log(null, FQCN, LocationAwareLogger.INFO_INT, formatMessage(message), null, exception) + } + + override fun info(message: Supplier) { + logger.log(null, FQCN, LocationAwareLogger.INFO_INT, formatMessage(message.get()), null, null) + } + + override fun info(message: String) { + logger.log(null, FQCN, LocationAwareLogger.INFO_INT, formatMessage(message), null, null) + } + + override fun trace(exception: Throwable, message: Supplier) { + logger.log(null, FQCN, LocationAwareLogger.TRACE_INT, formatMessage(message.get()), null, exception) + } + + override fun trace(exception: Throwable, message: String) { + logger.log(null, FQCN, LocationAwareLogger.TRACE_INT, formatMessage(message), null, exception) + } + + override fun trace(message: Supplier) { + logger.log(null, FQCN, LocationAwareLogger.TRACE_INT, formatMessage(message.get()), null, null) + } + + override fun trace(message: String) { logger.log(null, FQCN, LocationAwareLogger.TRACE_INT, formatMessage(message), null, null) } + } diff --git a/components/ide/jetbrains/toolbox/src/main/resources/META-INF/services/com.jetbrains.toolbox.gateway.GatewayExtension b/components/ide/jetbrains/toolbox/src/main/resources/META-INF/services/com.jetbrains.toolbox.api.remoteDev.RemoteDevExtension similarity index 100% rename from components/ide/jetbrains/toolbox/src/main/resources/META-INF/services/com.jetbrains.toolbox.gateway.GatewayExtension rename to components/ide/jetbrains/toolbox/src/main/resources/META-INF/services/com.jetbrains.toolbox.api.remoteDev.RemoteDevExtension diff --git a/components/ide/jetbrains/toolbox/src/main/resources/extension.json b/components/ide/jetbrains/toolbox/src/main/resources/extension.json index a7c130ff569b63..f0d7e83ab850c4 100644 --- a/components/ide/jetbrains/toolbox/src/main/resources/extension.json +++ b/components/ide/jetbrains/toolbox/src/main/resources/extension.json @@ -33,9 +33,9 @@ } } }, - "apiVersion": "0.1.0", + "apiVersion": "0.3", "compatibleVersionRange": { - "from": "2.1.0", - "to": "2.6.0" + "from": "2.6.0.0", + "to": "2.6.0.99999" } } diff --git a/components/ide/jetbrains/toolbox/src/main/resources/icon-colored.svg b/components/ide/jetbrains/toolbox/src/main/resources/icon-colored.svg deleted file mode 100644 index 788431d80e068f..00000000000000 --- a/components/ide/jetbrains/toolbox/src/main/resources/icon-colored.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/components/ide/jetbrains/toolbox/src/main/resources/icon-gray.svg b/components/ide/jetbrains/toolbox/src/main/resources/icon-gray.svg new file mode 100644 index 00000000000000..fa3821de1f8ff3 --- /dev/null +++ b/components/ide/jetbrains/toolbox/src/main/resources/icon-gray.svg @@ -0,0 +1,8 @@ + + + \ No newline at end of file diff --git a/components/ide/jetbrains/toolbox/src/main/resources/icon.svg b/components/ide/jetbrains/toolbox/src/main/resources/icon.svg index fa3821de1f8ff3..788431d80e068f 100644 --- a/components/ide/jetbrains/toolbox/src/main/resources/icon.svg +++ b/components/ide/jetbrains/toolbox/src/main/resources/icon.svg @@ -1,8 +1 @@ - - - \ No newline at end of file + diff --git a/components/public-api/java/build.gradle.kts b/components/public-api/java/build.gradle.kts index a5904dae64de5a..16db21d538b435 100644 --- a/components/public-api/java/build.gradle.kts +++ b/components/public-api/java/build.gradle.kts @@ -30,9 +30,12 @@ dependencies { } -// Apply a specific Java toolchain to ease working on different environments. java { toolchain { - languageVersion.set(JavaLanguageVersion.of(11)) + languageVersion.set(JavaLanguageVersion.of(17)) } } + +kotlin { + jvmToolchain(17) +}