17.4.3 Recompiling with Gradle

Gradle supports continuous builds, letting you run a task that will be rerun whenever source files change. To use this with a reloading agent (configured as described above), run the application normally (with the agent), and then run a recompilation task in a separate terminal with continuous mode enabled.

Run the app

  1. $ ./gradlew run

Run the recompilation

  1. $ ./gradlew -t classes

The classes task will be rerun every time a source file is modified, allowing the reloading agent to pick up the change.