eclipse:保存后自动构建 [英] eclipse: auto build after save

查看:178
本文介绍了eclipse:保存后自动构建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个ant脚本创建可运行的jar,我希望它每次在代码中进行更改并保存时运行它。我想我需要一些保存后自动构建选项。是否有这样的事情?

解决方案

您可以将脚本声明为构建器,并使其运行在自动构建期间





查看项目的属性:可以添加一个外部程序(上图)或一个脚本(下面)。





如果您可以将脚本作为蚂蚁脚本导出,例如 OP David B 他的答案,这很容易:


  1. 导出为蚂蚁脚本:右键单击项目 - >出口 - > runaable jar文件,勾选另存为ANT脚本完成

  2. 将蚂蚁脚本添加为构建器:右键单击项目 - >属性 - >建筑商 - >新的(Ant)

    粘贴ant文件的路径,转到目标选项卡,然后单击 设置目标按钮旁边的自动构建

    最后点击确定确定确定


I have an ant script that creates runnable jar and I want it to run each time I make changes in my code and save them. I guess I need some "auto build after save" option in Eclipse. Is there such a thing?

解决方案

You could declare your script as a builder, and make it run "during auto build".

See the properties of your project: you can add an external program (above) or an an script (below).

If you can export your script as an ant script, like the OP David B did in his answer, it becomes quite easy:

  1. Export as an ant script: right-click the project -> export -> runaable jar file, tick "save as ANT script" and finish.
  2. Add the ant script as a builder: right-click the project -> properties -> Builders -> new (Ant).
    Paste the path for the ant file, go to "targets" tab and click the "set targets" button next to "auto build".
    Finally, click OK, OK, OK.

这篇关于eclipse:保存后自动构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