mirror of
https://github.com/JetBrains/intellij-platform-plugin-template.git
synced 2026-09-23 20:36:31 +00:00
86 lines
3.1 KiB
Kotlin
86 lines
3.1 KiB
Kotlin
import org.jetbrains.changelog.Changelog
|
|
import org.jetbrains.changelog.markdownToHTML
|
|
import org.jetbrains.intellij.platform.gradle.TestFrameworkType
|
|
|
|
plugins {
|
|
alias(libs.plugins.kotlin) // Kotlin support
|
|
alias(libs.plugins.intelliJPlatform) // IntelliJ Platform Gradle Plugin
|
|
alias(libs.plugins.changelog) // Gradle Changelog Plugin
|
|
}
|
|
|
|
// Dependencies are managed with Gradle version catalog - read more: https://docs.gradle.org/current/userguide/version_catalogs.html
|
|
dependencies {
|
|
testImplementation(libs.junit)
|
|
|
|
// IntelliJ Platform Gradle Plugin Dependencies Extension - read more: https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-dependencies-extension.html
|
|
intellijPlatform {
|
|
intellijIdea(providers.gradleProperty("platformVersion"))
|
|
testFramework(TestFrameworkType.Platform)
|
|
}
|
|
}
|
|
|
|
// Configure IntelliJ Platform Gradle Plugin - read more: https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-extension.html
|
|
intellijPlatform {
|
|
pluginConfiguration {
|
|
// Extract the <!-- Plugin description --> section from README.md and provide for the plugin's manifest
|
|
description = providers.fileContents(layout.projectDirectory.file("README.md")).asText.map {
|
|
val start = "<!-- Plugin description -->"
|
|
val end = "<!-- Plugin description end -->"
|
|
|
|
with(it.lines()) {
|
|
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").let(::markdownToHTML)
|
|
}
|
|
}
|
|
|
|
val changelog = project.changelog // local variable for configuration cache compatibility
|
|
// Get the latest available change notes from the changelog file
|
|
changeNotes = providers.gradleProperty("pluginVersion").map { pluginVersion ->
|
|
with(changelog) {
|
|
renderItem(
|
|
(getOrNull(pluginVersion) ?: getUnreleased())
|
|
.withHeader(false)
|
|
.withEmptySections(false),
|
|
Changelog.OutputType.HTML,
|
|
)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
// Configure Gradle Changelog Plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin
|
|
changelog {
|
|
groups.empty()
|
|
repositoryUrl = providers.gradleProperty("pluginRepositoryUrl")
|
|
versionPrefix = ""
|
|
}
|
|
|
|
tasks {
|
|
publishPlugin {
|
|
dependsOn(patchChangelog)
|
|
}
|
|
}
|
|
|
|
intellijPlatformTesting {
|
|
runIde {
|
|
register("runIdeForUiTests") {
|
|
task {
|
|
jvmArgumentProviders += CommandLineArgumentProvider {
|
|
listOf(
|
|
"-Drobot-server.port=8082",
|
|
"-Dide.mac.message.dialogs.as.sheets=false",
|
|
"-Djb.privacy.policy.text=<!--999.999-->",
|
|
"-Djb.consents.confirmation.enabled=false",
|
|
)
|
|
}
|
|
}
|
|
|
|
plugins {
|
|
robotServerPlugin()
|
|
}
|
|
}
|
|
}
|
|
}
|