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

« back to all changes in this revision

Viewing changes to docs/manual/CoreTypes/filterset.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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
 
2
 
 
3
<HTML>
 
4
<HEAD>
 
5
  <TITLE>Ant User Manual</TITLE>
 
6
  <META http-equiv="Content-Type" content="text/html; charset=windows-1252">
 
7
  <META http-equiv="Content-Language" content="en-us">
 
8
  <META content="MSHTML 5.50.4522.1800" name=GENERATOR>
 
9
</HEAD>
 
10
 
 
11
<BODY>
 
12
<H2><A name="fileset">Filterset</A></H2>
 
13
 
 
14
<P>FilterSets are groups of filters. Filters can be defined as token value pairs 
 
15
or be read in from a file. FilterSets can appear inside tasks that support this 
 
16
feature or at the same level as <CODE>target</CODE> - i.e., as children of 
 
17
<CODE>project</CODE>.</P>In addition, Filtersets can have begintoken and/or 
 
18
endtoken attributes to define what to match. <BR>Filtersets are used for doing 
 
19
replacements in tasks like copy etc.<BR>
 
20
 
 
21
<H2>Filterset</H2>
 
22
 
 
23
<TABLE cellSpacing=0 cellPadding=2 border=1>
 
24
  <TR>
 
25
    <TD vAlign=top><B>Attribute</B></TD>
 
26
    <TD vAlign=top><B>Description</B></TD>
 
27
    <TD vAlign=top><B>Default</B></TD>
 
28
    <TD vAlign=top align="center"><B>Required</B></TD>
 
29
  </TR>
 
30
  <TR>
 
31
    <TD vAlign=top>begintoken</TD>
 
32
    <TD vAlign=top>The string marking the beginning of a token. eg 
 
33
      <STRONG>@</STRONG>Date@</TD>
 
34
    <TD vAlign=top>@</TD>
 
35
    <TD vAlign=top align="center">No</TD>
 
36
  </TR>
 
37
  <TR>
 
38
    <TD vAlign=top>endtoken</TD>
 
39
    <TD vAlign=top>The string marking the end of a token. eg 
 
40
      @Date<STRONG>@</STRONG></TD>
 
41
    <TD vAlign=top>@</TD>
 
42
    <TD vAlign=top align="center">No</TD>
 
43
  </TR>
 
44
</TABLE>
 
45
 
 
46
<H2>Filter</H2>
 
47
<TABLE cellSpacing=0 cellPadding=2 border=1>
 
48
  <TR>
 
49
    <TD vAlign=top><B>Attribute</B></TD>
 
50
    <TD vAlign=top><B>Description</B></TD>
 
51
    <TD vAlign=top align="center"><B>Required</B></TD>
 
52
  </TR>
 
53
  <TR>
 
54
    <TD vAlign=top>token</TD>
 
55
    <TD vAlign=top>The token to replace eg @<STRONG>Date</STRONG>@</TD>
 
56
    <TD vAlign=top align="center">Yes</TD>
 
57
  </TR>
 
58
  <TR>
 
59
    <TD vAlign=top>value</TD>
 
60
    <TD vAlign=top>The value to replace it with eg Thursday, April 26, 2001</TD>
 
61
    <TD vAlign=top align="center">Yes</TD>
 
62
  </TR>
 
63
</TABLE>
 
64
 
 
65
<H2>Filtersfile</H2>
 
66
<TABLE cellSpacing=0 cellPadding=2 border=1>
 
67
  <TR>
 
68
    <TD vAlign=top><B>Attribute</B></TD>
 
69
    <TD vAlign=top><B>Description</B></TD>
 
70
    <TD vAlign=top align="center"><B>Required</B></TD>
 
71
  </TR>
 
72
  <TR>
 
73
    <TD vAlign=top>file</TD>
 
74
    <TD vAlign=top>The file to load tokens from should be a properties file of 
 
75
      name value pairs.</TD>
 
76
    <TD vAlign=top align="center">Yes</TD>
 
77
  </TR>
 
78
</TABLE>
 
79
 
 
80
<H4>Examples</H4>
 
81
 
 
82
<p>You are copying the version.txt file to the dist directory from the build directory 
 
83
but wish to replace the token @DATE@ with todays date.</p>
 
84
<BLOCKQUOTE><PRE>
 
85
&lt;copy file=&quot;${build.home}/version.txt&quot; toFile=&quot;${dist.home}/version.txt&quot;&gt;
 
86
  &lt;filterset&gt;
 
87
    &lt;filter token=&quot;DATE&quot; value=&quot;${DATE}&quot;/&gt;
 
88
  &lt;/filterset&gt;
 
89
&lt;/copy&gt;
 
90
</PRE></BLOCKQUOTE>
 
91
 
 
92
<p>You are copying the version.txt file to the dist directory from the build directory 
 
93
but wish to replace the token %DATE* with todays date.</p>
 
94
<BLOCKQUOTE><PRE>
 
95
&lt;copy file=&quot;${build.home}/version.txt&quot; toFile=&quot;${dist.home}/version.txt&quot;&gt;
 
96
  &lt;filterset begintoken=&quot;%&quot; endtoken=&quot;*&quot;&gt;
 
97
    &lt;filter token=&quot;DATE&quot; value=&quot;${DATE}&quot;/&gt;
 
98
  &lt;/filterset&gt;
 
99
&lt;/copy&gt;
 
100
</PRE></BLOCKQUOTE>
 
101
 
 
102
<p>Copy all the docs but change all dates and appropriate notices as stored in a file.</p>
 
103
<BLOCKQUOTE><PRE>
 
104
&lt;copy toDir=&quot;${dist.home}/docs&quot; &gt;
 
105
  &lt;fileset dir=&quot;${build.home}/docs&quot;&gt;
 
106
    &lt;include name=&quot;**/*.html&quot;&gt;
 
107
  &lt;/fileset&gt;
 
108
  &lt;filterset begintoken=&quot;%&quot; endtoken=&quot;*&quot;&gt;
 
109
    &lt;filter token=&quot;DATE&quot; value=&quot;${DATE}&quot;/&gt;
 
110
    &lt;filtersfile file=&quot;${user.home}/dist.properties&quot;/&gt;
 
111
  &lt;/filterset&gt;
 
112
&lt;/copy&gt;
 
113
</PRE></BLOCKQUOTE>
 
114
 
 
115
<HR>
 
116
 
 
117
<P align=center>Copyright &copy; 2000,2001 Apache Software Foundation. All rights 
 
118
Reserved.</P></BODY></HTML>