Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[WIP ]Toolbox ramp up#532

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
fioan89 wants to merge15 commits intoasher/toolboxfromtoolbox-ramp-up
Closed
Show file tree
Hide file tree
Changes fromall commits
Commits
Show all changes
15 commits
Select commitHold shift + click to select a range
045adcc
fix: serialization issue
fioan89Feb 11, 2025
e463d5f
impl: update Toolbox compatibility range
fioan89Feb 11, 2025
0e87862
build: upgrade Gradle to latest version
fioan89Feb 11, 2025
349f5f8
build: update dependencies
fioan89Feb 12, 2025
8ef87d2
build: update dependencies (1)
fioan89Feb 12, 2025
cc0bdea
build: update dependencies (2)
fioan89Feb 12, 2025
aa60ea8
impl: update class usages (1)
fioan89Feb 12, 2025
102fdab
impl: update class usages (2)
fioan89Feb 13, 2025
49d3b8b
impl: bump plugin API version to o.6
fioan89Feb 13, 2025
f9c8a3d
impl: bump API version to 0.3
fioan89Feb 14, 2025
767db2c
fix: class loader issue caused by API libraries
fioan89Feb 14, 2025
f6daa3e
fix: class loader issue caused by libraries
fioan89Feb 14, 2025
d1e4e95
fix: class loader issue caused by logging libraries
fioan89Feb 17, 2025
fb68191
build: task to remove compile artifacts and installed artifacts
fioan89Feb 17, 2025
0d396f1
impl: direct access to observable properties
fioan89Feb 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions.gitignore
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -14,6 +14,7 @@
## Gradle
.gradle
build
jvm/

## Qodana
.qodana
73 changes: 45 additions & 28 deletionsbuild.gradle.kts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,6 +2,7 @@ import com.github.jk1.license.filter.ExcludeTransitiveDependenciesFilter
import com.github.jk1.license.render.JsonReportRenderer
import org.jetbrains.intellij.pluginRepository.PluginRepositoryFactory
import org.jetbrains.kotlin.com.intellij.openapi.util.SystemInfoRt
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import java.nio.file.Path
import kotlin.io.path.div

Expand All@@ -11,6 +12,7 @@ plugins {
`java-library`
alias(libs.plugins.dependency.license.report)
alias(libs.plugins.ksp)
alias(libs.plugins.gradle.wrapper)
}

