Explorar el Código

plugin for studio

plugin for studio
Milan Jurkulak hace 1 año
padre
commit
4d3440f165

+ 1 - 0
.intellijPlatform/coroutines-javaagent.lock

@@ -0,0 +1 @@
+251.23774.16.2511.13371696

+ 1 - 0
.intellijPlatform/self-update.lock

@@ -0,0 +1 @@
+2025-04-21

+ 24 - 0
.run/mjdev-desktop [plugin build].run.xml

@@ -0,0 +1,24 @@
+<component name="ProjectRunConfigurationManager">
+  <configuration default="false" name="mjdev-desktop [plugin build]" type="GradleRunConfiguration" factoryName="Gradle">
+    <ExternalSystemSettings>
+      <option name="executionName" />
+      <option name="externalProjectPath" value="/mnt/fe2c4809-fb9c-44f1-aa6e-48b0323031f1/backups/IdeaProjects/mjdev-desktop" />
+      <option name="externalSystemIdString" value="GRADLE" />
+      <option name="scriptParameters" value="" />
+      <option name="taskDescriptions">
+        <list />
+      </option>
+      <option name="taskNames">
+        <list>
+          <option value=":studio-plugin:buildPlugin" />
+        </list>
+      </option>
+      <option name="vmOptions" />
+    </ExternalSystemSettings>
+    <ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
+    <ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
+    <DebugAllEnabled>false</DebugAllEnabled>
+    <RunAsTest>false</RunAsTest>
+    <method v="2" />
+  </configuration>
+</component>

+ 25 - 0
.run/mjdev-desktop [plugin run verifications].run.xml

@@ -0,0 +1,25 @@
+<component name="ProjectRunConfigurationManager">
+  <configuration default="false" name="mjdev-desktop [plugin run verifications]" 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="verifyPlugin" />
+        </list>
+      </option>
+      <option name="vmOptions" value="" />
+    </ExternalSystemSettings>
+    <ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
+    <ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
+    <DebugAllEnabled>false</DebugAllEnabled>
+    <RunAsTest>false</RunAsTest>
+    <method v="2" />
+  </configuration>
+</component>

+ 25 - 0
.run/mjdev-desktop [plugin run].run.xml

@@ -0,0 +1,25 @@
+<component name="ProjectRunConfigurationManager">
+  <configuration default="false" name="mjdev-desktop [plugin run]" type="GradleRunConfiguration" factoryName="Gradle">
+    <log_file alias="IDE logs" path="$PROJECT_DIR$/build/idea-sandbox/*/log/idea.log" show_all="true" />
+    <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="runIde" />
+        </list>
+      </option>
+      <option name="vmOptions" value="" />
+    </ExternalSystemSettings>
+    <ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
+    <ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
+    <DebugAllEnabled>false</DebugAllEnabled>
+    <RunAsTest>false</RunAsTest>
+    <method v="2" />
+  </configuration>
+</component>

+ 18 - 1
build.gradle.kts

@@ -6,4 +6,21 @@ plugins {
     alias(libs.plugins.kotlin.jvm) apply false
     alias(libs.plugins.kotlin.multiplatform) apply false
     alias(libs.plugins.app.icon.generator) apply false
-}
+    alias(libs.plugins.qodana)
+    alias(libs.plugins.kover)
+    alias(libs.plugins.changelog)
+}
+dependencies {
+    kover(project(":composeApp"))
+    kover(project(":shared"))
+}
+
+kover {
+    reports {
+        total {
+            xml {
+                onCheck = true
+            }
+        }
+    }
+}

+ 14 - 1
gradle.properties

@@ -19,4 +19,17 @@ kotlin.mpp.applyDefaultHierarchyTemplate=false
 # build cache
 org.gradle.configuration-cache=true
 org.gradle.configuration-cache.problems=warn
-org.gradle.configuration-cache.parallel=true
+org.gradle.configuration-cache.parallel=true
+# plugin
+pluginGroup = org.mjdev.testplugin
+pluginName = IntelliJ Platform Plugin Test
+pluginRepositoryUrl = -
+pluginVersion = 1.0.0
+pluginDescription = Test plugin for studio
+pluginSinceBuild = 251.23774.16
+pluginUntilBuild = 252.*
+platformType = AI
+platformVersion = 2025.1.1.7
+platformPlugins =
+platformBundledPlugins =
+#

+ 8 - 0
gradle/libs.versions.toml

@@ -44,6 +44,10 @@ generativeai = "0.9.0"
 alert-kmp = "2.0.0"
 #emoji2 = "1.5.0"
 accompanist-permissions = "0.37.2"
