Run Commamd Before Build in IntelliJ IDEA
I came across this question at StackOverflow
when I was searching the same question in Google.
I found that you don’t need a ant build script, that is just use the IntelliJ default system is just fine. For example, I am doing my project with android-ndk, so I want intelliJ run ndk-build NDK_DEBUG=1 -j4
before normal build.
Here is the solution:
- Run -> Editor configuration
- Select on of you build configuration in the left side of the dialog.
- On the right side there is an area marked as Before Launch
- Click the “plus” button, choose
Run External Tool
in the popup menu. - Click the “plus” button in the new popup window
- Then you get into the real configuration window.
Let me show you some fine picture:
1. Select on of you build configuration in the left side of the dialog.
2. On the right side there is an area marked as Before Launch
3. Select on of you build configuration in the left side of the dialog.
4. Click the “plus” button in the new popup window
5. Then you get into the real configuration window.