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

被折叠的 条评论
为什么被折叠?



