|
| 1 | +import Button from "atoms/core/Button"; |
| 2 | +import Link from "atoms/core/Link"; |
| 3 | +import { Image, ShrinkedWidth, SpaceBox } from "atoms/core/mdx-elements"; |
| 4 | +import { Kbd } from "atoms/core/html-elements"; |
| 5 | +import { ReactComponent as WindowCode } from "assets/images/illustrations/window-code.svg"; |
| 6 | +import { ROUTE_DOCS_PORTS_JETBRAINS_INSTALLATION } from "config/routes/mappings"; |
| 7 | + |
| 8 | +import WIPNotice from "../../../../shared/docs/wip-notice"; |
| 9 | + |
| 10 | +export const frontmatter = { |
| 11 | + title: "Plugin Development", |
| 12 | + subline: "Learn how to customize the theme to fit your needs, preview changes and export the plugin." |
| 13 | +}; |
| 14 | + |
| 15 | +<ShrinkedWidth value={25}> |
| 16 | + |
| 17 | +<SpaceBox mTop={4} mBottom={4}> |
| 18 | + <WindowCode /> |
| 19 | +</SpaceBox> |
| 20 | + |
| 21 | +</ShrinkedWidth> |
| 22 | + |
| 23 | +<ShrinkedWidth value={80}> |
| 24 | + |
| 25 | +<WIPNotice /> |
| 26 | + |
| 27 | +This page documents how to develop the theme plugin — from requirements to the deployment and local installation steps. |
| 28 | + |
| 29 | +# Requirements |
| 30 | + |
| 31 | +Download and install [IntelliJ][jb-intellij] with a minimal version of [2019.1 or higher][jb-whatsnew-2019.1]. |
| 32 | + |
| 33 | +<Image dropShadow fillSize={75} fluid={props.images["intellij-splash-screen.png"]} rounded /> |
| 34 | + |
| 35 | +To develop IntelliJ platform plugins the [DevKit][jb-docs-sdk-devkit] plugin (bundled by default) must be enabled. |
| 36 | + |
| 37 | +<Image dropShadow fluid={props.images["devkit-plugin.png"]} rounded /> |
| 38 | + |
| 39 | +# Setup |
| 40 | + |
| 41 | +## Download |
| 42 | + |
| 43 | +Clone the [_Nord JetBrains_ repository from GitHub][gh-repo] to any path: |
| 44 | + |
| 45 | +```sh |
| 46 | +git clone https://github.com/arcticicestudio/nord-jetbrains.git |
| 47 | +``` |
| 48 | + |
| 49 | +To get the project without [Git][] download the project as `.zip` archive file from the GitHub repository or click on the download button below. Afterwards extract the archive to any path. |
| 50 | + |
| 51 | +<Button href="https://github.com/arcticicestudio/nord-jetbrains/archive/develop.zip">Download</Button> |
| 52 | + |
| 53 | +<Image |
| 54 | + alt="Screenshot showing the GitHub repository web UI to download the project repository" |
| 55 | + fillSize={60} |
| 56 | + fluid={props.images["github-clone.png"]} |
| 57 | +> |
| 58 | + Download the project repository from GitHub |
| 59 | +</Image> |
| 60 | + |
| 61 | +Both methods will use the `develop` branch to work with the latest development state. |
| 62 | + |
| 63 | +Import the project use IntelliJ's <Kbd>Open...</Kbd> wizard from the welcome screen and browse to the path of the cloned/extracted repository. |
| 64 | + |
| 65 | +# Development |
| 66 | + |
| 67 | +## Workflow |
| 68 | + |
| 69 | +_Nord JetBrains_ follows the [official workflow documentation][jb-docs-sdk-ui-theme-workflow] to |
| 70 | + |
| 71 | +1. [Customize the UI icons and Controls][jb-docs-sdk-ui-theme-customize] |
| 72 | +2. [Bundle the already existing editor color theme][jb-docs-sdk-editor-theme] |
| 73 | +3. [Build, debug and test the theme plugin][jb-docs-sdk-test-build] |
| 74 | +4. [Deploy and publish the theme plugin][jb-docs-sdk-deployment] |
| 75 | + |
| 76 | +For details about the general UI design pattern please refer to the [JetBrains UI guidelines][jb-ui_guidelines]. |
| 77 | + |
| 78 | +## Theme Preview |
| 79 | + |
| 80 | +IntelliJ comes with a builtin function to preview the currently opened platform plugin project. |
| 81 | +Open the [`nord.theme.json`][gh-repo-tree-dev-ui-theme] file and click on the _play_ icon to apply the current state of the UI theme. |
| 82 | + |
| 83 | +<Image |
| 84 | + dropShadow |
| 85 | + alt="Screenshot showing the UI theme preview icon bar when the theme definition file is opened" |
| 86 | + fluid={props.images["ui-theme-preview.png"]} |
| 87 | + rounded |
| 88 | +> |
| 89 | + UI theme preview icon bar when the theme definition file is opened |
| 90 | +</Image> |
| 91 | + |
| 92 | +To apply changes made while the preview is enabled click on the _double play_ icon and disable the preview again using using the _stop_ icon. |
| 93 | + |
| 94 | +<Image |
| 95 | + dropShadow |
| 96 | + alt="Screenshot showing the enabled UI theme preview icon bar when the theme definition file is opened" |
| 97 | + fluid={props.images["ui-theme-preview-enabled.png"]} |
| 98 | + rounded |
| 99 | +> |
| 100 | + UI theme preview icon bar when enabled |
| 101 | +</Image> |
| 102 | + |
| 103 | +## Visual Testing |
| 104 | + |
| 105 | +The IntelliJ SDK provides a lot of tools to develop plugins by [enabling the internal mode][jb-docs-sdk-internal_mode] that will allow to show e.g. the [LaF Defaults][jb-docs-sdk-internal_mode_laf]. |
| 106 | + |
| 107 | +To enable the _internal mode_ open the [advanced IDE properties][jb-docs-ide_props] and add the following key-value pair: |
| 108 | + |
| 109 | +```properties |
| 110 | +idea.is.internal=true |
| 111 | +``` |
| 112 | + |
| 113 | +Restart IntelliJ to enable the new property. |
| 114 | + |
| 115 | +<Image |
| 116 | + dropShadow |
| 117 | + fillSize={50} |
| 118 | + alt="Screenshot showing the menu entry to edit the IDE properties" |
| 119 | + fluid={props.images["ide-props.png"]} |
| 120 | + rounded |
| 121 | +> |
| 122 | + Menu entry to edit the IDE properties |
| 123 | +</Image> |
| 124 | + |
| 125 | +# Deployment |
| 126 | + |
| 127 | +IntelliJ comes with builtin tools to build and deploy plugins. |
| 128 | + |
| 129 | +1. Go to **Build** and **Build Project** to copy the project files to the `/out` folder and generate required metadata. |
| 130 | +2. Again go to **Build** and choose **Select All Plugin Modules For Deployment** to generate the JAR file. |
| 131 | + |
| 132 | +<Image |
| 133 | + dropShadow |
| 134 | + fillSize={50} |
| 135 | + alt="Screenshot showing the menu entries for builtin tools to build and deploy platform plugins" |
| 136 | + fluid={props.images["build-deploy.png"]} |
| 137 | + rounded |
| 138 | +> |
| 139 | + Menu entries for builtin tools to build and deploy platform plugins |
| 140 | +</Image> |
| 141 | + |
| 142 | +# Local Installation |
| 143 | + |
| 144 | +A generated JAR file can be locally installed to use the theme without uploading it to the JetBrains plugin repository. |
| 145 | +Go to [Settings / Preferences][jb-docs-sett_prefs] ➜ **Plugins**, click on the gear icon and select „Install Plugin From Disk...“. |
| 146 | + |
| 147 | +<Image |
| 148 | + dropShadow |
| 149 | + alt="Screenshot showing the menu to install plugins locally" |
| 150 | + fluid={props.images["install-local.png"]} |
| 151 | + rounded |
| 152 | +> |
| 153 | + Local plugin installation |
| 154 | +</Image> |
| 155 | + |
| 156 | +Select the plugin JAR file and restart IntelliJ. |
| 157 | + |
| 158 | +Follow the <Link to={ROUTE_DOCS_PORTS_JETBRAINS_INSTALLATION}>Installation & Activation Guide</Link> for more details how to enable the UI theme and editor color scheme. |
| 159 | + |
| 160 | +</ShrinkedWidth> |
| 161 | + |
| 162 | +[gh-repo-tree-dev-ui-theme]: https://github.com/arcticicestudio/nord-jetbrains/blob/develop/src/nord.theme.json |
| 163 | +[gh-repo]: https://github.com/arcticicestudio/nord-jetbrains |
| 164 | +[git]: https://git-scm.com |
| 165 | +[jb-docs-ide_props]: https://www.jetbrains.com/help/idea/tuning-the-ide.html |
| 166 | +[jb-docs-sdk-deployment]: https://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/deploying_plugin.html |
| 167 | +[jb-docs-sdk-devkit]: https://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/using_dev_kit.html |
| 168 | +[jb-docs-sdk-editor-theme]: http://www.jetbrains.org/intellij/sdk/docs/reference_guide/ui_themes/themes_extras.html |
| 169 | +[jb-docs-sdk-internal_mode_laf]: http://www.jetbrains.org/intellij/sdk/docs/reference_guide/internal_actions/internal_ui_lafd.html |
| 170 | +[jb-docs-sdk-internal_mode]: http://www.jetbrains.org/intellij/sdk/docs/reference_guide/internal_actions/enabling_internal.html |
| 171 | +[jb-docs-sdk-test-build]: http://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/running_and_debugging_a_plugin.html |
| 172 | +[jb-docs-sdk-ui-theme-customize]: http://www.jetbrains.org/intellij/sdk/docs/reference_guide/ui_themes/themes_customize.html |
| 173 | +[jb-docs-sdk-ui-theme-workflow]: http://www.jetbrains.org/intellij/sdk/docs/reference_guide/ui_themes/themes.html#custom-ui-theme-workflow |
| 174 | +[jb-docs-sett_prefs]: https://www.jetbrains.com/help/idea/settings-preferences-dialog.html |
| 175 | +[jb-intellij]: https://www.jetbrains.com/idea |
| 176 | +[jb-ui_guidelines]: https://jetbrains.github.io/ui |
| 177 | +[jb-whatsnew-2019.1]: https://www.jetbrains.com/idea/whatsnew/#v2019-1 |
0 commit comments