Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ build

# Ignore IntelliJ AI rules
.github/copilot-instructions.md

CLAUDE.md
113 changes: 65 additions & 48 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ fun environment(key: String) = providers.environmentVariable(key)
plugins {
id("java") // Java support
alias(libs.plugins.kotlin)
alias(libs.plugins.gradleIntelliJPlugin)
alias(libs.plugins.intellijPlatformGradlePlugin)
alias(libs.plugins.changelog)
alias(libs.plugins.kover)
}
Expand All @@ -19,6 +19,9 @@ version = properties("pluginVersion").get()
repositories {
mavenCentral()
maven("https://cache-redirector.jetbrains.com/intellij-dependencies")
intellijPlatform {
defaultRepositories()
}
}

// Dependencies are managed with Gradle version catalog - read more: https://docs.gradle.org/current/userguide/platforms.html#sub:version-catalog
Expand All @@ -28,6 +31,16 @@ dependencies {
implementation(libs.qodana.sarif)
implementation("com.segment.analytics.kotlin:core:1.21.0")
// implementation("com.jetbrains.qodana:qodana-sarif:0.2.8")

intellijPlatform {
create(properties("platformType"), properties("platformVersion"))
bundledPlugins(properties("platformBundledPlugins").map {
it.split(',').map(String::trim).filter(String::isNotEmpty)
})
plugins(properties("platformPlugins").map {
it.split(',').map(String::trim).filter(String::isNotEmpty)
})
}
}

// Set the JVM language level used to build the project. Use Java 11 for 2020.3+, and Java 17 for 2022.2+.
Expand All @@ -38,49 +51,18 @@ kotlin {
}
}

// Gradle IntelliJ Plugin (https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html)
intellij {
pluginName = properties("pluginName")
version = properties("platformVersion")
type = properties("platformType")

// Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file.
plugins = properties("platformPlugins").map {
it.split(',').map(String::trim).filter(String::isNotEmpty)
}
}

java {
sourceCompatibility = JavaVersion.VERSION_17
}

// Configure Gradle Changelog Plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin
changelog {
groups.empty()
repositoryUrl = properties("pluginRepositoryUrl")
}

// Configure Gradle Kover Plugin - read more: https://github.com/Kotlin/kotlinx-kover#configuration
koverReport {
defaults {
xml {
onCheck = true
}
}
}

tasks {
wrapper {
gradleVersion = properties("gradleVersion").get()
}

patchPluginXml {
// IntelliJ Platform Gradle Plugin (https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin.html)
intellijPlatform {
pluginConfiguration {
name = properties("pluginName")
version = properties("pluginVersion")
sinceBuild = properties("pluginSinceBuild")
untilBuild = properties("pluginUntilBuild")

// Extract the <!-- Plugin description --> section from README.md and provide for the plugin's manifest
pluginDescription = providers.fileContents(layout.projectDirectory.file("README.md")).asText.map {
description = providers.fileContents(layout.projectDirectory.file("README.md")).asText.map {
val start = "<!-- Plugin description -->"
val end = "<!-- Plugin description end -->"

Expand All @@ -102,25 +84,20 @@ tasks {
)
}
}
}

// Configure UI tests plugin
// Read more: https://github.com/JetBrains/intellij-ui-test-robot
runIdeForUiTests {
systemProperty("robot-server.port", "8082")
systemProperty("ide.mac.message.dialogs.as.sheets", "false")
systemProperty("jb.privacy.policy.text", "<!--999.999-->")
systemProperty("jb.consents.confirmation.enabled", "false")
ideaVersion {
sinceBuild = properties("pluginSinceBuild")
untilBuild = provider { null }
}
}

signPlugin {
signing {
certificateChain = environment("CERTIFICATE_CHAIN")
privateKey = environment("PRIVATE_KEY")
password = environment("PRIVATE_KEY_PASSWORD")
}

publishPlugin {
dependsOn("patchChangelog")
publishing {
token = environment("PUBLISH_TOKEN")
// The pluginVersion is based on the SemVer (https://semver.org) and supports pre-release labels, like 2.1.7-alpha.3
// Specify pre-release label to publish the plugin in a custom Release Channel automatically. Read more:
Expand All @@ -130,3 +107,43 @@ tasks {
}
}
}

// Configure Gradle Changelog Plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin
changelog {
groups.empty()
repositoryUrl = properties("pluginRepositoryUrl")
}

// Configure Gradle Kover Plugin - read more: https://github.com/Kotlin/kotlinx-kover#configuration
koverReport {
defaults {
xml {
onCheck = true
}
}
}

tasks {
wrapper {
gradleVersion = properties("gradleVersion").get()
}

publishPlugin {
dependsOn(patchChangelog)
}
}

// Configure UI tests plugin
// Read more: https://github.com/JetBrains/intellij-ui-test-robot
intellijPlatformTesting {
runIde {
register("runIdeForUiTests") {
task {
systemProperty("robot-server.port", "8082")
systemProperty("ide.mac.message.dialogs.as.sheets", "false")
systemProperty("jb.privacy.policy.text", "<!--999.999-->")
systemProperty("jb.consents.confirmation.enabled", "false")
}
}
}
}
9 changes: 5 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@ pluginVersion = 0.0.11

# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
pluginSinceBuild = 223
pluginUntilBuild = 253.*

# IntelliJ Platform Properties -> https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#configuration-intellij-extension
# IntelliJ Platform Properties -> https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin.html#configuration-intellij-extension
platformType = IC
platformVersion = 2022.3.3

# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
# Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22
platformPlugins = Git4Idea,com.intellij.java
# Bundled plugins (shipped with the IDE) - use plugin IDs discoverable via the printBundledPlugins task
platformBundledPlugins = Git4Idea,com.intellij.java
# Marketplace plugins - format: pluginId:version
platformPlugins =

# Gradle Releases -> https://github.com/gradle/gradle/releases
gradleVersion = 8.5
Expand Down
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ annotations = "24.1.0"
# plugins
kotlin = "1.9.22"
changelog = "2.2.0"
gradleIntelliJPlugin = "1.17.0"
intellijPlatformGradlePlugin = "2.11.0"
kover = "0.7.5"

[libraries]
Expand All @@ -15,6 +15,6 @@ annotations = { group = "org.jetbrains", name = "annotations", version.ref = "an

[plugins]
changelog = { id = "org.jetbrains.changelog", version.ref = "changelog" }
gradleIntelliJPlugin = { id = "org.jetbrains.intellij", version.ref = "gradleIntelliJPlugin" }
intellijPlatformGradlePlugin = { id = "org.jetbrains.intellij.platform", version.ref = "intellijPlatformGradlePlugin" }
kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
kover = { id = "org.jetbrains.kotlinx.kover", version.ref = "kover" }