Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Added Uwe's tip about Eclipse

...

  • Gradle runs fastest when it uses a daemon. The first time you use gradle, it'll take some time (usually 10-20 seconds) to start the daemon and build caches. You'll see a message about "starting daemon". Subsequent runs should mostly skip this step
    • You may want to change org.gradle.daemon.idletimeout=900000 in your gradle.properties file (written the first time you run gradle) to a longer interval (this is in ms) to avoid restarting the daemon as frequently.
    • gradlew --stop will stop the daemon if you think it's confused.
  • The The gradle build will fail on un-suppressed warnings. Trunk compiles cleanly, all warnings are suppressed or have been fixed (mostly suppressed). The first option if your new code generates more warnings is to change the code so it doesn't. Failing that add a SuppressWarnings annotation, but please try to fix the code first.
    • If you're working on code and can remove some of these suppressions, please do. It was too big a task to try to fix all the warnings by fixing the code all at once. We should improve from here.
  • The gradle validation checks fail on log messages that follow potentially wasteful patterns. ./gradlew helpValidateLogCalls describes how to avoid these errors. This is part of ./gradlew check.
    • The validation is a bit harsh, if you have a logging call that is flagged but you've inspected and know is correct/efficient, add //logok as a comment. But please read through ./gradlew helpValidateLogCalls for guidelines, it's more complex than it appears at first blushglance.
  • It's not necessary to run the idea task before opening the project, just "open or import" and choose the root directory of your source tree.
  • The output directories have changed for artifacts and test results. Pay close attention to the messages on the screen at the end of a task execution, they'll tell you exactly where to look.

IntelliJ IDE

Tip
titleOpening the project

There is a gradlew idea task, but it usually is sufficient to just "open or import" the root directory. IntelliJ may prompt you to "import Gradle project?" and you can answer "yes". This will take a minute or two the first time.


IntelliJ integration is useful. There's nothing special about our support for Idea, it's just the one that's been exercised most. In particular the gradle window lets you easily execute tasks. In the case of failures because of the -Werror flag and just click to the source. The classes and testClasses tasks are particularly useful here as they just compile the Java code without the extra work the assemble task does.

...

Eclipse is also a popular IDE, and support has been added. However, this IDE has not been exercised nearly as much as IntelliJ. If you prefere Eclipse, please report any shortcomings on the dev mailing list.

Tip
titleOpening the project

After running the gradlew eclipse task, don't import it as gradle project, just as a plain java project.


Other IDEs:

Please feel free to add any tips about other IDEs. As mentioned above, IntelliJ was just what has been used most.

...