+kover = "0.9.1"
+qodana = "2024.3.4"
+intelliJPlatform = "2.5.0"
+changelog = "2.2.1"
 
 [libraries]
 # gradle
@@ -108,3 +112,7 @@ compose-multiplatform = { id = "org.jetbrains.compose", version.ref = "compose-p
 compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
 kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
 kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
+kover = { id = "org.jetbrains.kotlinx.kover", version.ref = "kover" }
+qodana = { id = "org.jetbrains.qodana", version.ref = "qodana" }
+intellij-platform = { id = "org.jetbrains.intellij.platform", version.ref = "intelliJPlatform" }
+changelog = { id = "org.jetbrains.changelog", version.ref = "changelog" }

+ 12 - 0
qodana.yml

@@ -0,0 +1,12 @@
+# Qodana configuration:
+# https://www.jetbrains.com/help/qodana/qodana-yaml.html
+
+version: "1.0"
+linter: jetbrains/qodana-jvm-community:2025.1.1
+projectJDK: "17"
+profile:
+  name: qodana.recommended
+exclude:
+  - name: All
+    paths:
+      - .qodana

+ 1 - 2
settings.gradle.kts

@@ -11,7 +11,6 @@ enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
 //<editor-fold desc="plugin management">------------------------------------------------------------
 pluginManagement {
     repositories {
-        google()
         gradlePluginPortal()
         mavenCentral()
         maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
@@ -43,7 +42,6 @@ pluginManagement {
 //<editor-fold desc="dependency management">--------------------------------------------------------
 dependencyResolutionManagement {
     repositories {
-        google()
         gradlePluginPortal()
         mavenCentral()
         maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
@@ -73,6 +71,7 @@ dependencyResolutionManagement {
 //</editor-fold>------------------------------------------------------------------------------------
 
 //<editor-fold desc="includes">---------------------------------------------------------------------
+include(":studio-plugin")
 include(":composeApp")
 include(":shared")
 //</editor-fold>------------------------------------------------------------------------------------

+ 428 - 0
studio-plugin/CHANGELOG.md

@@ -0,0 +1,428 @@
+<!-- Keep a Changelog guide -> https://keepachangelog.com -->
+
+# IntelliJ Platform Plugin Template Changelog
+
+## [Unreleased]
+
+### Changed
+- Dependencies - upgrade `org.jetbrains.kotlin.jvm` to `1.7.22`
+- Dependencies (GitHub Actions) - upgrade `JetBrains/qodana-action` to `v2022.2.3`
+
+### Fixed
+- Fallback to the unreleased change notes when the plugin in current was not released yet
+
+## [1.3.0] - 2022-11-17
+
+### Added
+- [Kover](https://github.com/Kotlin/kotlinx-kover) integration
+- Enable [Gradle Configuration Cache](https://docs.gradle.org/current/userguide/configuration_cache.html) in `gradle.proeprties`
+- GitHub Actions - mark the pull request created with _Publish Plugin_ workflow with `release changelog` label
+- GitHub Actions - send code coverage reports to [CodeCov](https://codecov.io)
+- Dependencies - upgrade `org.jetbrains.kotlinx.kover` to `0.6.1`
+
+### Changed
+- Update `changelog` extension configuration in `build.gradle.kts` file
+- Update `pluginUntilBuild` to include `223.*` (2022.3.*)
+- Use `kotlin.jvmToolchain(11)` shorthand in Gradle configuration
+- Dependencies - upgrade `org.jetbrains.intellij` to `1.10.0`
+- Dependencies - upgrade `org.jetbrains.changelog` to `2.0.0`
+- Dependencies - upgrade `org.jetbrains.kotlin.jvm` to `1.7.21`
+- Dependencies (GitHub Actions) - upgrade `JetBrains/qodana-action` to `v2022.2.3`
+- Dependencies (GitHub Actions) - upgrade `gradle/wrapper-validation-action` to `v1.0.5`
+- Dependencies (GitHub Actions) - upgrade `jtalk/url-health-check-action` to `v3`
+- Use `file` instead of `projectDir.resolve` in Gradle configuration file
+
+### Fixed
+- Update broken link in `gradle.properties`
+- GitHub Actions - use `$BRANCH` for creating changelog pull request
+
+## [1.2.0] - 2022-08-07
+
+### Added
+- Use JVM toolchain for configuring source/target compilation compatibility
+- Make sure GitHub Actions release jobs have write permissions
+- Example implementation: Add `TODO()` with a hint to remove stale sample code
+- Exclude `.qodana` directory from Qodana analysis
+- Maximize disk space on GitHub Actions
+
+### Changed
+- Upgrade Gradle Wrapper to `7.5.1`
+- Update `platformVersion` to `2021.3.3`
+- Change since/until build to `213-222.*` (2021.3 - 2022.2)
+- Dependencies - upgrade `org.jetbrains.intellij` to `1.8.0`
+- Dependencies - upgrade `org.jetbrains.kotlin.jvm` to `1.7.10`
+- Dependencies (GitHub Actions) - upgrade `actions/checkout` to `3`
+- Dependencies (GitHub Actions) - upgrade `actions/cache` to `3`
+- Dependencies (GitHub Actions) - upgrade `actions/setup-java` to `3`
+- Dependencies (GitHub Actions) - upgrade `actions/upload-artifact` to `3`
+- Dependencies (GitHub Actions) - upgrade `JetBrains/qodana-action` to `v2022.2.1`
+
+### Fixed
+- Pass Plugin Signing secrets as environment variables in the Release workflow
+
+### Removed
+- Removed Gradle caching from GitHub Actions
+
+## [1.1.2] - 2022-02-11
+
+### Changed
+- Update `platformVersion` to `2021.1.3` for compatibility with Apple M1
+- Change since/until build to `211-213.*` (2021.1 - 2021.3)
+- Upgrade Gradle Wrapper to `7.4`
+- Dependencies - upgrade `org.jetbrains.intellij` to `1.4.0`
+- Dependencies (GitHub Actions) - upgrade `JetBrains/qodana-action` to `4.2.5`
+
+## [1.1.1] - 2022-01-24
+
+### Changed
+- GitHub Actions - fixed duplicated `.zip` extension in artifact file's name of the build flow
+- Upgrade Gradle Wrapper to `7.3.3`
+- Dependencies - upgrade `org.jetbrains.intellij` to `1.3.1`
+- Dependencies - upgrade `org.jetbrains.kotlin.jvm` to `1.6.10`
+- Dependencies (GitHub Actions) - upgrade `JetBrains/qodana-action` to `4.2.3`
+- Dependencies (GitHub Actions) - upgrade `actions/cache` to `2.1.7`
+
+## [1.1.0] - 2021-11-16
+
+### Added
+- GitHub Actions: Collect Qodana/Tests/Plugin Verifier results as artifacts
+
+### Changed
+- Dependencies - upgrade `org.jetbrains.intellij` to `1.3.0`
+- Dependencies - upgrade `org.jetbrains.changelog` to `1.3.1`
+- Dependencies - upgrade `org.jetbrains.kotlin.jvm` to `1.6.0`
+- Dependencies (GitHub Actions) - upgrade `jtalk/url-health-check-action` to `2`
+- Dependencies (GitHub Actions) - upgrade `actions/checkout` to `2.3.5`
+- GitHub Actions general performance refactoring
+- GitHub Actions - prepare plugin archive content to be archived once
+- GitHub Actions - patch changelog only if change notes are provided
+- Update `pluginUntilBuild` to include `213.*` (2021.3.*)
+- Upgrade Gradle Wrapper to `7.3`
+
+### Fixed
+- Fixed passing change notes from `CHANGELOG.md` to the Release Draft
+- Fixed passing updated change notes from the Release Draft to `patchChangelog` Gradle task
+- Fixed `QODANA_SHOW_REPORT` environment variable resolving for Gradle `6.x`
+
+### Removed
+- Removed the `pluginVerifierIdeVersions` configuration to use default IDEs list provided by the `listProductsReleases` task for `runPluginVerifier`
+- Removed `platformDownloadSources` from Gradle configuration to use default value
+- Removed `updateSinceUntilBuild.set(true)` from Gradle configuration to use default value
+
+## [1.0.0] - 2021-09-07
+
+### Added
+- Plugin Signing
+- Qodana integration
+- Functional tests
+- Compatibility with Java 11
+- `Run Qodana` and `Run IDE for UI Tests` run configurations
+- Use Gradle `wrapper` task to handle Gradle updates
+- JVM compatibility version extracted to `gradle.properties` file
+- Suppress `UnusedProperty` inspection for the `kotlin.stdlib.default.dependency` in `gradle.properties`
+
+### Changed
+- GitHub Actions: Use Java 11
+- GitHub Actions: Update Build and Release flows
+- GitHub Actions: Use Gradle cache provided with `actions/setup-java`
+- Update `pluginVerifierIdeVersions` to `2020.3.4, 2021.1.3, 2021.2.1`
+- Change since/until build to `203-212.*`
+- Upgrade Gradle Wrapper to `7.2`
+- Gradle – Changelog plugin configuration update
+- Dependencies - upgrade `org.jetbrains.kotlin.jvm` to `1.5.30`
+- Dependencies - upgrade `org.jetbrains.changelog` to `1.3.0`
+- Dependencies - upgrade `org.jetbrains.intellij` to `1.1.6`
+- Dependencies (GitHub Actions) - upgrade `actions/upload-artifact` to `v2.2.4`
+
+### Fixed
+- Use `DynamicBundle` instead of `AbstractBundle` in `MyBundle.kt`
+
+### Removed
+- Removed `detekt`/`ktlint` integration
+
+## [0.10.1] - 2021-05-31
+
+### Added
+- Introduced `next` branch in the root repository to make `main` always a stable one
+
+### Changed
+- Dependencies (GitHub Actions) - upgrade `actions/cache` to `v2.1.6`
+- Trigger GitHub Actions `Build` workflows only on pushes to `main` branch or pull request to avoid duplicated checks
+
+## [0.10.0] - 2021-05-27
+
+### Changed
+- Remove reference to the `jcenter()` from Gradle configuration file
+- Update `pluginVerifierIdeVersions` to `2020.2.4, 2020.3.4, 2021.1.2`
+- Update `pluginUntilBuild` to include `211.*` (2021.1.*)
+- Dependencies - upgrade `org.jetbrains.kotlin.jvm` to `1.5.10`
+- Dependencies - upgrade `detekt-formatting from` to `1.17.1`
+- Dependencies - upgrade `io.gitlab.arturbosch.detekt` to `1.17.1`
+- Dependencies (GitHub Actions) - upgrade `actions/cache` to `v2.1.5`
+- Dependencies (GitHub Actions) - upgrade `actions/checkout` to `v2.3.4`
+- Dependencies (GitHub Actions) - upgrade `actions/upload-release-asset` to `v1.0.2`
+- Dependencies (GitHub Actions) - upgrade `actions/create-release` to `v1.1.4`
+- Upgrade Gradle Wrapper to `7.0.2`
+
+## [0.9.0] - 2021-03-29
+
+### Added
+- `properties` shorthand function for accessing `gradle.properties` in a cleaner way
+- Dependabot check for GitHub Actions used in [workflow files](.github/workflows)
+
+### Changed
+- Dependencies - upgrade `detekt-formatting from` to `1.16.0`
+- Dependencies - upgrade `io.gitlab.arturbosch.detekt` to `1.16.0`
+- Dependencies - upgrade `org.jetbrains.kotlin.jvm` to `1.4.32`
+- Dependencies (GitHub Actions) - upgrade `actions/upload-artifact` to `v2.2.2`
+- Dependencies (GitHub Actions) - upgrade `actions/cache` to `v2.1.4`
+
+### Fixed
+- Fix `README.md` file resolution in the `build.gradle.kts`
+
+## [0.8.3] - 2021-02-23
+
+### Changed
+- Dependencies - upgrade `org.jetbrains.intellij` to `0.7.2`
+- Dependencies - upgrade `org.jlleitschuh.gradle.ktlint` to `10.0.0`
+- Update `platformVersion` to `2020.2.4` for compatibility with macOS Big Sur
+- Upgrade Gradle Wrapper to `6.8.3`
+
+## [0.8.2] - 2021-02-09
+
+### Changed
+- Use `-bin` distribution of the Gradle Wrapper
+- Upgrade Gradle Wrapper to `6.8.2`
+- Update `pluginVerifierIdeVersions` in `gradle.properties` files
+- Dependencies - upgrade `org.jetbrains.kotlin.jvm` to `1.4.30`
+- Dependencies - upgrade `org.jetbrains.changelog` to `1.1.1`
+- Configure the `changelog` Gradle plugin
+
+## [0.8.1] - 2021-01-12
+
+### Added
+- README: Dependencies management section
+
+### Changed
+- Upgrade Gradle Wrapper to `6.8`
+- Dependencies - upgrade `org.jetbrains.changelog` to `1.0.0`
+
+### Fixed
+- Template Cleanup: Escape GitHub username to avoid incorrect characters in class package name
+- Template Cleanup: Run `ktlintFormat` task to fix imports order
+- GitHub Actions: Use the correct property in the "Upload artifact" step
+
+## [0.8.0] - 2020-12-21
+
+### Added
+- Dependabot integration
+- Show `idea.log` logs of the run IDE in the Run console
+- README: FAQ section
+
+### Changed
+- `build.gradle.kts`: simpler syntax for configuring `KotlinCompile`
+- Dependencies - upgrade `org.jetbrains.kotlin.jvm` to `1.4.21`
+- Dependencies - upgrade `detekt-formatting` to `1.15.0`
+- Dependencies - upgrade `io.gitlab.arturbosch.detekt` to `1.15.0`
+- README: Clarify the Java usage in the project
+- `pluginVerifierIdeVersions` - upgrade to `2020.1.4, 2020.2.3, 2020.3.1`
+
+### Fixed
+- Return `Supplier<@Nls String>` instead of `String` in `MyBundle.messagePointer`
+
+## [0.7.1] - 2020-12-02
+
+### Changed
+- Upgrade Gradle Wrapper to `6.7.1`
+- Dependencies - upgrade `org.jetbrains.intellij` to `0.6.5`
+- Dependencies - upgrade `org.jetbrains.kotlin.jvm` to `1.4.20`
+- Update the base platform version to 2020.1
+- Change since/until build to `201-203.*`
+
+## [0.7.0] - 2020-11-16
+
+### Added
+- Predefined Run/Debug Configurations
+- Project icon for development purposes
+
+### Changed
+- Dependencies - upgrade `org.jetbrains.intellij` to `0.6.3`
+
+## [0.6.1] - 2020-11-05
+
+### Added
+- GitHub Actions - use hash based on `pluginVerifierIdeVersions` in `Setup Plugin Verifier IDEs Cache` step
+
+### Changed
+- Use [Kotlin extension function](https://plugins.jetbrains.com/docs/intellij/plugin-services.html#retrieving-a-service) to retrieve the `MyProjectService` in the `MyProjectManagerListener`
+- Dependencies - upgrade `org.jetbrains.intellij` to `0.6.2`
+- Update `pluginVerifierIdeVersions` in the `gradle.properties` files
+
+## [0.6.0] - 2020-10-29
+
+### Added
+- Integration with [IntelliJ Plugin Verifier](https://github.com/JetBrains/intellij-plugin-verifier) through the [Gradle IntelliJ Plugin](https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#runpluginverifier-task) `runPluginVerifier` task
+- Cache downloaded IDEs used by Plugin Verifier for the verification
+
+### Changed
+- Switch Gradle Wrapper to `-all` to improve the IntelliSense
+- Update detekt config to be in line with IJ settings
+- Dependencies - upgrade `io.gitlab.arturbosch.detekt` to `1.14.2`
+- Dependencies - upgrade `org.jetbrains.intellij` to `0.6.1`
+- GitHub Actions - `gradleValidation` update to `gradle/wrapper-validation-action@v1.0.3`
+- GitHub Actions - `releaseDraft` update to `actions/download-artifact@v2`
+
+### Removed
+- Remove Third-party IntelliJ Plugin Verifier GitHub Action
+
+## [0.5.1] - 2020-10-15
+
+### Added
+- Missing properties in the `gradle.properties` template file
+
+### Changed
+- Upgrade Gradle Wrapper to `6.7`
+- Dependencies - upgrade `org.jetbrains.changelog` to `0.6.2`
+
+## [0.5.0] - 2020-10-12
+
+### Added
+- Introduced `platformPlugins` property in `gradle.properties` for configuring dependencies to bundled/external plugins
+
+### Changed
+- Disable "Release Draft" job for pull requests in the "Build" GitHub Actions Workflow
+- Dependencies - upgrade `org.jetbrains.intellij` to `0.5.0`
+- Dependencies - upgrade `org.jetbrains.changelog` to `0.6.1`
+- Dependencies - upgrade `io.gitlab.arturbosch.detekt` to `1.14.1`
+- Dependencies - upgrade `org.jlleitschuh.gradle.ktlint` to `9.4.1`
+- Remove LICENSE file during the Template Cleanup workflow
+
+## [0.4.0] - 2020-10-02
+
+### Added
+- Fix default to opt-out of bundling Kotlin standard library in plugin distribution
+
+### Changed
+- GitHub Actions: allow releasing plugin even for the base project
+- Dependencies - upgrade `org.jetbrains.kotlin.jvm` to `1.4.10`
+- Dependencies - upgrade `io.gitlab.arturbosch.detekt` to `1.13.1`
+
+### Fixed
+- `pluginName` variable name collision with `intellij` closure getter in Gradle configuration #29
+
+## [0.3.2] - 2020-08-09
+
+### Changed
+- Simplify and optimize GitHub Actions
+- Gradle Wrapper upgrade to `6.6.1`
+- Dependencies - upgrade `org.jetbrains.kotlin.jvm` to `1.4.0`
+- Dependencies - upgrade `org.jetbrains.intellij` to `0.4.22`
+- Dependencies - upgrade `org.jetbrains.changelog` to `0.5.0`
+- Dependencies - upgrade `io.gitlab.arturbosch.detekt` to `1.12.0`
+- Dependencies - upgrade `org.jlleitschuh.gradle.ktlint` to `9.4.0`
+- Rename `master` branch to `main`
+
+### Fixed
+- GitHub Actions - cache Gradle dependencies and wrapper separately
+
+## [0.3.1] - 2020-07-31
+
+### Added
+- Better handling of the Gradle plugin description extraction from the README file
+- GitHub Actions - cache Gradle Wrapper
+
+### Changed
+- Gradle - remove kotlin("stdlib-jdk8") dependency to decrease the plugin artifact size
+- Dependencies - bump ktlint to `9.3.0`
+- GitHub Actions - make *Update Changelog* job dependent on the *Publish Plugin*
+- GitHub Actions - run plugin verifier against `2019.3` `2020.1` `2020.2`
+
+### Fixed
+- Resolve ktlint reports
+- GitHub Actions - Plugin Verifier broken for artifacts with whitespaces in name
+
+## [0.3.0] - 2020-07-07
+
+### Added
+- Set publish channel depending on the plugin version, i.e. `1.0.0-beta` -> `beta` channel
+
+### Changed
+- Update `org.jetbrains.changelog` dependency to `v0.3.3`
+- Update Gradle Wrapper to `v6.5.1`
+- Run GitHub Actions Release workflow on `prereleased` event
+- GitHub Actions - Release - separate changelog related job from the release
+
+### Fixed
+- Remove vendor website from `plugin.xml`
+- Update Template Cleanup workflow test to avoid running it on forks
+
+## [0.2.0] - 2020-07-02
+
+### Added
+- JetBrains Plugin badges and TODO list for the end users
+- `ktlint` integration
+
+### Changed
+- `pluginUntilBuild` set to the correct format: `201.*`
+- Bump detekt dependency to `1.10.0`
+
+### Fixed
+- GitHub Actions - Template Cleanup - fixed adding files to git
+- Update Template plugin name on cleanup
+- Set `buildUponDefaultConfig = true` in detekt configuration
+
+## [0.1.0] - 2020-06-26
+
+### Added
+- `settings.gradle.kts` for the [performance purposes](https://docs.gradle.org/current/userguide/organizing_gradle_projects.html#always_define_a_settings_file)
+- `#REMOVE-ON-CLEANUP#` token to mark content to be removed with **Template Cleanup** workflow
+
+### Changed
+- README proofreading
+- GitHub Actions - Update IDE versions for the Plugin Verifier
+- Update platformVersion to `2020.1.2`
+
+## [0.0.2] - 2020-06-22
+
+### Added
+- [Gradle Changelog Plugin](https://github.com/JetBrains/gradle-changelog-plugin) integration
+
+### Changed
+- Bump Detekt version
+- Change pluginSinceBuild to 193
+
+## [0.0.1]
+
+### Added
+- Initial project scaffold
+- GitHub Actions to automate testing and deployment
+- Kotlin support
+
+[Unreleased]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/v1.3.0...HEAD
+[1.2.0]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/v1.2.0...v1.3.0
+[1.2.0]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/v1.1.2...v1.2.0
+[1.1.2]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/v1.1.1...v1.1.2
+[1.1.1]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/v1.1.0...v1.1.1
+[1.1.0]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/v1.0.0...v1.1.0
+[1.0.0]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/v0.10.1...v1.0.0
+[0.10.1]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/v0.10.0...v0.10.1
+[0.10.0]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/v0.9.0...v0.10.0
+[0.9.0]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/v0.8.3...v0.9.0
+[0.8.3]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/v0.8.2...v0.8.3
+[0.8.2]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/v0.8.1...v0.8.2
+[0.8.1]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/v0.8.0...v0.8.1
+[0.8.0]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/v0.7.1...v0.8.0
+[0.7.1]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/v0.7.0...v0.7.1
+[0.7.0]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/v0.6.1...v0.7.0
+[0.6.1]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/v0.6.0...v0.6.1
+[0.6.0]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/v0.5.1...v0.6.0
+[0.5.1]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/v0.5.0...v0.5.1
+[0.5.0]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/v0.4.0...v0.5.0
+[0.4.0]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/v0.3.2...v0.4.0
+[0.3.2]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/v0.3.1...v0.3.2
+[0.3.1]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/v0.3.0...v0.3.1
+[0.3.0]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/v0.2.0...v0.3.0
+[0.2.0]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/v0.1.0...v0.2.0
+[0.1.0]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/v0.0.2...v0.1.0
+[0.0.2]: https://github.com/JetBrains/intellij-platform-plugin-template/commits/v0.0.2
+[0.0.1]: https://github.com/JetBrains/intellij-platform-plugin-template/commits

+ 115 - 0
studio-plugin/build.gradle.kts

@@ -0,0 +1,115 @@
+import org.jetbrains.changelog.Changelog
+import org.jetbrains.changelog.markdownToHTML
+import org.jetbrains.intellij.platform.gradle.TestFrameworkType
+
+plugins {
+    id("java")
+//    alias(libs.plugins.kotlin)
+    alias(libs.plugins.intellij.platform)
+    alias(libs.plugins.changelog)
+    alias(libs.plugins.qodana)
+    alias(libs.plugins.kover)
+}
+
+group = providers.gradleProperty("pluginGroup").get()
+version = providers.gradleProperty("pluginVersion").get()
+
+//kotlin {
+//    jvmToolchain(17)
+//}
+repositories {
+    mavenCentral()
+    intellijPlatform {
+        defaultRepositories()
+        localPlatformArtifacts()
+    }
+}
+
+dependencies {
+    intellijPlatform {
+//        androidStudio("2025.1.1")
+        create(
+            providers.gradleProperty("platformType"),
+            providers.gradleProperty("platformVersion")
+        )
+        bundledPlugins(providers.gradleProperty("platformBundledPlugins").map {
+            it.split(',')
+        })
+        plugins(providers.gradleProperty("platformPlugins").map {
+            it.split(',')
+        })
+        testFramework(TestFrameworkType.Platform)
+    }
+}
+
+intellijPlatform {
+    pluginConfiguration {
+        name = providers.gradleProperty("pluginName")
+        version = providers.gradleProperty("pluginVersion")
+        description = providers.gradleProperty("pluginDescription")
+        val changelog = project.changelog
+        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")
+        }
+    }
+    pluginVerification {
+        ides {
+            recommended()
+        }
+    }
+}
+
+changelog {
+    groups.empty()
+    repositoryUrl = providers.gradleProperty("pluginRepositoryUrl")
+}
+
+kover {
+    reports {
+        total {
+            xml {
+                onCheck = true
+            }
+        }
+    }
+}
+
+tasks {
+//    wrapper {
+//        gradleVersion = providers.gradleProperty("gradleVersion").get()
+//    }
+    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()
+            }
+        }
+    }
+}

+ 20 - 0
studio-plugin/src/main/kotlin/org/jetbrains/plugins/template/MyBundle.kt

@@ -0,0 +1,20 @@
+package org.jetbrains.plugins.template
+
+import com.intellij.DynamicBundle
+import org.jetbrains.annotations.NonNls
+import org.jetbrains.annotations.PropertyKey
+
+@NonNls
+private const val BUNDLE = "messages.MyBundle"
+
+object MyBundle : DynamicBundle(BUNDLE) {
+
+    @JvmStatic
+    fun message(@PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any) =
+        getMessage(key, *params)
+
+    @Suppress("unused")
+    @JvmStatic
+    fun messagePointer(@PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any) =
+        getLazyMessage(key, *params)
+}

+ 17 - 0
studio-plugin/src/main/kotlin/org/jetbrains/plugins/template/services/MyProjectService.kt

@@ -0,0 +1,17 @@
+package org.jetbrains.plugins.template.services
+
+import com.intellij.openapi.components.Service
+import com.intellij.openapi.diagnostic.thisLogger
+import com.intellij.openapi.project.Project
+import org.jetbrains.plugins.template.MyBundle
+
+@Service(Service.Level.PROJECT)
+class MyProjectService(
+    project: Project
+) {
+    init {
+        thisLogger().info(MyBundle.message("projectService", project.name))
+        thisLogger().warn("Don't forget to remove all non-needed sample code files with their corresponding registration entries in `plugin.xml`.")
+    }
+    fun getRandomNumber() = (1..100).random()
+}

+ 11 - 0
studio-plugin/src/main/kotlin/org/jetbrains/plugins/template/startup/MyProjectActivity.kt

@@ -0,0 +1,11 @@
+package org.jetbrains.plugins.template.startup
+
+import com.intellij.openapi.diagnostic.thisLogger
+import com.intellij.openapi.project.Project
+import com.intellij.openapi.startup.ProjectActivity
+
+class MyProjectActivity : ProjectActivity {
+    override suspend fun execute(project: Project) {
+        thisLogger().warn("Don't forget to remove all non-needed sample code files with their corresponding registration entries in `plugin.xml`.")
+    }
+}

+ 43 - 0
studio-plugin/src/main/kotlin/org/jetbrains/plugins/template/toolWindow/MyToolWindowFactory.kt

@@ -0,0 +1,43 @@
+package org.jetbrains.plugins.template.toolWindow
+
+import com.intellij.openapi.components.service
+import com.intellij.openapi.diagnostic.thisLogger
+import com.intellij.openapi.project.Project
+import com.intellij.openapi.wm.ToolWindow
+import com.intellij.openapi.wm.ToolWindowFactory
+import com.intellij.ui.components.JBLabel
+import com.intellij.ui.components.JBPanel
+import com.intellij.ui.content.ContentFactory
+import org.jetbrains.plugins.template.MyBundle
+import org.jetbrains.plugins.template.services.MyProjectService
+import javax.swing.JButton
+
+class MyToolWindowFactory : ToolWindowFactory {
+    init {
+        thisLogger()
+            .warn("Don't forget to remove all non-needed sample code files with their corresponding registration entries in `plugin.xml`.")
+    }
+    override fun createToolWindowContent(project: Project, toolWindow: ToolWindow) {
+        val myToolWindow = MyToolWindow(toolWindow)
+        val content = ContentFactory.getInstance().createContent(myToolWindow.getContent(), null, false)
+        toolWindow.contentManager.addContent(content)
+    }
+
+    override fun shouldBeAvailable(project: Project) = true
+
+    class MyToolWindow(toolWindow: ToolWindow) {
+
+        private val service = toolWindow.project.service<MyProjectService>()
+
+        fun getContent() = JBPanel<JBPanel<*>>().apply {
+            val label = JBLabel(MyBundle.message("randomLabel", "?"))
+
+            add(label)
+            add(JButton(MyBundle.message("shuffle")).apply {
+                addActionListener {
+                    label.text = MyBundle.message("randomLabel", service.getRandomNumber())
+                }
+            })
+        }
+    }
+}

+ 12 - 0
studio-plugin/src/main/resources/META-INF/plugin.xml

@@ -0,0 +1,12 @@
+<!-- Plugin Configuration File. Read more: https://plugins.jetbrains.com/docs/intellij/plugin-configuration-file.html -->
+<idea-plugin>
+    <id>org.jetbrains.plugins.template</id>
+    <name>IntelliJ Platform Plugin Template</name>
+    <vendor>JetBrains</vendor>
+    <depends>com.intellij.modules.platform</depends>
+    <resource-bundle>messages.MyBundle</resource-bundle>
+    <extensions defaultExtensionNs="com.intellij">
+        <toolWindow factoryClass="org.jetbrains.plugins.template.toolWindow.MyToolWindowFactory" id="MyToolWindow"/>
+        <postStartupActivity implementation="org.jetbrains.plugins.template.startup.MyProjectActivity" />
+    </extensions>
+</idea-plugin>

+ 3 - 0
studio-plugin/src/main/resources/messages/MyBundle.properties

@@ -0,0 +1,3 @@
+projectService=Project service: {0}
+randomLabel=The random number is: {0}
+shuffle=Shuffle

+ 39 - 0
studio-plugin/src/test/kotlin/org/jetbrains/plugins/template/MyPluginTest.kt

@@ -0,0 +1,39 @@
+package org.jetbrains.plugins.template
+
+import com.intellij.ide.highlighter.XmlFileType
+import com.intellij.openapi.components.service
+import com.intellij.psi.xml.XmlFile
+import com.intellij.testFramework.TestDataPath
+import com.intellij.testFramework.fixtures.BasePlatformTestCase
+import com.intellij.util.PsiErrorElementUtil
+import org.jetbrains.plugins.template.services.MyProjectService
+
+@TestDataPath("\$CONTENT_ROOT/src/test/testData")
+class MyPluginTest : BasePlatformTestCase() {
+
+    fun testXMLFile() {
+        val psiFile = myFixture.configureByText(XmlFileType.INSTANCE, "<foo>bar</foo>")
+        val xmlFile = assertInstanceOf(psiFile, XmlFile::class.java)
+
+        assertFalse(PsiErrorElementUtil.hasErrors(project, xmlFile.virtualFile))
+
+        assertNotNull(xmlFile.rootTag)
+
+        xmlFile.rootTag?.let {
+            assertEquals("foo", it.name)
+            assertEquals("bar", it.value.text)
+        }
+    }
+
+    fun testRename() {
+        myFixture.testRename("foo.xml", "foo_after.xml", "a2")
+    }
+
+    fun testProjectService() {
+        val projectService = project.service<MyProjectService>()
+
+        assertNotSame(projectService.getRandomNumber(), projectService.getRandomNumber())
+    }
+
+    override fun getTestDataPath() = "src/test/testData/rename"
+}

+ 3 - 0
studio-plugin/src/test/testData/rename/foo.xml

@@ -0,0 +1,3 @@
+<root>
+    <a<caret>1>Foo</a1>
+</root>

+ 3 - 0
studio-plugin/src/test/testData/rename/foo_after.xml

@@ -0,0 +1,3 @@
+<root>
+    <a2>Foo</a2>
+</root>