Search code examples
eclipsemakefilewaf

What is the best way to integrate an external build tool into Eclipse?


I've just started using Eclipse for Python development since we can make use of a lovely plugin I've found to enable distributed pair-programming. Anyway, the next step to getting Eclipse to integrate properly with our existing environment, would be finding a way to drive our current build tool (Waf) from within the IDE.

So the question is, is there a way I can set up Eclipse to drive Waf in a Make-like fashion? I see for Make it has some quite advanced functionality, such as being able to work out what targets are available etc. Bonus points for telling me if there is a way I could go as far as this! (I suspect the answer is that this is all built in to the Make plugin for Ecplipse).


Solution

  • You could try and define a Custom builder, calling Waf with the appropriate options for the python compilation step.

    http://nmake.alcatel-lucent.com/manual/eclipse/jdt_lu38/builders.png

    (From eclipsejdt alcatel-lucent manual)

    That picture (not related to Waf at all) illustrates the fact a builder can be defined as an external tool (meaning any .bat or shell you may want to call)

    In that "eclipsejdt" example, the custom builder was configured like so:

    To set up the builder, bring up the property dialog for project "jex1p" by selecting the project in the Package Explorer and selecting Project > Properties > Builders. Then click New..., select Program, and click OK.

    Configure the builder Main tab using values:

    Name             : nmbldr_pre
    Location         : ${system_path:ksh}
    Working Directory: ${build_project}
    Arguments        : nmbldr -p 2 -t ${build_type} -s jpre