Use external tools and builder in Eclipse

Using launch configurations in Eclipse Europa, you can run external programs from within the development environment. Launch configurations also allow you to save settings for how you want to call an external program, including parameters you would like to send it, environment variables you want to set, or even what to do in the IDE before and after you execute the command. What's more, if you want to run the command each time you build your project — before or after — you can import the launch configuration into a builder and use it in Eclipse.

External tools are applications or scripts that typically act as extensions to your development environment. For example, they may be used to execute scripts to package and deploy your application or to run an external compiler on your source files. External tools allow an end user to achieve a basic level of integration for a non-Eclipse-aware tool without writing a plug-in. External tools are created and configured via Run > External Tools > External Tools or from the drop-down menu on the Runbutton with the toolbox overlay.

If you want to write your own category of external tool, such as support for a different scripting language, you need to write a plug-in. The process for defining external tools is almost identical to writing your own launch configuration. Essentially, an external tool is a launch-configuration type that belongs to the special external-tools category:

 <launchConfigurationType
     name="My Tool"
     delegate="com.xyz.MyLaunchDelegate"
     category="org.eclipse.ui.externaltools"
     modes="run"
     id="com.xyz.MyLaunchType">
  </launchConfigurationType>

For each project you can register a nature for which you can associate a certain builder. A builder is an object that manipulates your resources in your Eclipse IDE and creates other resources.For example the "Java Builder" is used to translate Java Source files into .class files.You can create your own builders by implementing the extension point "org.eclipse.core.resources.builders".Each builder is subclassed from "IncrementalProjectBuilder" and must implement the method build().

In case autobuild is active then this method is called from the eclipse Framework if resources are changed. The method is also called if the user selects "Clean", "Build" or "Build All" from the menu.Builder are included in the file ".project" in the buildCommands tag.

The method build() get a parameter if a full build (FULL_BUILD) or a delta build (INCREMENTAL_BUILD) has to be done. To get the changes in case of a delta build you can use the getDelta(getProject()) call which returns a "IResourceDelta".

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值