Add CLion plugin assets generated by vbs ide plugin
This commit is contained in:
1 parent
4fdec4b684
commit
ef9e8e4422
4 files changed
+83
-1
No files matched your search
@@ -1,3 +1,18 @@
|
|||||||
# VbsCLion
|
# VbsCLion
|
||||||
|
|
||||||
CLion (JetBrains) plugin assets for VoidBuildSystem, generated by `vbs ide plugin`.
|
CLion (JetBrains) plugin assets for VoidBuildSystem (VBS), generated by:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
vbs ide plugin --editor clion --output ./
|
||||||
|
```
|
||||||
|
|
||||||
|
CLion can also read the CMake File API document emitted by `vbs ide generate`, so this plugin is
|
||||||
|
complementary: it adds Tools-menu actions for `vbs build` and `vbs install`.
|
||||||
|
|
||||||
|
## Build
|
||||||
|
|
||||||
|
```sh
|
||||||
|
./gradlew buildPlugin
|
||||||
|
```
|
||||||
|
|
||||||
|
Set `VBS_BIN` if `vbs` is not on `PATH`.
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
plugins {
|
||||||
|
kotlin("jvm") version "2.0.21"
|
||||||
|
id("org.jetbrains.intellij.platform") version "2.1.0"
|
||||||
|
}
|
||||||
|
|
||||||
|
group = "com.faumaray"
|
||||||
|
version = "0.1.0"
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
intellijPlatform { defaultRepositories() }
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
intellijPlatform { create("CL", "2024.2") }
|
||||||
|
}
|
||||||
|
|
||||||
|
intellijPlatform {
|
||||||
|
pluginConfiguration { ideaVersion { sinceBuild = "242" } }
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package com.faumaray.vbs
|
||||||
|
|
||||||
|
import com.intellij.execution.configurations.GeneralCommandLine
|
||||||
|
import com.intellij.execution.process.OSProcessHandler
|
||||||
|
import com.intellij.openapi.actionSystem.AnAction
|
||||||
|
import com.intellij.openapi.actionSystem.AnActionEvent
|
||||||
|
import com.intellij.openapi.project.Project
|
||||||
|
|
||||||
|
private fun runVbs(project: Project, title: String, args: List<String>) {
|
||||||
|
val command = GeneralCommandLine(listOf(System.getenv("VBS_BIN") ?: "vbs") + args)
|
||||||
|
.withWorkDirectory(project.basePath)
|
||||||
|
val handler = OSProcessHandler(command)
|
||||||
|
handler.startNotify()
|
||||||
|
println("[$title] ${command.commandLineString}")
|
||||||
|
}
|
||||||
|
|
||||||
|
class BuildAction : AnAction("VBS: Build") {
|
||||||
|
override fun actionPerformed(event: AnActionEvent) {
|
||||||
|
event.project?.let { runVbs(it, "build", listOf("build")) }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class InstallAction : AnAction("VBS: Install") {
|
||||||
|
override fun actionPerformed(event: AnActionEvent) {
|
||||||
|
event.project?.let {
|
||||||
|
runVbs(it, "install", listOf("install", "--prefix", "build/install"))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
<idea-plugin>
|
||||||
|
<id>com.faumaray.vbs</id>
|
||||||
|
<name>VoidBuildSystem</name>
|
||||||
|
<vendor>Void</vendor>
|
||||||
|
<description>Build, test, install and package with VoidBuildSystem (VBS).</description>
|
||||||
|
<depends>com.intellij.modules.platform</depends>
|
||||||
|
<depends>com.intellij.modules.cidr.lang</depends>
|
||||||
|
<actions>
|
||||||
|
<action id="Vbs.Build" class="com.faumaray.vbs.BuildAction"
|
||||||
|
text="VBS: Build" description="Run vbs build in the project root">
|
||||||
|
<add-to-group group-id="ToolsMenu" anchor="first"/>
|
||||||
|
</action>
|
||||||
|
<action id="Vbs.Install" class="com.faumaray.vbs.InstallAction"
|
||||||
|
text="VBS: Install" description="Stage an install prefix">
|
||||||
|
<add-to-group group-id="ToolsMenu" anchor="after" relative-to-action="Vbs.Build"/>
|
||||||
|
</action>
|
||||||
|
</actions>
|
||||||
|
</idea-plugin>
|
||||||
Reference in new issue
Block a user