diff --git a/tutorials/build_system/img/gradle_directory_structure.png b/tutorials/build_system/img/gradle_directory_structure.png index 1d441c120..f3f0bdfb9 100644 Binary files a/tutorials/build_system/img/gradle_directory_structure.png and b/tutorials/build_system/img/gradle_directory_structure.png differ diff --git a/tutorials/build_system/img/gradle_run_config.png b/tutorials/build_system/img/gradle_run_config.png index 209e104ec..144bea920 100644 Binary files a/tutorials/build_system/img/gradle_run_config.png and b/tutorials/build_system/img/gradle_run_config.png differ diff --git a/tutorials/build_system/img/gradle_tasks_in_tool_window.png b/tutorials/build_system/img/gradle_tasks_in_tool_window.png new file mode 100644 index 000000000..6192eb13a Binary files /dev/null and b/tutorials/build_system/img/gradle_tasks_in_tool_window.png differ diff --git a/tutorials/build_system/img/launched.png b/tutorials/build_system/img/launched.png index ade0452e2..e2abcbe96 100644 Binary files a/tutorials/build_system/img/launched.png and b/tutorials/build_system/img/launched.png differ diff --git a/tutorials/build_system/img/step0_gradle_enabled.png b/tutorials/build_system/img/step0_gradle_enabled.png index f40a304ff..429274620 100644 Binary files a/tutorials/build_system/img/step0_gradle_enabled.png and b/tutorials/build_system/img/step0_gradle_enabled.png differ diff --git a/tutorials/build_system/img/step1_new_gradle_project.png b/tutorials/build_system/img/step1_new_gradle_project.png index 3290c4dd8..1fb43431d 100644 Binary files a/tutorials/build_system/img/step1_new_gradle_project.png and b/tutorials/build_system/img/step1_new_gradle_project.png differ diff --git a/tutorials/build_system/img/step2_group_artifact_version.png b/tutorials/build_system/img/step2_group_artifact_version.png index 256213a26..3f824ef27 100644 Binary files a/tutorials/build_system/img/step2_group_artifact_version.png and b/tutorials/build_system/img/step2_group_artifact_version.png differ diff --git a/tutorials/build_system/img/step3_gradle_config.png b/tutorials/build_system/img/step3_gradle_config.png index 34c032f2c..8b87a539f 100644 Binary files a/tutorials/build_system/img/step3_gradle_config.png and b/tutorials/build_system/img/step3_gradle_config.png differ diff --git a/tutorials/build_system/prerequisites.md b/tutorials/build_system/prerequisites.md index 8a2abedf8..8431989dd 100644 --- a/tutorials/build_system/prerequisites.md +++ b/tutorials/build_system/prerequisites.md @@ -4,21 +4,17 @@ title: Getting Started Adding Gradle build support to an IntelliJ Platform Plugin requires a recent distribution to the Gradle build system and IntelliJ IDEA (Community or Ultimate). -### 1.0. Download and install Gradle - -Download and install Gradle, following the instructions provided in the [Gradle User Guide](https://docs.gradle.org/current/userguide/installation.html). - -### 1.1. Download and install IntelliJ IDEA +### 1.0. Download and install IntelliJ IDEA Download and install either IntelliJ IDEA Ultimate or the IntelliJ IDEA Community Edition. -### 1.2. Ensure the Gradle plugin is enabled +### 1.1. Ensure the Gradle plugin is enabled -The [Gradle plugin](https://plugins.gradle.org/plugin/org.jetbrains.intellij) is required if you want to add a [Gradle Run Configuration](https://www.jetbrains.com/idea/help/create-run-debug-configuration-for-gradle-tasks.html) to IntelliJ IDEA. You can verify the Gradle plugin is enabled by visiting **Settings \| Plugins \| Gradle**. +The Gradle plugin is required if you want to add a [Gradle Run Configuration](https://www.jetbrains.com/idea/help/create-run-debug-configuration-for-gradle-tasks.html) to IntelliJ IDEA. You can verify the Gradle plugin is enabled by visiting **Settings \| Plugins \| Gradle**. -![Ensure the Gradle plugin is enabled](img/step0_gradle_enabled.png) +Ensure the Gradle plugin is enabled -### 1.3. Add Gradle support to an existing plugin +### 1.2. Add Gradle support to an existing plugin There are two ways to add Gradle support to an existing project. Both will require adding a `build.gradle` file under the root directory, with at least the following contents: @@ -30,7 +26,7 @@ buildscript { } plugins { - id "org.jetbrains.intellij" version "0.0.20" + id "org.jetbrains.intellij" version "0.1.10" } apply plugin: 'idea' @@ -38,7 +34,7 @@ apply plugin: 'org.jetbrains.intellij' apply plugin: 'java' intellij { - version 'IC-14.1.4' //IntelliJ IDEA dependency + version 'IC-2016.3.1' //IntelliJ IDEA dependency plugins 'coverage' //Bundled plugin dependencies pluginName 'plugin_name_goes_here' } @@ -56,27 +52,31 @@ gradle runIdea This will clean any existing IntelliJ IDEA configuration files and generate a new Gradle build configuration recognized by IntelliJ IDEA. Once your project refreshes, you should be able to view the Gradle tool window displayed under **View \| Tool Windows \| Gradle**. This indicates that IntelliJ IDEA recognizes the Gradle facet. -### 1.4. Add Gradle support from scratch +### 1.3. Add Gradle support from scratch The second method to add Gradle support is by creating a new project from scratch in IntelliJ IDEA and copying over any existing sources. This may be the preferred option in case Gradle is not able to convert an existing project. To do so, create a new project in IntelliJ IDEA by opening **File \| New... \| Project**, and select Gradle from the dialog box: -![Select the Gradle facet in the Project Creation Wizard](img/step1_new_gradle_project.png) +Select the Gradle facet in the Project Creation Wizard The Project Creation Wizard will now guide you through the Gradle project creation process. You will need to specify a Group ID, Artifact ID, and Version: -![Specify the Group, Artifact, and Version IDs](img/step2_group_artifact_version.png) +Specify the Group, Artifact, and Version IDs -Finally, make sure Gradle is using the correct JVM. This should be the same version as the corresponding 64- or 32-bit Gradle distribution from [Step 1.0](#download-and-install-gradle): +On the next screen, check `Create directories for empty content roots automatically`. -![Verify the JVM is the correct version](img/step3_gradle_config.png) +It’s recommended to select the `Use default gradle wrapper` option, that way IntelliJ IDEA will install everything you need to run Gradle tasks itself. + +Finally, specify a JVM Gradle will use, it can be the Project JDK. You also configure this path once the project is created via **Settings \| Build, Execution, Deployment \| Build Tools \| Gradle**. + +Verify the JVM is the correct version Now, add the above script to your `build.gradle` file, overwriting any existing contents. -### 1.5. Running a simple plugin +### 1.4. Running a simple plugin -Create the following directory structure: +Now add a new `HelloAction` class and `plugin.xml` in the `META-INF` folder: -![Gradle directory structure](img/gradle_directory_structure.png) +Gradle directory structure ```java {% include /code_samples/gradle_plugin_demo/src/main/java/HelloAction.java %} @@ -86,13 +86,17 @@ Create the following directory structure: {% include /code_samples/gradle_plugin_demo/src/main/resources/META-INF/plugin.xml %} ``` -Add a new Gradle Run Configuration, configured like so: - -![Gradle Run Configuration](img/gradle_run_config.png) +Open the Gradle tool window and search for `runIdea` task. If it’s not in the list, please hit `Refresh` button on the top. Double-click on it to run it. + +Gradle Tool Window + +Or add a new Gradle Run Configuration, configured like so: + +Gradle Run Configuration Launch the new Gradle Run Configuration. From the Run Window, the following output should be visible. -![Gradle task output](img/launched.png) +Gradle task output Finally, when the IDE launches, there should be a new menu to the right of the **Help** menu. Your plugin is now configured on Gradle.