将外部构建工具集成到 Eclipse 中的最佳方法是什么?
我刚刚开始使用 Eclipse 进行 Python 开发,因为我们可以利用我发现的一个可爱的插件来实现分布式结对编程。 无论如何,让 Eclipse 与我们现有环境正确集成的下一步是找到一种方法来驱动我们当前的构建工具 (Waf)从 IDE 中。
所以问题是,有没有一种方法可以设置 Eclipse 以类似 Make
的方式驱动 Waf? 我看到 Make
它有一些相当高级的功能,例如能够计算出哪些目标可用等。告诉我是否有办法可以做到这一点的奖励积分! (我怀疑答案是这全部内置于 Ecplipse 的 Make 插件中)。
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).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在 eclipse CDT 中,我通过简单地更改构建程序来运行 waf
ProjectPreferences->C/C++ Build->BuilderSettings
选择外部构建器,然后输入 waf 的路径,
例如我使用的
/Users/mark/bin/waf -v -k -j2
请注意,waf 和 make 在 -j 设置上不一致,您必须明确给出 i 并且不使用 eclipse 对话框。
您可以使用 Make 目标视图添加目标来调用 waf,例如配置、构建等。
我遇到的一个问题是,当我更改目录时,Eclipse 是硬编码的,无法看到 Make 的输出,因此我必须修补 waf
请参阅 waf 问题
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
您可以尝试定义一个自定义构建器,使用 python 编译步骤的适当选项调用 Waf。
(来自eclipsejdt alcatel-lucent手册)
那张图片(与Waf 完全)说明了构建器可以定义为外部工具(意味着您可能想要调用的任何
.bat
或 shell)的事实alcatel-lucent.com/manual/eclipsejdt.html" rel="nofollow noreferrer">eclipsejdt" 示例,自定义构建器的配置如下:
You could try and define a Custom builder, calling Waf with the appropriate options for the python compilation step.
(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:
正如 VonC 所说,优雅的方法是使用 自定义构建器。
或者,(在短期内)将 ant 脚本拼凑在一起来完成繁重的工作并定义 外部构建器 将其配置到项目中。 您可能会发现外部构建器的缺点(例如没有增量支持)意味着值得投入精力“正确”地做到这一点。
As VonC says, the elegant way is to use a Custom builder.
Alternatively it is less work (in the short term) to hack together an ant script to do the heavy lifting and define an external builder to configure it onto the project. You may find the drawbacks of an external builder (e.g. no incremental support) mean it is worth investing the effort to do it "properly".