Slow compilation of game framework with scala project in intellij
I am using intellij 13.1.4.
When creating a play 2 project directly from intellij, I compile it and it takes about 9 seconds. This happens even when compiling one source.
Is there a known issue or something I should tweak to improve the compilation process?
I've been experimenting with scala for a while. I am new to intellij, play and sbt.
Thanks in advance.
Notes: I opened http://youtrack.jetbrains.com/issue/IDEA-129515 in reactive brains related to this question. I also tried the slowness workaround with the java compiler; but no result. This question was substantially updated because I got confused at first: I thought it took 2 seconds to compile the project generated with the idea, when during reuse it did not compile anything. I tried to invalidate the caches but got the same result. So this project is broken.
source to share
I wrote a very long article on how we fixed the compilation issue in Play Framework with my team.
https://medium.com/@jfcote/the-ultimate-solution-to-play-framework-slow-compilation-53f4fd499df4
Summarizing,
- Add this to build.sbt:
playEnhancerEnabled := false
- Using the refactoring tool, encapsulate each field of your entity models (making them private, generating a getter, and changing usage everywhere for the newly created getter). Only create a setter for fields that are used outside the class (you will know by compiling and seeing errors).
- Make sure to remove the @Transient annotation for all functions that are marked with it. We had these annotations for some of the functions because it collided with the Play Enhancer. Just remove the annotations and you should be fine!
- Compile and fix wherever you used the field if the refactoring tool didn't do its job.
source to share