Run extra command as part of build process
Answered
Hello,
I'm adding JNI code to the project and I've configured an "External Tool" step to build it.
How do I configure IntellIJ so that the external tool step is executed each time:
* Before running a specific or all junit test classes or methods?
* As part of a "Build -> Build Project" and "Build -> Rebuild Project" steps?
Thanks!
Please sign in to leave a comment.
> * As part of a "Build -> Build Project" and "Build -> Rebuild Project" steps?
There is no way to do it for External Tools, but you can use Ant for that, see https://www.jetbrains.com/help/idea/configuring-triggers-for-ant-build-target.html#734e2aa8.
> * Before running a specific or all junit test classes or methods?
You can add external tools / other run configuration in the Before Launch steps: https://www.jetbrains.com/help/idea/run-debug-configuration.html#createExplicitly.
Before launch – define whether you want to perform any specific actions before launching the application, for example, compile the modified sources or run an Ant or Maven script.
For more advanced behavior you would need to write a plug-in that integrates into IntelliJ IDEA Build system (JPS).
Ant worked great!
Thank you!