~ubuntu-branches/ubuntu/trusty/ant/trusty

« back to all changes in this revision

Viewing changes to docs/manual/CoreTasks/basename.html

  • Committer: Bazaar Package Importer
  • Author(s): James Page, James Page, Niels Thykier
  • Date: 2011-05-04 15:16:42 UTC
  • mfrom: (5.2.8 sid)
  • Revision ID: james.westby@ubuntu.com-20110504151642-3cm7tbh8rwkdbpx8
[ James Page ]
* New upstream release (Closes: #613914).
  - Fix FTBFS for jug with ant 1.8.1 (Closes: #610320).
* Bumped Standards-Version to 3.9.2, no changes.
* Removed ant-nodeps.jar from install as now part of ant core. 
* Added myself to Uploaders.

[ Niels Thykier ]
* Added missing mh_clean, thanks to Miguel Landaeta for spotting
  this.
* Fixed a typo in the ant manpage.
* Made short descriptions unique.
* Bumped debhelper compat to 7.
* Removed empty linda-override dir from ant-doc.
* Removed redundant Priority fields in d/control.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<!--
2
 
   Licensed to the Apache Software Foundation (ASF) under one or more
3
 
   contributor license agreements.  See the NOTICE file distributed with
4
 
   this work for additional information regarding copyright ownership.
5
 
   The ASF licenses this file to You under the Apache License, Version 2.0
6
 
   (the "License"); you may not use this file except in compliance with
7
 
   the License.  You may obtain a copy of the License at
8
 
 
9
 
       http://www.apache.org/licenses/LICENSE-2.0
10
 
 
11
 
   Unless required by applicable law or agreed to in writing, software
12
 
   distributed under the License is distributed on an "AS IS" BASIS,
13
 
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 
   See the License for the specific language governing permissions and
15
 
   limitations under the License.
16
 
-->
17
 
<html>
18
 
 
19
 
<head>
20
 
<meta http-equiv="Content-Language" content="en-us">
21
 
<link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
22
 
<title>Basename Task</title>
23
 
</head>
24
 
 
25
 
<body>
26
 
 
27
 
<h2><a name="echo">Basename</a></h2>
28
 
<h3>Description</h3>
29
 
<p>
30
 
Task to determine the basename of a specified file, optionally minus a
31
 
specified suffix.
32
 
</p>
33
 
<p>
34
 
When this task executes, it will set the specified property to the
35
 
value of the last path element of the specified file. If <code>file</code> is a
36
 
directory, the basename will be the last directory element. If
37
 
<code>file</code> is a full-path, relative-path, or simple filename,
38
 
the basename will be the simple file name, without any directory elements.
39
 
</p>
40
 
<p> 
41
 
<h3>Parameters</h3>
42
 
<table border="1" cellpadding="2" cellspacing="0">
43
 
  <tr>
44
 
    <td valign="top"><b>Attribute</b></td>
45
 
    <td valign="top"><b>Description</b></td>
46
 
    <td align="center" valign="top"><b>Required</b></td>
47
 
  </tr>
48
 
  <tr>
49
 
    <td valign="top">file</td>
50
 
    <td valign="top">The path to take the basename of.</td>
51
 
    <td valign="top" align="center">Yes</td>
52
 
  </tr>
53
 
  <tr>
54
 
    <td valign="top">property</td>
55
 
    <td valign="top">The name of the property to set.</td>
56
 
    <td valign="top" align="center">Yes</td>
57
 
  </tr>
58
 
  <tr>
59
 
    <td valign="top">suffix</td>
60
 
    <td valign="top">The suffix to remove from the resulting basename
61
 
      (specified either with or without the &quot;<code>.</code>&quot;).</td>
62
 
    <td valign="top" align="center">No</td>
63
 
  </tr>
64
 
</table>
65
 
 
66
 
<h3>Examples</h3>
67
 
<blockquote><pre>
68
 
&lt;basename property=&quot;jar.filename&quot; file=&quot;${lib.jarfile}&quot;/&gt;
69
 
</pre></blockquote>
70
 
will set <code>jar.filename</code> to
71
 
<code>myjar.jar</code>, if <code>lib.jarfile</code> is defined as either a
72
 
full-path filename (eg., <code>/usr/local/lib/myjar.jar</code>),
73
 
a relative-path filename (eg., <code>lib/myjar.jar</code>),
74
 
or a simple filename (eg., <code>myjar.jar</code>).
75
 
<blockquote><pre>
76
 
&lt;basename property=&quot;cmdname&quot; file=&quot;D:/usr/local/foo.exe&quot;
77
 
          suffix=&quot;.exe&quot;/&gt;
78
 
</pre></blockquote>
79
 
will set <code>cmdname</code> to <code>foo</code>.
80
 
<blockquote><pre>
81
 
&lt;property environment=&quot;env&quot;/&gt;
82
 
&lt;basename property=&quot;temp.dirname&quot; file=&quot;${env.TEMP}&quot;/&gt;
83
 
</pre></blockquote>
84
 
 
85
 
will set <code>temp.dirname</code> to the last directory element of
86
 
the path defined for the <code>TEMP</code> environment variable.</p>
87
 
 
88
 
 
89
 
 
90
 
</body>
91
 
</html>
92