IntelliJ Project Setup

Section author: Luke Frisken <l.frisken@gmail.com>

This document explains to set up IntelliJ with this project.

../../../_images/Project_Setup_1.png

Import project

../../../_images/Project_Setup_2.png

Choose Gradle build file to import from

../../../_images/Project_Setup_3.png

Choose use gradle wrapper task configuration

../../../_images/Project_Setup_18.png

Choose Choose Gradle JVM Version 1.7

../../../_images/Project_Setup_4.png

Press OK

../../../_images/Project_Setup_5.png

Add this repo to IntelliJ

../../../_images/Project_Setup_6.png

Click on gradle sidebar (or open it under view->tool windows->gradle)

../../../_images/Project_Setup_7.png

Build the project (double click)

../../../_images/Project_Setup_8.png

See generated class files from protobuf

../../../_images/Project_Setup_9.png

Run main file first time by right click

../../../_images/Project_Setup_10.png

After this it is available on toolbar menu

Refreshing Project after Gradle Changes

Sometimes after adding new gradle dependencies or changes to the gradle file you will need to refresh the project to solve problems. This can be done using the following method:

../../../_images/Project_Setup_11.png

click to refresh the gradle project.

Running main Method Files

This describes how to set up IntelliJ to run a file with a main method, and set it up so that it is automatically rebuilt upon launch.

../../../_images/Project_Setup_17.png

Right click on file with main method and click run. This will generate a new run configuration which we can edit.

../../../_images/Project_Setup_12.png

Select the run configuration from the dropdown list and edit.

../../../_images/Project_Setup_13.png

Delete any existing “Make” tasks to run before launch

../../../_images/Project_Setup_14.png

Add a new run gradle task

../../../_images/Project_Setup_15.png

Select the current gradle project this run file is in.

../../../_images/Project_Setup_16.png

Select the “build” task