~ubuntu-branches/ubuntu/jaunty/ant/jaunty-proposed

« back to all changes in this revision

Viewing changes to docs/manual/OptionalTasks/native2ascii.html

  • Committer: Bazaar Package Importer
  • Author(s): Stefan Gybas
  • Date: 2002-02-14 14:28:48 UTC
  • Revision ID: james.westby@ubuntu.com-20020214142848-2ww7ynmqkj31vlmn
Tags: upstream-1.4.1
ImportĀ upstreamĀ versionĀ 1.4.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<html>
 
2
  <head><title>Native2Ascii</title></head>
 
3
  <body>
 
4
    <h2>Native2Ascii</h2>
 
5
    
 
6
    <h3>Description:</h3>
 
7
    
 
8
    <p>
 
9
      Converts files from native encodings to ASCII with escaped Unicode.
 
10
      A common usage is to convert source files maintained in a native
 
11
      operating system encoding, to ASCII prior to compilation.
 
12
    </p>
 
13
 
 
14
    <p>
 
15
      Files in the directory <em>src</em>
 
16
      are converted from a native encoding to ASCII.
 
17
      By default, all files in the directory are converted.
 
18
      However, conversion may be limited to selected files using
 
19
      <em>includes</em> and <em>excludes</em> attributes.
 
20
      For more information on file matching patterns,
 
21
      see the section on
 
22
      <a href="index.html../dirtasks.html#directorybasedtasks">directory based tasks</a>.
 
23
      If no <em>encoding</em> is specified, 
 
24
      the default encoding for the JVM is used.
 
25
      If <em>ext</em> is specified, then output files are renamed
 
26
      to use it as a new extension. 
 
27
      More sophisticated file name translations can be achieved using a nested
 
28
      <em>&lt;mapper&gt;</em> element. By default an 
 
29
      <a href="../CoreTypes/mapper.html#identity-mapper">identity mapper</a> will be used.
 
30
      If <em>dest</em> and <em>src</em> point to the same directory,
 
31
      the <em>ext</em> attribute or a nested <em>&lt;mapper&gt;</em>
 
32
      is required.
 
33
    </p>
 
34
 
 
35
    <p>
 
36
      This task forms an implicit <a href="index.html../CoreTypes/fileset.html">File Set</a>,
 
37
      and supports all attributes of <code>&lt;fileset&gt;</code>
 
38
      (<code>dir</code> becomes <code>src</code>) as well as 
 
39
      nested <code>&lt;include&gt;</code>, <code>&lt;exclude&gt;</code>,
 
40
      and <code>&lt;patternset&gt;</code> elements.
 
41
    </p>
 
42
 
 
43
    <table border="1" cellpadding="2" cellspacing="0">
 
44
      <tr>
 
45
        <td><b>Attribute</b></td>
 
46
        <td><b>Description</b></td>
 
47
        <td><b>Required</b></td>
 
48
      </tr>
 
49
      <tr>
 
50
        <td>reverse</td>
 
51
        <td>Reverse the sense of the conversion,
 
52
          i.e. convert from ASCII to native</td>
 
53
        <td align="center">No</td>
 
54
      </tr>
 
55
      <tr>
 
56
        <td>encoding</td>
 
57
        <td>The native encoding the files are in
 
58
          (default is the default encoding for the JVM)</td>
 
59
        <td align="center">No</td>
 
60
      </tr>
 
61
      <tr>
 
62
        <td>src</td>
 
63
        <td>The directory to find files in (default is <em>basedir</em>)</td>
 
64
        <td align="center">No</td>
 
65
      </tr>
 
66
      <tr>
 
67
        <td>dest</td>
 
68
        <td>The directory to output file to</td>
 
69
        <td align="center">Yes</td>
 
70
      </tr>
 
71
      <tr>
 
72
        <td>ext</td>
 
73
        <td>File extension to use in renaming output files</td>
 
74
        <td align="center">No</td>
 
75
      </tr>
 
76
      <tr>
 
77
        <td>defaultexcludes</td>
 
78
        <td>indicates whether default excludes should be used or not
 
79
          (&quot;yes&quot;/&quot;no&quot;).
 
80
          Default excludes are used when omitted.
 
81
        </td>
 
82
        <td align="center">No</td>
 
83
      </tr>
 
84
      <tr>
 
85
        <td>includes</td>
 
86
        <td>comma separated list of patterns of files that must be
 
87
          included. All files are included when omitted.</td>
 
88
        <td align="center">No</td>
 
89
      </tr>
 
90
      <tr>
 
91
        <td>includesfile</td>
 
92
        <td>the name of a file. Each line of this file is
 
93
          taken to be an include pattern</td>
 
94
        <td align="center">No</td>
 
95
      </tr>
 
96
      <tr>
 
97
        <td>excludes</td>
 
98
        <td>comma separated list of patterns of files that must be excluded.
 
99
          No files (except default excludes) are excluded when omitted.</td>
 
100
        <td align="center">No</td>
 
101
      </tr>
 
102
      <tr>
 
103
        <td>excludesfile</td>
 
104
        <td>the name of a file. Each line of this file is
 
105
          taken to be an exclude pattern</td>
 
106
        <td align="center">No</td>
 
107
      </tr>
 
108
    </table>
 
109
      
 
110
    <h3>Examples</h3>
 
111
 
 
112
    <pre>
 
113
&lt;native2ascii encoding=&quot;EUCJIS&quot; src=&quot;srcdir&quot; dest=&quot;srcdir&quot;
 
114
   includes=&quot;**/*.eucjis&quot; ext=&quot;.java&quot; /&gt;
 
115
    </pre>
 
116
 
 
117
    <p>
 
118
      Converts all files in the directory <em>srcdir</em>
 
119
      ending in <code>.eucjis</code> from the EUCJIS encoding to ASCII
 
120
      and renames them to end in <code>.java</code>.
 
121
    </p>
 
122
 
 
123
<pre>
 
124
&lt;native2ascii encoding='EUCJIS&quot; src=&quot;native/japanese&quot; dest=&quot;src&quot;
 
125
   includes=&quot;**/*.java /&gt;
 
126
</pre>
 
127
 
 
128
    <p>
 
129
      Converts all the files ending in <code>.java</code>
 
130
      in the directory <em>native/japanese</em> to ASCII,
 
131
      placing the results in the directory <em>src</em>.
 
132
      The names of the files remain the same.
 
133
    </p>
 
134
  </body>
 
135
</html>