External build tool; module dependency


Just started using Idea (10.0.3 Build #IC-103.255) not only for debugging but for building as well.

My projects contains, aside Java, several native sources which should be compiled into dynamic library for plugging via JNI during runtime.
I already have cmake-based build environment for native sources.

I already created an ant build XML file with two targets for running build native sources (build_native) and for cleaning them (clean_native).
Also I created an "artifact" (I've read the documentation but failed to understand the exact purpose of those but) which have launching ant target build_native as "Pre-processing".
Now the artifact appears in Build menu and my ant targets are available on "Ant Build" panel.

Question is: how can I set this build to be launched during project build?

Related question is how to launch specific extenal tools prior to module's building? As my project contains generated sources I have to launch the generation process before compiling those.

Thanks in advance.

Comment actions Permalink

Run/Debug is Run and Debug and building is some another thing so I guess this won't help though I'll keep that in mind.

Right click in Ant target is much closer, thanks for that.

Execute on Before the compilation... Compilation of what? Whole project I guess, i.e., first module in modules dependency?

Comment actions Permalink

The most straightforward way for is to define Run/Debug configurations as necessary. You can set up a module to build there and also run Ant target and build an artifact.
Alternatively, right click on Ant target in Ant toolwindow and choose "Execute on | Before or After Compilation".


Please sign in to leave a comment.