From fb69d99aaaea11b21e06d808d4c2f8fb9ee50f9f Mon Sep 17 00:00:00 2001 From: Mehul <65443164+infiniteregrets@users.noreply.github.com> Date: Tue, 6 Sep 2022 18:50:13 -0400 Subject: [PATCH] IntelliJ Extension: Fix shared library paths (#352) * Fix sharedlib paths --- CHANGELOG.md | 2 +- intellij-ext/build.gradle.kts | 33 ++++++++----------- .../metalbear/mirrord/MirrordDefaultData.kt | 2 +- 3 files changed, 16 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f0870ba6fb..0a97be2f4ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how - Fix bug where VS Code extension would crash on startup due to new configuration values not being the correct type. - Unset DYLD_INSERT_LIBRARIES/LD_PRELOAD when creating the agent. Closes [[#330](https://github.com/metalbear-co/mirrord/issues/330)]. - Fix NullPointerException in IntelliJ Extension. Closes [[#335](https://github.com/metalbear-co/mirrord/issues/335)]. - +- FIx dylib/so paths for the IntelliJ Extension. Closes [[#337](https://github.com/metalbear-co/mirrord/pull/352)]. ## 2.12.0 ### Added - Add more configuration values to the VS Code extension. diff --git a/intellij-ext/build.gradle.kts b/intellij-ext/build.gradle.kts index 67a098e2203..4010ad83f39 100644 --- a/intellij-ext/build.gradle.kts +++ b/intellij-ext/build.gradle.kts @@ -25,7 +25,7 @@ repositories { } dependencies { implementation("io.kubernetes:client-java:16.0.0") { - exclude(group="org.slf4j", module = "slf4j-api") + exclude(group = "org.slf4j", module = "slf4j-api") } } @@ -69,31 +69,26 @@ tasks { // Extract the section from README.md and provide for the plugin's manifest pluginDescription.set( - projectDir.resolve("README.md").readText().lines().run { - val start = "" - val end = "" + projectDir.resolve("README.md").readText().lines().run { + val start = "" + val end = "" - if (!containsAll(listOf(start, end))) { - throw GradleException("Plugin description section not found in README.md:\n$start ... $end") - } - subList(indexOf(start) + 1, indexOf(end)) - }.joinToString("\n").run { markdownToHTML(this) } + if (!containsAll(listOf(start, end))) { + throw GradleException("Plugin description section not found in README.md:\n$start ... $end") + } + subList(indexOf(start) + 1, indexOf(end)) + }.joinToString("\n").run { markdownToHTML(this) } ) } prepareSandbox { - doLast { - copy { - from(file("$projectDir/libmirrord_layer.dylib")) - into(file("$buildDir/idea-sandbox/config")) - } - copy { - from(file("$projectDir/libmirrord_layer.so")) - into(file("$buildDir/idea-sandbox/config")) - } + from(file("$projectDir/libmirrord_layer.dylib")) { + into(pluginName.get()) + } + from(file("$projectDir/libmirrord_layer.so")) { + into(pluginName.get()) } } - // Configure UI tests plugin // Read more: https://github.com/JetBrains/intellij-ui-test-robot runIdeForUiTests { diff --git a/intellij-ext/src/main/kotlin/com/metalbear/mirrord/MirrordDefaultData.kt b/intellij-ext/src/main/kotlin/com/metalbear/mirrord/MirrordDefaultData.kt index 8fe8bbc3843..1173d3150c8 100644 --- a/intellij-ext/src/main/kotlin/com/metalbear/mirrord/MirrordDefaultData.kt +++ b/intellij-ext/src/main/kotlin/com/metalbear/mirrord/MirrordDefaultData.kt @@ -8,5 +8,5 @@ data class MirrordDefaultData(val ldPreloadPath: String, val dylibPath: String, } private fun getSharedLibPath(libName: String): String { - return Paths.get(PathManager.getConfigPath(), libName).toString() + return Paths.get(PathManager.getPluginsPath(), "mirrord", libName).toString() }