Ant tool in Eclipse

本文介绍如何在Eclipse平台中利用Ant插件进行项目构建和管理,包括配置Ant偏好设置、使用Ant命令运行目标和任务,以及通过Ant插件实现对构建文件的UI支持和开发设施。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

We can install JRE and Ant standalone in our operation system and configure the Ant command avaiable in the command line.For a specific project, we change the directory to the location where build.xml or build.properties is located in the command line, then use ant command to run the targets and tasks defined in the build file (build.xml). Ant may support other formats of build file, you can check this on the apache ant officel site.

Ant toll is also integrated into Eclipse Platform in the plug-in manner. Eclipse Ant plug-in is designed to bring the power of Ant and Eclipse together. By this plugin, we can execute the build file from eclipse and eclipse supports both UI for Ant build files and output and build file development facility.

In details, Eclipse Ant plug-in makes use of Ant preferences, views, editors and commands to achieve those supports. Let me explore them one by one.

Ant Preference:

<extension
         point="org.eclipse.ui.preferencePages">
      <page
            name="%PreferencePage.antPreferences"
            class="org.eclipse.ant.internal.ui.preferences.AntPreferencePage"
            id="org.eclipse.ant.ui.AntPreferencePage">
            <keywordReference id="org.eclipse.ant.ui.general"/>
      </page>
      <page
            name="%PreferencePage.antRuntimePreferences"
            category="org.eclipse.ant.ui.AntPreferencePage"
            class="org.eclipse.ant.internal.ui.preferences.AntRuntimePreferencePage"
            id="org.eclipse.ant.ui.AntRuntimePreferencePage">
            <keywordReference id="org.eclipse.ant.ui.runtime"/>
      </page>
</extension>
In the plugin.properties file, find thoese entry sets:

PreferencePage.antPreferences = Ant
PreferencePage.antRuntimePreferences = Runtime
AntPreferencePage class takes FieldEditorPreferencePage as its super class and implements IWorkbenchPrefencePage interface.

public class AntPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
}
Create AntPrefencePage by its construtor

/**
 	 * Create the Ant page.
     */
	public AntPreferencePage() {
		super(GRID);
		setDescription(AntPreferencesMessages.AntPreferencePage_General);
		setPreferenceStore(AntUIPlugin.getDefault().getPreferenceStore());
	}
For detailed explanation, please refer to wiki fromhttp://eclipsepluginsite.com/preference-pages.html



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值