-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconcepts-exttools.htm
More file actions
208 lines (208 loc) · 8.71 KB
/
concepts-exttools.htm
File metadata and controls
208 lines (208 loc) · 8.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta name="copyright" content=
"Copyright (c) IBM Corporation and others 2000, 2011. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page.">
<meta charset="utf-8"/>
<title>External Tools</title>
<link rel="STYLESHEET" href="../book.css" type="text/css">
<style>
table, th, td {
border: 1px solid;
border-collapse: collapse;
}
</style>
</head>
<body>
<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 <b><a href=
"PLUGINS_ROOT/org.eclipse.jdt.doc.user/reference/views/console/ref-console_view.htm">Console view</a></b>.</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>
<table style="width:80%">
<caption>Variables available to external tools</caption>
<thead>
<tr>
<th style="width:25%">
<p>Variable Name</p>
</th>
<th>
<p>Description</p>
</th>
</tr>
</thead>
<tbody>
<tr>
<td><b>${workspace_loc}</b></td>
<td>The absolute path on the system's hard drive to Eclipse's workspace directory</td>
</tr>
<tr>
<td><b>${workspace_loc:<i><resource path></i>}</b></td>
<td>The absolute path on the system's hard drive to the specified resource. The <i><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.</td>
</tr>
<tr>
<td><b>${project_loc}</b></td>
<td>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.</td>
</tr>
<tr>
<td><b>${project_loc:<i><resource path></i>}</b></td>
<td>The absolute path on the system's hard drive to the specified resource's project. The <i><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.</td>
</tr>
<tr>
<td><b>${container_loc}</b></td>
<td>The absolute path on the system's hard drive to the currently selected resource's parent (either a folder
or project).</td>
</tr>
<tr>
<td><b>${container_loc:<i><resource path></i>}</b></td>
<td>The absolute path on the system's hard drive to the specified resource's parent (either a folder or
project). The <i><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.</td>
</tr>
<tr>
<td><b>${resource_loc}</b></td>
<td>The absolute path on the system's hard drive to the currently selected resource.</td>
</tr>
<tr>
<td><b>${resource_loc:<i><resource path></i>}</b></td>
<td>The absolute path on the system's hard drive to the specified resource. The <i><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.</td>
</tr>
<tr>
<td><b>${project_path}</b></td>
<td>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.</td>
</tr>
<tr>
<td><b>${container_path}</b></td>
<td>The full path, relative to the workspace root, of the currently selected resource's parent (either a folder
or project).</td>
</tr>
<tr>
<td><b>${resource_path}</b></td>
<td>The full path, relative to the workspace root, of the currently selected resource.</td>
</tr>
<tr>
<td><b>${project_name}</b></td>
<td>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.</td>
</tr>
<tr>
<td><b>${container_name}</b></td>
<td>The name of the currently selected resource's parent (either a folder or project).</td>
</tr>
<tr>
<td><b>${resource_name}</b></td>
<td>The name of the currently selected resource.</td>
</tr>
<tr>
<td><b>${build_type}</b></td>
<td>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".</td>
</tr>
</tbody>
</table>
<p>Lets assume your Eclipse workspace directory is <code>c:\eclipse\workspace</code> and you have two projects,
<code>MyProject1</code> and <code>MyProject2</code>. The first project, <code>MyProject1</code>, is located inside
the workspace directory, the second project, <code>MyProject2</code>, is located outside the workspace directory at
<code>c:\projects\MyProject2</code>. Lets look at how the variable examples below will be expanded when an external
tool is run, if the resource <code>/MyProject2/MyFolder/MyFile.txt</code> is selected.</p>
<table>
<caption>Variables available to external tools</caption>
<thead>
<tr>
<th style="width:25%">
<p>Variable Example</p>
</th>
<th>
<p>Expanded Results</p>
</th>
</tr>
</thead>
<tbody>
<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>
</tbody>
</table>
<h3 class="related">Related Concepts</h3><a href="concepts-antsupport.htm">Ant support</a><br>
<a href="concepts-22.htm">Builds</a>
<h3 class="related">Related Reference</h3><a href="../reference/ref-exttoolsprefs.htm">External Tools
preferences</a><br>
<a href="../reference/ref-anticons.htm">External Tools and Ant icons</a><br>
<a href="PLUGINS_ROOT/org.eclipse.jdt.doc.user/reference/views/console/ref-console_view.htm">Console view</a>
<h3 class="related">Related Tasks</h3><a href="../tasks/tasks-exttools-running.htm">Running external tools</a><br>
<a href="../tasks/tasks-ant-running.htm">Running Ant buildfiles</a>
</body>
</html>