mirror of
https://github.com/jlengrand/compose-multiplatform.git
synced 2026-03-10 08:11:20 +00:00
* Add example of using Compose for Intellij plugin * Add instruction on how to use Compose for Intellij plugin
Compose for IDE Plugin Development
This is an experimental plugin, enabling Intellij plugin development with Compose. For now, it only provides Compose runtime classes and native libraries, so they can be reused by different plugins.
Usage
The following steps assume gradle-intellij-plugin is used for Intellij plugin development:
- Add Compose as
compileOnlydependency to your plugin's dependencies. - Add the platform plugin's ID to
intellijblock in a Gradle script and to aplugin.xml. - Add
kotlin.stdlib.default.dependency=falsetogradle.properties. - Use
runIdeGradle task to run a test IDE.
// build.gradle.kts
import org.jetbrains.compose.compose
plugins {
id("org.jetbrains.intellij") version "1.3.0"
id("org.jetbrains.kotlin.jvm") version "1.6.10"
id("org.jetbrains.compose") version "1.0.1"
}
repositories {
mavenCentral()
}
dependencies {
compileOnly(compose.desktop.currentOs)
}
// See https://github.com/JetBrains/gradle-intellij-plugin/
intellij {
pluginName.set("Example plugin name")
version.set("2021.3")
plugins.set(listOf("org.jetbrains.compose.intellij.platform:0.1.0"))
}
<!-- src/main/resources/META-INF/plugin.xml -->
<idea-plugin>
<id>com.jetbrains.ComposeDemoPlugin</id>
<name>Jetpack Compose for Desktop Demo</name>
<vendor>Demo Vendor</vendor>
<description>...</description>
<depends>com.intellij.modules.platform</depends>
<depends>org.jetbrains.compose.intellij.platform</depends>
</idea-plugin>
A complete example can be found at examples/intellij-plugin-with-experimental-shared-base.