buildscript {
Expand All@@ -21,12 +23,23 @@ 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 {
implementation(libs.gateway.api)
compileOnly(libs.bundles.toolbox.plugin.api)
implementation(libs.slf4j)
implementation(libs.tinylog)
implementation(libs.bundles.serialization)
implementation(libs.coroutines.core)
implementation(libs.okhttp)
Expand All@@ -46,9 +59,7 @@ licenseReport {
}

tasks.compileKotlin {
kotlinOptions.freeCompilerArgs += listOf(
"-opt-in=kotlinx.serialization.ExperimentalSerializationApi",
)
compilerOptions.jvmTarget.set(JvmTarget.JVM_21)
}

tasks.test {
Expand All@@ -66,25 +77,7 @@ val assemblePlugin by tasks.registering(Jar::class) {
val copyPlugin by tasks.creating(Sync::class.java) {
dependsOn(assemblePlugin)

val userHome = System.getProperty("user.home").let { Path.of(it) }
val toolboxCachesDir = when {
SystemInfoRt.isWindows -> System.getenv("LOCALAPPDATA")?.let { Path.of(it) } ?: (userHome / "AppData" / "Local")
// currently this is the location that TBA uses on Linux
SystemInfoRt.isLinux -> System.getenv("XDG_DATA_HOME")?.let { Path.of(it) } ?: (userHome / ".local" / "share")
SystemInfoRt.isMac -> userHome / "Library" / "Caches"
else -> error("Unknown os")
} / "JetBrains" / "Toolbox"

val pluginsDir = when {
SystemInfoRt.isWindows -> toolboxCachesDir / "cache"
SystemInfoRt.isLinux || SystemInfoRt.isMac -> toolboxCachesDir
else -> error("Unknown os")
} / "plugins"

val targetDir = pluginsDir / pluginId

from(assemblePlugin.get().outputs.files)

from("src/main/resources") {
include("extension.json")
include("dependencies.json")
Expand All@@ -97,17 +90,41 @@ val copyPlugin by tasks.creating(Sync::class.java) {
configuration.files.filterNot { file ->
listOf(
"kotlin",
"gateway",
"remote-dev-api",
"core-api",
"ui-api",
"annotations",
"okhttp",
"okio",
"slf4j",
).any { file.name.contains(it) }
}
},
)

into(targetDir)
into(getPluginInstallDir())
}

tasks.register("cleanAll", Delete::class.java) {
dependsOn(tasks.clean)
delete(getPluginInstallDir())
delete()
}

private fun getPluginInstallDir(): Path {
val userHome = System.getProperty("user.home").let { Path.of(it) }
val toolboxCachesDir = when {
SystemInfoRt.isWindows -> System.getenv("LOCALAPPDATA")?.let { Path.of(it) } ?: (userHome / "AppData" / "Local")
// currently this is the location that TBA uses on Linux
SystemInfoRt.isLinux -> System.getenv("XDG_DATA_HOME")?.let { Path.of(it) } ?: (userHome / ".local" / "share")
SystemInfoRt.isMac -> userHome / "Library" / "Caches"
else -> error("Unknown os")
} / "JetBrains" / "Toolbox"

val pluginsDir = when {
SystemInfoRt.isWindows -> toolboxCachesDir / "cache"
SystemInfoRt.isLinux || SystemInfoRt.isMac -> toolboxCachesDir
else -> error("Unknown os")
} / "plugins"

return pluginsDir / pluginId
}

val pluginZip by tasks.creating(Zip::class) {
Expand Down
16 changes: 11 additions & 5 deletionsgradle/libs.versions.toml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,30 @@
[versions]
gateway = "2.5.0.32871"
kotlin = "1.9.23"
toolbox-plugin-api = "0.6.2.6.0.37447"
kotlin = "2.0.10"
coroutines = "1.7.3"
serialization = "1.5.0"
okhttp = "4.10.0"
slf4j = "2.0.3"
tinylog = "2.7.0"
dependency-license-report = "2.5"
marketplace-client = "2.0.38"
gradle-wrapper = "0.14.0"
exec = "1.12"
moshi = "1.15.1"
ksp = "1.9.23-1.0.19"
ksp = "2.0.10-1.0.24"
retrofit = "2.8.2"

[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" }
serialization-json-okio = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json-okio", version.ref = "serialization" }
okhttp = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttp" }
slf4j = { module = "org.slf4j:slf4j-api", version.ref = "slf4j" }
tinylog = {module = "org.tinylog:slf4j-tinylog", version.ref = "tinylog"}
exec = { module = "org.zeroturnaround:zt-exec", version.ref = "exec" }
moshi = { module = "com.squareup.moshi:moshi", version.ref = "moshi"}
moshi-codegen = { module = "com.squareup.moshi:moshi-kotlin-codegen", version.ref = "moshi"}
Expand All@@ -31,9 +35,11 @@ marketplace-client = { module = "org.jetbrains.intellij:plugin-repository-rest-c

[bundles]
serialization = [ "serialization-core", "serialization-json", "serialization-json-okio" ]
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" }
ksp = { id = "com.google.devtools.ksp", version.ref = "ksp"}
gradle-wrapper = { id = "me.filippov.gradle.jvm.wrapper", version.ref = "gradle-wrapper" }
Binary file modifiedgradle/wrapper/gradle-wrapper.jar
View file
Open in desktop
Binary file not shown.
3 changes: 2 additions & 1 deletiongradle/wrapper/gradle-wrapper.properties
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
26 changes: 16 additions & 10 deletionsgradlew
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

##############################################################################
#
Expand DownExpand Up@@ -55,7 +57,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand DownExpand Up@@ -83,7 +85,8 @@ done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand DownExpand Up@@ -130,26 +133,29 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi

# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand DownExpand Up@@ -198,11 +204,11 @@ fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command;
# *$DEFAULT_JVM_OPTS,$JAVA_OPTS, and$GRADLE_OPTS cancontainfragments of
#shell script including quotesandvariable substitutions, so put them in
# double quotes to make sure that they get re-expanded;and
#* put everything else in single quotes, so that it's not re-expanded.
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS,JAVA_OPTS,andoptsEnvironmentVar are not allowed tocontainshell fragments,
# andany embedded shellness will be escaped.
#* For example: A user cannot expect ${Hostname} to beexpanded, as it is an environment variableand will be
# treated as '${Hostname}' itself on the command line.

set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
Expand Down
22 changes: 12 additions & 10 deletionsgradlew.bat
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem

@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
Expand DownExpand Up@@ -43,11 +45,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand All@@ -57,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand Down
36 changes: 18 additions & 18 deletionssrc/main/kotlin/com/coder/gateway/CoderGatewayExtension.kt
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
package com.coder.gateway

import com.jetbrains.toolbox.gateway.GatewayExtension
import com.jetbrains.toolbox.gateway.PluginSecretStore
import com.jetbrains.toolbox.gateway.PluginSettingsStore
import com.jetbrains.toolbox.gateway.RemoteEnvironmentConsumer
import com.jetbrains.toolbox.gateway.RemoteProvider
import com.jetbrains.toolbox.gateway.ToolboxServiceLocator
import com.jetbrains.toolbox.gateway.ui.ObservablePropertiesFactory
import com.jetbrains.toolbox.gateway.ui.ToolboxUi
import com.jetbrains.toolbox.api.core.PluginSecretStore
import com.jetbrains.toolbox.api.core.PluginSettingsStore
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 com.jetbrains.toolbox.api.ui.ToolboxUi
import kotlinx.coroutines.CoroutineScope
import okhttp3.OkHttpClient

/**
* Entry point into the extension.
*/
class CoderGatewayExtension :GatewayExtension {
class CoderGatewayExtension :RemoteDevExtension {
// All services must be passed in here and threaded as necessary.
override fun createRemoteProviderPluginInstance(serviceLocator: ToolboxServiceLocator): RemoteProvider = CoderRemoteProvider(
serviceLocator.getService(OkHttpClient::class.java),
serviceLocator.getService(RemoteEnvironmentConsumer::class.java),
serviceLocator.getService(CoroutineScope::class.java),
serviceLocator.getService(ToolboxUi::class.java),
serviceLocator.getService(PluginSettingsStore::class.java),
serviceLocator.getService(PluginSecretStore::class.java),
serviceLocator.getService(ObservablePropertiesFactory::class.java),
)
override fun createRemoteProviderPluginInstance(serviceLocator: ServiceLocator): RemoteProvider {
return CoderRemoteProvider(
OkHttpClient(),
serviceLocator.getService(RemoteEnvironmentConsumer::class.java),
serviceLocator.getService(CoroutineScope::class.java),
serviceLocator.getService(ToolboxUi::class.java),
serviceLocator.getService(PluginSettingsStore::class.java),
serviceLocator.getService(PluginSecretStore::class.java),
)
}
}
Loading
Loading

[8]ページ先頭

©2009-2025 Movatter.jp