IntelliJ IDEA 2016.1 Help

Configuring Triggers for Ant Build Target

You can configure triggers that run Ant targets before or after certain events, for example, compiling,
running, or testing. These triggers are called
compilation trigger and execution trigger respectively.