|
| 1 | +# Project Set up |
| 2 | +This tutorial was created using IntelliJ IDEA 2016.3. Should be similar for other versions including Android Studio. |
| 3 | + |
| 4 | +### Pre-requisites |
| 5 | +According to the [official guidelines](https://www.jetbrains.com/help/idea/2016.3/plugin-development-guidelines.html#d1348165e8): |
| 6 | + |
| 7 | +1. Download and install a JDK. |
| 8 | +2. Make sure that the Plugin DevKit plugin is enabled. |
| 9 | +3. Optionally, [download](http://www.jetbrains.org/display/IJOS/Download) the IntelliJ IDEA Community Edition sources. This will make debugging your plugins much easier. |
| 10 | +4. You also need to configure IntelliJ Platform Plugin SDK. Instructions [here](https://www.jetbrains.com/help/idea/2016.3/configuring-intellij-platform-plugin-sdk.html) |
| 11 | + |
| 12 | +### IDE Set up |
| 13 | + |
| 14 | +1. Open up IntelliJ and select *Create project from version control* |
| 15 | +![aja][src-github] |
| 16 | +2. Select GitHub and enter `https://github.com/afcastano/AutoValuePlugin.git`. Click *clone* |
| 17 | +3. Select *Create project from existing sources* and click next |
| 18 | +4. Select location and name and click next |
| 19 | +5. Un-select all folders except the first two corresponding to `src` and `test` |
| 20 | +![aja][module-folders] |
| 21 | +6. If a library is detected, remove it. In this case `AutoValuePlugin` on the dist folder might have been detected. Un-select it and click next. |
| 22 | +![aja][Library] |
| 23 | +7. In the module structure dialog, select the module and click next. |
| 24 | +![aja][DefaultModule] |
| 25 | +8. A warning will appear indicating that the module already exists. **Click Reuse**. |
| 26 | +![aja][UseExisting] |
| 27 | +9. After this, make sure the *IntelliJ Platform Plugin SDK* appears on the list (According to [pre-requisites](#pre-requisites) ) and hit next. |
| 28 | +![aja][ConfigureSDK] |
| 29 | +10. Click Finish. |
| 30 | +11. Go to Project settings and select `7 - Diamonds` as the Language level. Click OK. |
| 31 | +![aja][Java7] |
| 32 | + |
| 33 | +That's it, the project should be configured and ready to go. |
| 34 | + |
| 35 | +### Testing the plugin |
| 36 | +- To run the tests, Right click on the test folder and **Run 'All Tests'** |
| 37 | + |
| 38 | +- To manually test the plugin: |
| 39 | + * Create a new run configuration of type plugin, Give any name and select AutoValuePlugin for the "Use Classpath of module" box. |
| 40 | + * Run the new configuration, it will fire up a new instance of IntelliJ with the development version of the plugin installed. |
| 41 | +![aja][Run] |
| 42 | + |
| 43 | +[src-github]:(img/GitHub.png) |
| 44 | +[module-folders]:(img/ModuleFolders.png) |
| 45 | +[Library]:(img/Library.png) |
| 46 | +[DefaultModule]:(img/DefaultModule.png) |
| 47 | +[UseExisting]:(img/UseExisting.png) |
| 48 | +[ConfigureSDK]:(img/ConfigureSDK.png) |
| 49 | +[Java7]:(img/Java7.png) |
| 50 | +[Run]:(img/Run.png) |
0 commit comments