From 527557dd5efa1cb6b090cffca162f10c89785542 Mon Sep 17 00:00:00 2001 From: Jakub Chrzanowski Date: Thu, 18 Jun 2020 22:09:41 +0200 Subject: [PATCH] README - wip --- .github/workflows/template-cleanup.yml | 1 + README.md | 75 ++++++++++++++++++++++++-- 2 files changed, 72 insertions(+), 4 deletions(-) diff --git a/.github/workflows/template-cleanup.yml b/.github/workflows/template-cleanup.yml index 1837409..fc84b06 100644 --- a/.github/workflows/template-cleanup.yml +++ b/.github/workflows/template-cleanup.yml @@ -41,6 +41,7 @@ jobs: # Replace template package name in project files with $GROUP sed -i "s/org.jetbrains.plugins.template/$GROUP/g" gradle.properties find src -type f -exec sed -i "s/org.jetbrains.plugins.template/$GROUP/g" {} + + find src -type f -exec sed -i "s/JetBrains/$ACTOR/g" {} + # Move content mkdir -p src/main/kotlin/${GROUP//.//} diff --git a/README.md b/README.md index 2af9cb9..e00c485 100644 --- a/README.md +++ b/README.md @@ -92,13 +92,74 @@ platformDownloadSources = true Listed properties define the plugin itself or configure the [gradle-intellij-plugin][gradle-intellij-plugin] - check its documentation for more details. -## Plugin Manifest File +## Plugin Template Structure -TODO +Generated IntelliJ Template repository contains following content structure: + +``` +. +├── CHANGELOG.md Full changes history. +├── LICENSE License, MIT by default +├── README.md README +├── build Output build directory +├── build.gradle.kts Gradle configuration +├── detekt-config.yml Detekt configuration +├── gradle +│   └── wrapper Gradle Wrapper +├── gradle.properties Gradle configuration properties +├── gradlew *nix Gradle Wrapper binary +├── gradlew.bat Windows Gradle Wrapper binary +└── src Plugin sources + └── main + ├── kotlin Kotlin source files + ├── java Java source files + └── resources Resources - plugin.xml, icons, messages +``` + +Beside of the configuration files, the most important part is the `src` directory containing our implementation +and plugin's manifest - [plugin.xml][file:plugin.xml]. + +## Plugin Configuration File + +Plugin Configuration File is a [plugin.xml][file:plugin.xml] file located in the `/src/main/resources/META-INF` +directory. It describes the overall information about the plugin, its dependencies, extensions, and listeners. + +```xml + + org.jetbrains.plugins.template + Template + JetBrains + com.intellij.modules.platform + + + + + + + + + + +``` + +You can read more about that file in [IntelliJ Platform SDK DevGuide][docs:plugin.xml]. ## Sample Code -TODO +The prepared template is aiming to provide as less code as possible, because it is barely possible to fulfill +the requirements of the various types of the plugins (language support, build tools, VCS related tools) with some +general scaffold. Having that in mind, it contains few following files: + +``` +. +├── MyBundle.kt Bundle class providing access to the resources messages +├── listeners +│   ├── MyDynamicPluginListener.kt Dynamic Plugin listener - notifies about the dynamic plugin lifecycle +│   └── MyProjectManagerListener.kt Project Manager listener - notifies about the project open event +└── services + ├── MyApplicationService.kt Application level service available for all projects + └── MyProjectService.kt Project level service +``` ## Continuous Integration @@ -128,9 +189,11 @@ Cannot find org.jetbrains.plugins.template. Note that you need to upload the plu ## Useful Links - [IntelliJ Platform SDK DevGuide][docs] +- [IntelliJ Platform UI Guidelines][ij-ui-guidelines] +- [Kotlin UI DSL][docs:kotlin-ui-dsl] - [IntelliJ SDK Code Samples][code-samples] - [JetBrains Platform Slack][slack] -- [IntelliJ IDEA Open API and Plugin Development][forum] +- [IntelliJ IDEA Open API and Plugin Development Forum][forum] - [Keep a Changelog][keep-a-changelog] - [GitHub Actions][gh-actions] @@ -148,12 +211,16 @@ Cannot find org.jetbrains.plugins.template. Note that you need to upload the plu [download-ij]: https://www.jetbrains.com/idea/download [gradle]: https://gradle.org [gradle-kotlin-dsl]: https://docs.gradle.org/current/userguide/kotlin_dsl.html +[ij-ui-guidelines]: https://jetbrains.github.io/ui [docs]: https://www.jetbrains.org/intellij/sdk/docs [docs:intro]: https://www.jetbrains.org/intellij/sdk/docs/intro/intellij_platform.html [docs:using-gradle]: https://www.jetbrains.org/intellij/sdk/docs/tutorials/build_system.html [docs:publishing]: https://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/publishing_plugin.html +[docs:kotlin-ui-dsl]: https://www.jetbrains.org/intellij/sdk/docs/user_interface_components/kotlin_ui_dsl.html +[docs:plugin.xml]: https://www.jetbrains.org/intellij/sdk/docs/basics/plugin_structure/plugin_configuration_file.html [file:getting-started_use-this-template.png]: ./.github/readme/getting-started_use-this-template.png [file:gradle.properties]: ./gradle.properties [file:template_cleanup.yml]: ./.github/workflows/template-cleanup.yml +[file:plugin.xml]: ./src/main/resources/META-INF/plugin.xml