fadeyev/intellijcoder — pull request #7 by mmicheo (2014-04-23 02:14:34+00:00)
Title: Several improvements

I recently switched from Eclipse to IntelliJ 13 and started using IntelliJCoder plugin when participating in TopCoder SRMs. I have made several modifications and enhancements to it. I hope you find these changes useful.

Features:
- Added hamcrest library to module if needed (JUnit 4.11 no longer includes hamcrest classes, and now requires the hamcrest library as a dependency)
- (Configurable: Module naming convention) Module names can be based on the class name (current behavior) (e.g. "Lottery" - one module per problem) or based on the contest name (e.g. "SRM 144 DIV 1" - one module per contest)
- (Configurable: Enforce time limit) Added execution time limit via @Test(timeout=####) to match the problem's limit
- Added memory limit via -Xmx vm parameters to match the problem's limit
- Added feature to save the problem's description to an html file
- Modified module creation to only create files if they don't already exist, includes module, class, test, and html.
- (Configurable: Folder names) Made folder structure configurable: src, test, and resource folders can be changed
- Modified plugin settings screen to include new configurable options. Split the configuration into 2 tabs. (see attached images - below)

The following shows an example of the file layout when using the two module naming styles. Having the following information...

- contest: SRM 144 DIV 1
- problem1:
- class: BinaryCode
- method signature: String[] decode(String message)
- problem2:
- class: Lottery
- method signature: String[] sortByOdds(String[] rules)
- problem3:
- class: PenLift
- method signature: int numTimes(String[] segments, int n)

When *MODULE NAME MATCHES CLASS NAME*:
Produces the following layout...

- project: (uses current open project)
- module1: BinaryCode
- src
- BinaryCode.java
- test
- BinaryCodeTest.java
- resource
- BinaryCode.html
- module2: Lottery
- src
- Lottery.java
- test
- LotteryTest.java
- resource
- Lottery.html
- module3: PenLift
- src
- PenLift.java
- test
- PenLiftTest.java
- resource
- PenLift.html

When *MODULE NAME MATCHES CONTEST NAME*:
Produces the following layout...

- project: (uses current open project)
- module: SRM 144 DIV 1
- src
- BinaryCode.java
- Lottery.java
- PenLift.java
- test
- BinaryCodeTest.java
- LotteryTest.java
- PenLiftTest.java
- resource
- BinaryCode.html
- Lottery.html
- PenLift.html

Plugin settings:

![intellijcoder-settings1](https://cloud.githubusercontent.com/assets/755072/2768038/5af5497c-ca3f-11e3-921f-ca7b06631546.png)

![intellijcoder-settings2](https://cloud.githubusercontent.com/assets/755072/2768041/640f00a2-ca3f-11e3-862d-4ff7c34c62dc.png)