平台提供的 Ant 任务

平台提供一些有用的 Ant 任务和属性,它们可与工作空间交互作用。它们可以与被设置为与工作空间在同一 JRE 中进行构建的构建文件配合使用。

eclipse.refreshLocal

此任务是 IResource.refreshLocal() 方法的包装器。示例:

<eclipse.refreshLocal resource="MyProject/MyFolder" depth="infinite"/>

eclipse.incrementalBuild

当提供了 project 属性时,此任务是 IProject.build() 的包装器。否则,此任务是 IWorkspace.build() 方法的包装器。在这两种情况下,构建类型都始终是 IncrementalProjectBuilder#INCREMENTAL_BUILD

示例:

<eclipse.incrementalBuild/>
<eclipse.incrementalBuild project="MyProject"/>

eclipse.convertPath

将文件系统路径转换为资源路径,反之亦然。将结果值指定给指定属性。必须指定 property 属性,并且必须指定 fileSystemPathresourcePath 属性。当提供了文件系统路径时,此任务是 IWorkspaceRoot.getContainerForLocation(IPath) 的包装器。当提供了资源路径时,此任务是 IResource.getLocation() 的包装器。

示例:

<eclipse.convertPath fileSystemPath="${basedir}" property="myPath"/>
<eclipse.convertPath resourcePath="MyProject/MyFile" property="myPath"/>