mirror of
https://github.com/JetBrains/intellij-platform-plugin-template.git
synced 2024-10-27 20:44:05 +00:00
commit
01efb95680
4
.github/template-cleanup/gradle.properties
vendored
4
.github/template-cleanup/gradle.properties
vendored
@ -15,8 +15,10 @@ platformType = IC
|
||||
platformVersion = 2023.2.7
|
||||
|
||||
# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
|
||||
# Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22
|
||||
# Example: platformPlugins = com.jetbrains.php:203.4449.22, org.intellij.scala:2023.3.27@EAP
|
||||
platformPlugins =
|
||||
# Example: platformBundledPlugins = com.intellij.java
|
||||
platformBundledPlugins =
|
||||
|
||||
# Gradle Releases -> https://github.com/gradle/gradle/releases
|
||||
gradleVersion = 8.9
|
||||
|
4
.github/workflows/build.yml
vendored
4
.github/workflows/build.yml
vendored
@ -73,8 +73,6 @@ jobs:
|
||||
echo "$CHANGELOG" >> $GITHUB_OUTPUT
|
||||
echo "EOF" >> $GITHUB_OUTPUT
|
||||
|
||||
./gradlew listProductsReleases # prepare list of IDEs for Plugin Verifier
|
||||
|
||||
# Build plugin
|
||||
- name: Build plugin
|
||||
run: ./gradlew buildPlugin
|
||||
@ -214,7 +212,7 @@ jobs:
|
||||
|
||||
# Run Verify Plugin task and IntelliJ Plugin Verifier tool
|
||||
- name: Run Plugin Verification tasks
|
||||
run: ./gradlew runPluginVerifier -Dplugin.verifier.home.dir=${{ needs.build.outputs.pluginVerifierHomeDir }}
|
||||
run: ./gradlew verifyPlugin -Dplugin.verifier.home.dir=${{ needs.build.outputs.pluginVerifierHomeDir }}
|
||||
|
||||
# Collect Plugin Verifier Result
|
||||
- name: Collect Plugin Verifier Result
|
||||
|
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@ -51,7 +51,7 @@ jobs:
|
||||
echo "$CHANGELOG" >> $GITHUB_OUTPUT
|
||||
echo "EOF" >> $GITHUB_OUTPUT
|
||||
|
||||
# Update Unreleased section with the current release note
|
||||
# Update the Unreleased section with the current release note
|
||||
- name: Patch Changelog
|
||||
if: ${{ steps.properties.outputs.changelog != '' }}
|
||||
env:
|
||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,4 +1,5 @@
|
||||
.gradle
|
||||
.idea
|
||||
.intellijPlatform
|
||||
.qodana
|
||||
build
|
||||
|
@ -1,25 +0,0 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Run IDE for UI Tests" type="GradleRunConfiguration" factoryName="Gradle">
|
||||
<log_file alias="idea.log" path="$PROJECT_DIR$/build/idea-sandbox/system/log/idea.log" />
|
||||
<ExternalSystemSettings>
|
||||
<option name="executionName" />
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="externalSystemIdString" value="GRADLE" />
|
||||
<option name="scriptParameters" value="" />
|
||||
<option name="taskDescriptions">
|
||||
<list />
|
||||
</option>
|
||||
<option name="taskNames">
|
||||
<list>
|
||||
<option value="runIdeForUiTests" />
|
||||
</list>
|
||||
</option>
|
||||
<option name="vmOptions" />
|
||||
</ExternalSystemSettings>
|
||||
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
|
||||
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
|
||||
<DebugAllEnabled>false</DebugAllEnabled>
|
||||
<RunAsTest>false</RunAsTest>
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
@ -1,24 +0,0 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Run Qodana" type="GradleRunConfiguration" factoryName="Gradle">
|
||||
<ExternalSystemSettings>
|
||||
<option name="executionName" />
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="externalSystemIdString" value="GRADLE" />
|
||||
<option name="scriptParameters" value="" />
|
||||
<option name="taskDescriptions">
|
||||
<list />
|
||||
</option>
|
||||
<option name="taskNames">
|
||||
<list>
|
||||
<option value="qodanaScan" />
|
||||
</list>
|
||||
</option>
|
||||
<option name="vmOptions" />
|
||||
</ExternalSystemSettings>
|
||||
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
|
||||
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
|
||||
<DebugAllEnabled>false</DebugAllEnabled>
|
||||
<RunAsTest>false</RunAsTest>
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
@ -11,7 +11,7 @@
|
||||
</option>
|
||||
<option name="taskNames">
|
||||
<list>
|
||||
<option value="runPluginVerifier" />
|
||||
<option value="verifyPlugin" />
|
||||
</list>
|
||||
</option>
|
||||
<option name="vmOptions" value="" />
|
||||
@ -19,8 +19,7 @@
|
||||
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
|
||||
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
|
||||
<DebugAllEnabled>false</DebugAllEnabled>
|
||||
<method v="2">
|
||||
<option name="Gradle.BeforeRunTask" enabled="true" tasks="clean" externalProjectPath="$PROJECT_DIR$" vmOptions="" scriptParameters="" />
|
||||
</method>
|
||||
<RunAsTest>false</RunAsTest>
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
@ -4,6 +4,10 @@
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Changed
|
||||
|
||||
- Migrate to [IntelliJ Platform Gradle Plugin 2.0](https://blog.jetbrains.com/platform/2024/07/intellij-platform-gradle-plugin-2-0/).
|
||||
|
||||
## [1.14.2] - 2024-07-12
|
||||
|
||||
### Changed
|
||||
@ -47,7 +51,7 @@
|
||||
|
||||
- Dependencies - upgrade `org.jetbrains.kotlin.jvm` to `1.9.23`
|
||||
- Dependencies - upgrade `org.jetbrains.kotlinx.kover` to `0.7.6`
|
||||
- Dependencies - upgrade `org.jetbrains.qodana` to `2023.3.1`
|
||||
- Dependencies - upgrade `org.jetbrains.qodana` to `2023.3.2`
|
||||
- Dependencies (GitHub Actions) - upgrade `actions/upload-artifact` to `4`
|
||||
- Dependencies (GitHub Actions) - upgrade `codecov/codecov-action` to `4`
|
||||
- Dependencies (GitHub Actions) - upgrade `gradle/wrapper-validation-action` to `2`
|
||||
|
189
build.gradle.kts
189
build.gradle.kts
@ -1,50 +1,118 @@
|
||||
import org.jetbrains.changelog.Changelog
|
||||
import org.jetbrains.changelog.markdownToHTML
|
||||
|
||||
fun properties(key: String) = providers.gradleProperty(key)
|
||||
fun environment(key: String) = providers.environmentVariable(key)
|
||||
import org.jetbrains.intellij.platform.gradle.Constants.Constraints
|
||||
import org.jetbrains.intellij.platform.gradle.TestFrameworkType
|
||||
|
||||
plugins {
|
||||
id("java") // Java support
|
||||
alias(libs.plugins.kotlin) // Kotlin support
|
||||
alias(libs.plugins.gradleIntelliJPlugin) // Gradle IntelliJ Plugin
|
||||
alias(libs.plugins.intelliJPlatform) // IntelliJ Platform Gradle Plugin
|
||||
alias(libs.plugins.changelog) // Gradle Changelog Plugin
|
||||
alias(libs.plugins.qodana) // Gradle Qodana Plugin
|
||||
alias(libs.plugins.kover) // Gradle Kover Plugin
|
||||
}
|
||||
|
||||
group = properties("pluginGroup").get()
|
||||
version = properties("pluginVersion").get()
|
||||
|
||||
// Configure project's dependencies
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
// Dependencies are managed with Gradle version catalog - read more: https://docs.gradle.org/current/userguide/platforms.html#sub:version-catalog
|
||||
dependencies {
|
||||
// implementation(libs.exampleLibrary)
|
||||
}
|
||||
group = providers.gradleProperty("pluginGroup").get()
|
||||
version = providers.gradleProperty("pluginVersion").get()
|
||||
|
||||
// Set the JVM language level used to build the project.
|
||||
kotlin {
|
||||
jvmToolchain(17)
|
||||
}
|
||||
|
||||
// Configure Gradle IntelliJ Plugin - read more: https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
|
||||
intellij {
|
||||
pluginName = properties("pluginName")
|
||||
version = properties("platformVersion")
|
||||
type = properties("platformType")
|
||||
// Configure project's dependencies
|
||||
repositories {
|
||||
mavenCentral()
|
||||
|
||||
// Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file.
|
||||
plugins = properties("platformPlugins").map { it.split(',').map(String::trim).filter(String::isNotEmpty) }
|
||||
// IntelliJ Platform Gradle Plugin Repositories Extension - read more: https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-repositories-extension.html
|
||||
intellijPlatform {
|
||||
defaultRepositories()
|
||||
}
|
||||
}
|
||||
|
||||
// Dependencies are managed with Gradle version catalog - read more: https://docs.gradle.org/current/userguide/platforms.html#sub:version-catalog
|
||||
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 {
|
||||
create(providers.gradleProperty("platformType"), providers.gradleProperty("platformVersion"))
|
||||
|
||||
// Plugin Dependencies. Uses `platformBundledPlugins` property from the gradle.properties file for bundled IntelliJ Platform plugins.
|
||||
bundledPlugins(providers.gradleProperty("platformBundledPlugins").map { it.split(',') })
|
||||
|
||||
// Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file for plugin from JetBrains Marketplace.
|
||||
plugins(providers.gradleProperty("platformPlugins").map { it.split(',') })
|
||||
|
||||
instrumentationTools()
|
||||
pluginVerifier()
|
||||
zipSigner()
|
||||
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 {
|
||||
version = providers.gradleProperty("pluginVersion")
|
||||
|
||||
// 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,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
ideaVersion {
|
||||
sinceBuild = providers.gradleProperty("pluginSinceBuild")
|
||||
untilBuild = providers.gradleProperty("pluginUntilBuild")
|
||||
}
|
||||
}
|
||||
|
||||
signing {
|
||||
certificateChain = providers.environmentVariable("CERTIFICATE_CHAIN")
|
||||
privateKey = providers.environmentVariable("PRIVATE_KEY")
|
||||
password = providers.environmentVariable("PRIVATE_KEY_PASSWORD")
|
||||
}
|
||||
|
||||
publishing {
|
||||
token = providers.environmentVariable("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:
|
||||
// https://plugins.jetbrains.com/docs/intellij/deployment.html#specifying-a-release-channel
|
||||
channels = providers.gradleProperty("pluginVersion").map { listOf(it.substringAfter('-', "").substringBefore('.').ifEmpty { "default" }) }
|
||||
}
|
||||
|
||||
pluginVerification {
|
||||
ides {
|
||||
recommended()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Configure Gradle Changelog Plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin
|
||||
changelog {
|
||||
groups.empty()
|
||||
repositoryUrl = properties("pluginRepositoryUrl")
|
||||
repositoryUrl = providers.gradleProperty("pluginRepositoryUrl")
|
||||
}
|
||||
|
||||
// Configure Gradle Kover Plugin - read more: https://github.com/Kotlin/kotlinx-kover#configuration
|
||||
@ -60,62 +128,27 @@ kover {
|
||||
|
||||
tasks {
|
||||
wrapper {
|
||||
gradleVersion = properties("gradleVersion").get()
|
||||
}
|
||||
|
||||
patchPluginXml {
|
||||
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 {
|
||||
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 = properties("pluginVersion").map { pluginVersion ->
|
||||
with(changelog) {
|
||||
renderItem(
|
||||
(getOrNull(pluginVersion) ?: getUnreleased())
|
||||
.withHeader(false)
|
||||
.withEmptySections(false),
|
||||
Changelog.OutputType.HTML,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 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")
|
||||
}
|
||||
|
||||
signPlugin {
|
||||
certificateChain = environment("CERTIFICATE_CHAIN")
|
||||
privateKey = environment("PRIVATE_KEY")
|
||||
password = environment("PRIVATE_KEY_PASSWORD")
|
||||
gradleVersion = providers.gradleProperty("gradleVersion").get()
|
||||
}
|
||||
|
||||
publishPlugin {
|
||||
dependsOn("patchChangelog")
|
||||
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:
|
||||
// https://plugins.jetbrains.com/docs/intellij/deployment.html#specifying-a-release-channel
|
||||
channels = properties("pluginVersion").map { listOf(it.substringAfter('-', "").substringBefore('.').ifEmpty { "default" }) }
|
||||
dependsOn(patchChangelog)
|
||||
}
|
||||
}
|
||||
|
||||
val runIdeForUiTests by intellijPlatformTesting.runIde.registering {
|
||||
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(Constraints.LATEST_VERSION)
|
||||
}
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ pluginGroup = org.jetbrains.plugins.template
|
||||
pluginName = IntelliJ Platform Plugin Template
|
||||
pluginRepositoryUrl = https://github.com/JetBrains/intellij-platform-plugin-template
|
||||
# SemVer format -> https://semver.org
|
||||
pluginVersion = 1.14.2
|
||||
pluginVersion = 2.0.0
|
||||
|
||||
# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
|
||||
pluginSinceBuild = 232
|
||||
@ -15,8 +15,10 @@ platformType = IC
|
||||
platformVersion = 2023.2.7
|
||||
|
||||
# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
|
||||
# Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22
|
||||
# Example: platformPlugins = com.jetbrains.php:203.4449.22, org.intellij.scala:2023.3.27@EAP
|
||||
platformPlugins =
|
||||
# Example: platformBundledPlugins = com.intellij.java
|
||||
platformBundledPlugins =
|
||||
|
||||
# Gradle Releases -> https://github.com/gradle/gradle/releases
|
||||
gradleVersion = 8.9
|
||||
|
@ -1,20 +1,20 @@
|
||||
[versions]
|
||||
# libraries
|
||||
exampleLibrary = "24.1.0"
|
||||
junit = "4.13.2"
|
||||
|
||||
# plugins
|
||||
changelog = "2.2.1"
|
||||
intelliJPlatform = "2.0.0"
|
||||
kotlin = "1.9.24"
|
||||
changelog = "2.2.0"
|
||||
gradleIntelliJPlugin = "1.17.4"
|
||||
qodana = "2024.1.5"
|
||||
kover = "0.8.1"
|
||||
qodana = "2024.1.5"
|
||||
|
||||
[libraries]
|
||||
exampleLibrary = { group = "com.example", name = "exampleLibrary", version.ref = "exampleLibrary" }
|
||||
junit = { group = "junit", name = "junit", version.ref = "junit" }
|
||||
|
||||
[plugins]
|
||||
changelog = { id = "org.jetbrains.changelog", version.ref = "changelog" }
|
||||
gradleIntelliJPlugin = { id = "org.jetbrains.intellij", version.ref = "gradleIntelliJPlugin" }
|
||||
intelliJPlatform = { id = "org.jetbrains.intellij.platform", version.ref = "intelliJPlatform" }
|
||||
kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
|
||||
kover = { id = "org.jetbrains.kotlinx.kover", version.ref = "kover" }
|
||||
qodana = { id = "org.jetbrains.qodana", version.ref = "qodana" }
|
||||
|
@ -1,5 +1 @@
|
||||
plugins {
|
||||
id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0"
|
||||
}
|
||||
|
||||
rootProject.name = "IntelliJ Platform Plugin Template"
|
||||
|
Loading…
Reference in New Issue
Block a user