转自:http://cyf0110.iteye.com/blog/1338635
外部工具的输出显示在控制台视图中。
在配置外部工具时可使用如下变量:
workspaceloc:workspace的绝对路径
{workspace_loc:}:
所指定的resource的绝对路径。resource path是相对于workspace root的完整路径。
注意:
workspaceloc:/myproject/myfile.txt和
{workspace_loc}/myproject/myfile.txt不一定相同,因为前者表示的myfile.txt可能位于workspace之外。
projectloc:当前所选择的resource所在的project或正构建的project或所选择的的绝对路径
{project_loc:}:
所指定的resource所在的project的绝对路径。resource path是相对于workspace root的相对路径。
projectpath当前选择的资源所在的project或者正构建的project的相对于workspaceroot的相对路径。
{project_name}
当前选择的资源所在的project或者正构建的project的名称
containerloc:当前所选择的资源的parent的绝对路径
{container_loc:}
所指定的resource的parent的绝对路径
resourceloc当前选定的资源的绝对路径
{resource_loc:}
所指定的资源的绝对路径
containerpath当前选定的资源的parent的相对于workspaceroot的路径
{resource_path}
当前选定的资源的相对于workspace root的路径
containername当前选定的资源的parent的名称
{resource_name}
当前选定的资源的名称
buildtype在外部工具作为构建的一部分时表示构建的类型。值可以是“full”、“incremental”、“auto”。如果外部工具运行于构建之外,值为“none”假设workspace目录为c:\eclipse\workspace。有两个project:MyProject1和MyProject2。MyProject1位于workspace之内。MyProject2位于workspace目录之外:c:\projects\MyProject2。选中资源/MyProject2/MyFolder/MyFile.txt,则运行外部工具时,各对应变量值如下:VariableExamplesExpandedResults
{workspace_loc} c:\eclipse\workspace
workspaceloc:/MyProject1/MyFile.txtc:\eclipse\workspace\MyProject\MyFile.txt
{workspace_loc:/MyProject2/MyFile.txt} c:\projects\MyProject2\MyFile.txt
projectlocc:\projects\MyProject2
{project_loc:/MyProject1/MyFile.txt} c:\eclipse\workspace\MyProject
containerlocc:\projects\MyProject2\MyFolder
{resource_loc} c:\projects\MyProject2\MyFile.txt
projectpath/MyProject2
{container_path} /MyProject2/MyFolder
resourcepath/MyProject2/MyFolder/MyFile.txt
{project_name} MyProject2
containernameMyFolder
{resource_name} MyFile.txt
${build_type} none