blob: 5495a4f6753c1aac06875ff62e63b776eabe76c5 [file] [log] [blame]
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2005. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta name="Author" content="OTI Employee">
<meta name="GENERATOR" content="Mozilla/4.75 [en] (Windows NT 5.0; U) [Netscape]">
<title>External tools</title>
<link REL="STYLESHEET" HREF="../book.css" CHARSET="ISO-8859-1" TYPE="text/css">
</head>
<body bgcolor="#FFFFFF">
<h1>
External tools</h1>
<p>External tools allow you to configure and run programs,
batch files, Ant buildfiles, and others using the Workbench. You can save
these external tool configurations and run them at a later time.</p>
<p>Output from external tools is displayed in the console
view.</p>
<p>You can add external tools as part of the build process
for a project. These external tools will run in the specified order every
time a project is built.</p>
<p>The following variables are available when you configure
an external tool. These variables are automatically expanded each time
the external tool is run.</p>
<blockquote>
<p><b>${workspace_loc}</b> - The absolute path on the system's
hard drive to Eclipse's workspace directory.</p>
<p><b>${workspace_loc:<i>&lt;resource path></i>}</b> - The
absolute path on the system's hard drive to the specified resource. The
<i>&lt;resource
path></i> is the full path of the resource relative to the workspace root.
For example ${workspace_loc:/MyProject/MyFile.txt}. Note that the expanded
result of this variable is not the same as ${workspace_loc}/MyProject/MyFile.txt
if the project's contents directory for MyProject is outside the workspace
directory.</p>
<p><b>${project_loc}</b> - The absolute path on the system's
hard drive to the currently selected resource's project or to the project
being built if the external tool is run as part of a build.</p>
<p><b>${project_loc:<i>&lt;resource path></i>}</b> - The
absolute path on the system's hard drive to the specified resource's project.
The
<i>&lt;resource path></i> is the full path of the resource relative
to the workspace root. For example ${workspace_loc:/MyProject/MyFile.txt}.
Note that the expanded result of this variable is not the same as ${workspace_loc}/MyProject
if the project's contents directory for MyProject is outside the workspace
directory.</p>
<p><b>${container_loc}</b> - The absolute path on the system's
hard drive to the currently selected resource's parent (either a folder
or project).</p>
<p><b>${container_loc:<i>&lt;resource path></i>}</b> - The
absolute path on the system's hard drive to the specified resource's parent
(either a folder or project). The <i>&lt;resource path></i> is the full
path of the resource relative to the workspace root. For example:${workspace_loc:/MyProject/MyFolder/MyFile.txt}.
Note that the expanded result of this variable is not the same as ${workspace_loc}/MyProject/MyFolder
if the project's contents directory for MyProject is outside the workspace
directory.</p>
<p><b>${resource_loc}</b> - The absolute path on the system's
hard drive to the currently selected resource.</p>
<p><b>${resource_loc:<i>&lt;resource path></i>}</b> - The
absolute path on the system's hard drive to the specified resource. The
<i>&lt;resource
path></i> is the full path of the resource relative to the workspace root.
For example ${workspace_loc:/MyProject/MyFile.txt}. Note that the expanded
result of this variable is not the same as ${workspace_loc}/MyProject/MyFile.txt
if the project's contents directory for MyProject is outside the workspace
directory.</p>
<p><b>${project_path}</b> - The full path, relative to the
workspace root, of the currently selected resource's project or of the
project being built if the external tool is run as part of a build.</p>
<p><b>${container_path}</b> - The full path, relative to the
workspace root, of the currently selected resource's parent (either a folder
or project).</p>
<p><b>${resource_path}</b> - The full path, relative to the
workspace root, of the currently selected resource.</p>
<p><b>${project_name}</b> - The name of the currently selected
resource's project or of the project being built if the external tool is
run as part of a build.</p>
<p><b>${container_name}</b> - The name of the currently selected
resource's parent (either a folder or project).</p>
<p><b>${resource_name}</b> - The name of the currently selected
resource.</p>
<p><b>${build_type}</b> - The kind of build when the external
tool is run as part of a build. The value can be one of "full", "incremental",
or "auto". If the external tool is run outside of a build, the value is
then "none".</p></blockquote>
<p>Lets assume your Eclipse workspace directory is c:\eclipse\workspace
and you have two projects, MyProject1 and MyProject2. The first project,
MyProject1, is located inside the workspace directory, the second project,
MyProject2, is located outside the workspace directory at c:\projects\MyProject2.
Lets look at how the variable examples below will be expanded when an
external tool is run, if the resource /MyProject2/MyFolder/MyFile.txt is
selected.
<br>&nbsp;
<br>&nbsp;
<center><table BORDER WIDTH="80%" >
<tr>
<td>
<center><b>Variable Examples</b></center>
</td>
<td>
<center><b>Expanded Results</b></center>
</td>
</tr>
<tr>
<td>${workspace_loc}</td>
<td>c:\eclipse\workspace</td>
</tr>
<tr>
<td>${workspace_loc:/MyProject1/MyFile.txt}</td>
<td>c:\eclipse\workspace\MyProject\MyFile.txt</td>
</tr>
<tr>
<td>${workspace_loc:/MyProject2/MyFile.txt}</td>
<td>c:\projects\MyProject2\MyFile.txt</td>
</tr>
<tr>
<td>${project_loc}</td>
<td>c:\projects\MyProject2</td>
</tr>
<tr>
<td>${project_loc:/MyProject1/MyFile.txt}</td>
<td>c:\eclipse\workspace\MyProject</td>
</tr>
<tr>
<td>${container_loc}</td>
<td>c:\projects\MyProject2\MyFolder</td>
</tr>
<tr>
<td>${resource_loc}</td>
<td>c:\projects\MyProject2\MyFile.txt</td>
</tr>
<tr>
<td>${project_path}</td>
<td>/MyProject2</td>
</tr>
<tr>
<td>${container_path}</td>
<td>/MyProject2/MyFolder</td>
</tr>
<tr>
<td>${resource_path}</td>
<td>/MyProject2/MyFolder/MyFile.txt</td>
</tr>
<tr>
<td>${project_name}</td>
<td>MyProject2</td>
</tr>
<tr>
<td>${container_name}</td>
<td>MyFolder</td>
</tr>
<tr>
<td>${resource_name}</td>
<td>MyFile.txt</td>
</tr>
<tr>
<td>${build_type}</td>
<td>none</td>
</tr>
</table></center>
</p>
<p><br><img src="../images/ngrelc.png" alt="Related concepts" border="0" >
<br><a href="concepts-antsupport.htm">Ant support</a>
<br><a href="concepts-22.htm">Builds</a></p>
<p><img src="../images/ngrelr.png" alt="Related reference" BORDER=0 >
<br><a href="../reference/ref-exttoolsprefs.htm">External Tools preferences</a><br>
<a href="../reference/ref-anticons.htm">External Tools and Ant icons</a></p>
<p><img src="../images/ngrelt.png" alt="Related tasks" BORDER=0 >
<br><a href="../tasks/tasks-exttools-running.htm">Running external tools</a>
<br><a href="../tasks/tasks-ant-running.htm">Running Ant buildfiles</a>
</p>
</body>
</html>