Skip to content

Commit aa1cc60

Browse files
delbertleggFridaTveit
authored andcommitted
Update CONTRIBUTING with Intellij instructions (exercism#1761)
* Update CONTRIBUTING with Intellij instructions * Update, include testing instructions * Fix typo
1 parent 40e101d commit aa1cc60

9 files changed

Lines changed: 44 additions & 1 deletion

CONTRIBUTING.md

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,53 @@ To submit a fix for an existing exercise or port an exercise to Java with the le
6363
$ git commit -m "(An intention-revealing commit message)"
6464
$ git push
6565
```
66-
6766
The Git Basics doc has a section on [commit messages](https://github.com/exercism/docs/blob/master/contributing/git-basics.md#commit-messages) that provides practical advice on crafting meaningful commit messages.
6867
- **Verify that your work passes all tests.** When you create a pull request (PR), GitHub triggers a build on Travis CI. Your PR will not be merged unless those tests pass.
6968
- **Check the style of your code**. Running `gradle check` from the root folder of the exercise, the checkstyle plugin will show you every style violation of your code
69+
70+
## Contributing using Intellij IDEA
71+
72+
Intellij IDEA is one of the more popular IDEs when working with Java, and it includes several tools to help simplify the process. The following steps outline how to import the git repository, make changes, and push
73+
them back to your fork (this is assuming you have already forked the repo...if you haven't, see the link about [forking](https://help.github.com/articles/fork-a-repo/)).
74+
75+
- **Open the IDE and import the project** From the startup menu, select "Check out from Version Control". This will open a dialog where you can enter in the URL of the git repository and specify the directory that you would
76+
like to clone the repo into.
77+
78+
![import](assets/clone-repo.png)
79+
80+
- Select "Import Project from External Model" and click the "Gradle" radio
81+
82+
![gradle](assets/gradle-import.png)
83+
84+
- Set the Gradle properties per the screenshot below. Ensure that the "exercises" folder is selected as the root of the project
85+
86+
![gradle](assets/gradle-setup.png)
87+
88+
- **Add the `java` folder as a module** Open the project settings and view the modules. Click the `+` button, select "Import Module". Select the `java` directory and accept the default values.
89+
90+
![java-module](assets/java-module.png)
91+
92+
- **Create a feature branch** The git tools in IDEA are located in the VCS menu. To createa a new branch, select VCS > Git > Branches and then click "New Branch". Give the branch a meaningful name and create.
93+
94+
![branch](assets/branch-menu.png)
95+
![create](assets/branch-name.png)
96+
97+
- Make all of your changes, following the instructions in this guide.
98+
99+
- **Testing your changes** Each exercise will have gradle tasks that can be executed from the IDE. To test changes within an exercise, find the gradle task for that folder in the "Gradle" toolbar on the right,
100+
open the Tasks > Verification folder and double click `test`
101+
102+
![diff](assets/run-test.png)
103+
104+
- **Commit/Merge changes** Once all of the changes have been made, you can look at the diffs and commit from the "Commit File" window, which can be reached by selecting VCS > Git > Commit File from the top menu.
105+
If all of the changes are acceptable, checkmark all of the files that are to be committed, enter a meaningful commit message, and then click "Commit and Push".
106+
107+
![diff](assets/commit-files.png)
108+
109+
- Follow the instructions regarding creating a pull request into the upstream repo.
110+
111+
**NOTE:** Git and gradle commands can still be run in the command line when using and IDE. The steps outlining how to perform using IDE tools are for convenience only.
112+
70113
## Getting Familiar With the Codebase
71114

72115
There are two objectives to the design of this build:

assets/branch-menu.png

944 KB
Loading

assets/branch-name.png

214 KB
Loading

assets/clone-repo.png

318 KB
Loading

assets/commit-files.png

698 KB
Loading

assets/gradle-import.png

531 KB
Loading

assets/gradle-setup.png

588 KB
Loading

assets/java-module.png

1010 KB
Loading

assets/run-test.png

468 KB
Loading

0 commit comments

Comments
 (0)