2025-05-07 17:16:15 +02:00

4.4 KiB

CLion Plugin Development

Introduction to developing plugins for CLion.

CLion is an IntelliJ Platform-based product. Plugin projects for CLion can be developed using IntelliJ IDEA.

CLion is free for non-commercial use

CLion Plugin Setup

Gradle Build Script

Define a dependency using clion(), see Versions link on top of this page for all available versions. See for using a local installation.

A dependency on the bundled com.intellij.clion plugin must be added using the bundledPlugin() helper.

Minimum build.gradle.kts setup:

repositories {
  mavenCentral()
  intellijPlatform {
    defaultRepositories()
  }
}

dependencies {
  intellijPlatform {
    clion("<versionNumber>")
    bundledPlugin("com.intellij.clion")
  }
}

When targeting 2020.3, see this migration guide.

{style="warning"}

The configuration of CLion plugin projects follows the methods described in Configuring Plugin Projects using a Product-Specific Attribute, and Configuring the plugin.xml File.

The table below summarizes the attributes to set in the plugin project's Gradle build script. Click on an entry in the table's Attribute column to go to the documentation about that attribute.

gradle-intellij-plugin Attribute Attribute Value
intellij.type CL for the product CLion.
intellij.version Set to the targeted CLion version, e.g. 2019.3.1.
intellij.plugins No specific declaration is needed.
intellij.downloadSources false is required because no public source code is available.
runIde.ideDir Not needed; the Development Instance will automatically match intellij.type.

plugin.xml

The dependency on the CLion APIs must be declared in the plugin.xml file. As described in Modules Specific to Functionality table, the <depends> tags must declare com.intellij.modules.clion module dependency, or com.intellij.clion plugin dependency when targeting only versions 2020.3+.

Available CLion APIs

See for the complete list.

{style="note"}

Use the Exploring APIs as a Consumer process to identify the JAR files under the External Library Gradle:com.jetbrains:clion:<version>. Test your plugin with versions of CLion you intend to support.

Open Source Plugins for CLion

When learning new APIs, it is helpful to have some representative projects for reference: