Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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).

like image 969
jkp Avatar asked Jul 27 '09 15:07

jkp


2 Answers

In eclipse CDT I run waf by simply changing the build program in ProjectPreferences->C/C++ Build->BuilderSettings Choose External builder and then put in the path to waf

for example I use /Users/mark/bin/waf -v -k -j2

Note that waf and make do not agree on the -j setting and you have to give i explicitly and not use the eclipse dialog.

You can use the Make targets view add the targets to call waf e.g. configure, build etc.

One issue I had is that Eclipse is hard coded to see the output from Make say Make when i changes directory so I had to patch waf see waf issue

like image 169
mmmmmm Avatar answered Nov 19 '22 18:11

mmmmmm


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
like image 23
VonC Avatar answered Nov 19 '22 17:11

VonC