~mandel/ubuntuone-windows-installer/fix_null_pointer_start

« back to all changes in this revision

Viewing changes to tools/Nant/doc/help/types/patternset.html

  • Committer: Manuel de la Pena
  • Date: 2010-07-08 13:22:59 UTC
  • Revision ID: mandel@themacaque.com-20100708132259-y1jgyuyqfe9stt8u
Updated build script to run tests and added all the required tools so far.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
 
2
<html xmlns="http://www.w3.org/1999/xhtml">
 
3
  <!-- Documenting T:NAnt.Core.Types.PatternSet-->
 
4
  <head>
 
5
    <meta http-equiv="Content-Language" content="en-ca" />
 
6
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 
7
    <link rel="stylesheet" type="text/css" href="../style.css" />
 
8
    <title>&lt;patternset&gt; Type</title>
 
9
  </head>
 
10
  <body>
 
11
    <table width="100%" border="0" cellspacing="0" cellpadding="2" class="NavBar">
 
12
      <tr>
 
13
        <td class="NavBar-Cell">
 
14
          <a href="http://nant.sourceforge.net">
 
15
            <b>NAnt</b>
 
16
          </a>
 
17
          <img alt="-&gt;" src="../images/arrow.gif" />
 
18
          <a href="../index.html">Help</a>
 
19
          <img alt="-&gt;" src="../images/arrow.gif" />
 
20
          <a href="../types/index.html">Type Reference</a>
 
21
          <img alt="-&gt;" src="../images/arrow.gif" /> &lt;patternset&gt;</td>
 
22
        <td class="NavBar-Cell" align="right">
 
23
                        v0.90</td>
 
24
      </tr>
 
25
    </table>
 
26
    <h1>&lt;patternset&gt;</h1>
 
27
    <p> A set of patterns, mostly used to include or exclude certain files. </p>
 
28
    <p> The individual patterns support <code>if</code> and <code>unless</code> attributes to specify that the element should only be used if or unless a given condition is met. </p>
 
29
    <p> The <code>includesfile</code> and <code>excludesfile</code> elements load patterns from a file. When the file is a relative path, it will be resolved relative to the project base directory in which the patternset is defined. Each line of this file is taken to be a pattern. </p>
 
30
    <p> The number sign (#) as the first non-blank character in a line denotes that all text following it is a comment: </p>
 
31
    <pre class="code">
 
32
     EventLog.cs
 
33
     # requires Mono.Posix
 
34
     SysLogEventLogImpl.cs
 
35
     # uses the win32 eventlog API
 
36
     Win32EventLogImpl.cs
 
37
  </pre>
 
38
    <p> Patterns can be grouped to sets, and later be referenced by their <code>id</code>. </p>
 
39
    <p> When used as a standalone element (global type), any properties that are referenced will be resolved when the definition is processed, not when it actually used. Passing a reference to a nested build file will not cause the properties to be re-evaluated. </p>
 
40
    <p> To improve reuse of globally defined patternsets, avoid referencing any properties altogether. </p>
 
41
    <h3>Parameters</h3>
 
42
    <div class="table">
 
43
      <table>
 
44
        <tr>
 
45
          <th>Attribute</th>
 
46
          <th style="text-align: center;">Type</th>
 
47
          <th>Description</th>
 
48
          <th style="text-align: center;">Required</th>
 
49
        </tr>
 
50
        <tr>
 
51
          <td valign="top">id</td>
 
52
          <td style="text-align: center;">string</td>
 
53
          <td> The ID used to be referenced later. </td>
 
54
          <td style="text-align: center;">False</td>
 
55
        </tr>
 
56
        <tr>
 
57
          <td valign="top">refid</td>
 
58
          <td style="text-align: center;">string</td>
 
59
          <td> The ID to use as the reference. </td>
 
60
          <td style="text-align: center;">False</td>
 
61
        </tr>
 
62
      </table>
 
63
    </div>
 
64
    <h3>Nested Elements:</h3>
 
65
    <!--Array-->
 
66
    <!--NestedElementArray=T:NAnt.Core.Types.Pattern-->
 
67
    <h4>
 
68
      <a id="include">
 
69
      </a>
 
70
                    &lt;include&gt;
 
71
                </h4>
 
72
    <div class="nested-element"> Defines a single pattern for files to include. <p></p><h3>Parameters</h3><div class="table"><table><tr><th>Attribute</th><th style="text-align: center;">Type</th><th>Description</th><th style="text-align: center;">Required</th></tr><tr><td valign="top" class="required">name</td><td style="text-align: center;">string</td><td> The name pattern to include/exclude. </td><td style="text-align: center;">True</td></tr><tr><td valign="top">if</td><td style="text-align: center;">bool</td><td> If <b>true</b> then the pattern will be used; otherwise, skipped. The default is <b>true</b>. </td><td style="text-align: center;">False</td></tr><tr><td valign="top">unless</td><td style="text-align: center;">bool</td><td> If <b>false</b> then the pattern will be used; otherwise, skipped. The default is <b>false</b>. </td><td style="text-align: center;">False</td></tr></table></div></div>
 
73
    <h4>
 
74
      <a id="include">
 
75
      </a>
 
76
                    &lt;/include&gt;
 
77
                </h4>
 
78
    <!--Array-->
 
79
    <!--NestedElementArray=T:NAnt.Core.Types.Pattern-->
 
80
    <h4>
 
81
      <a id="includesfile">
 
82
      </a>
 
83
                    &lt;includesfile&gt;
 
84
                </h4>
 
85
    <div class="nested-element"> Loads multiple patterns of files to include from a given file, set using the <code>name</code> parameter. <p></p><h3>Parameters</h3><div class="table"><table><tr><th>Attribute</th><th style="text-align: center;">Type</th><th>Description</th><th style="text-align: center;">Required</th></tr><tr><td valign="top" class="required">name</td><td style="text-align: center;">string</td><td> The name pattern to include/exclude. </td><td style="text-align: center;">True</td></tr><tr><td valign="top">if</td><td style="text-align: center;">bool</td><td> If <b>true</b> then the pattern will be used; otherwise, skipped. The default is <b>true</b>. </td><td style="text-align: center;">False</td></tr><tr><td valign="top">unless</td><td style="text-align: center;">bool</td><td> If <b>false</b> then the pattern will be used; otherwise, skipped. The default is <b>false</b>. </td><td style="text-align: center;">False</td></tr></table></div></div>
 
86
    <h4>
 
87
      <a id="includesfile">
 
88
      </a>
 
89
                    &lt;/includesfile&gt;
 
90
                </h4>
 
91
    <!--Array-->
 
92
    <!--NestedElementArray=T:NAnt.Core.Types.Pattern-->
 
93
    <h4>
 
94
      <a id="exclude">
 
95
      </a>
 
96
                    &lt;exclude&gt;
 
97
                </h4>
 
98
    <div class="nested-element"> Defines a single pattern for files to exclude. <p></p><h3>Parameters</h3><div class="table"><table><tr><th>Attribute</th><th style="text-align: center;">Type</th><th>Description</th><th style="text-align: center;">Required</th></tr><tr><td valign="top" class="required">name</td><td style="text-align: center;">string</td><td> The name pattern to include/exclude. </td><td style="text-align: center;">True</td></tr><tr><td valign="top">if</td><td style="text-align: center;">bool</td><td> If <b>true</b> then the pattern will be used; otherwise, skipped. The default is <b>true</b>. </td><td style="text-align: center;">False</td></tr><tr><td valign="top">unless</td><td style="text-align: center;">bool</td><td> If <b>false</b> then the pattern will be used; otherwise, skipped. The default is <b>false</b>. </td><td style="text-align: center;">False</td></tr></table></div></div>
 
99
    <h4>
 
100
      <a id="exclude">
 
101
      </a>
 
102
                    &lt;/exclude&gt;
 
103
                </h4>
 
104
    <!--Array-->
 
105
    <!--NestedElementArray=T:NAnt.Core.Types.Pattern-->
 
106
    <h4>
 
107
      <a id="excludesfile">
 
108
      </a>
 
109
                    &lt;excludesfile&gt;
 
110
                </h4>
 
111
    <div class="nested-element"> Loads multiple patterns of files to exclude from a given file, set using the <code>name</code> parameter. <p></p><h3>Parameters</h3><div class="table"><table><tr><th>Attribute</th><th style="text-align: center;">Type</th><th>Description</th><th style="text-align: center;">Required</th></tr><tr><td valign="top" class="required">name</td><td style="text-align: center;">string</td><td> The name pattern to include/exclude. </td><td style="text-align: center;">True</td></tr><tr><td valign="top">if</td><td style="text-align: center;">bool</td><td> If <b>true</b> then the pattern will be used; otherwise, skipped. The default is <b>true</b>. </td><td style="text-align: center;">False</td></tr><tr><td valign="top">unless</td><td style="text-align: center;">bool</td><td> If <b>false</b> then the pattern will be used; otherwise, skipped. The default is <b>false</b>. </td><td style="text-align: center;">False</td></tr></table></div></div>
 
112
    <h4>
 
113
      <a id="excludesfile">
 
114
      </a>
 
115
                    &lt;/excludesfile&gt;
 
116
                </h4>
 
117
    <!--Element-->
 
118
    <h4>
 
119
      <a id="patternset">
 
120
      </a>
 
121
                    &lt;<a href="../types/patternset.html">patternset</a>&gt;
 
122
                </h4>
 
123
    <div class="nested-element"> Adds a nested set of patterns, or references other standalone patternset. <p /></div>
 
124
    <h4>
 
125
      <a id="patternset">
 
126
      </a>
 
127
                    &lt;/<a href="../types/patternset.html">patternset</a>&gt;
 
128
                </h4>
 
129
    <h3>Examples</h3>
 
130
    <ul class="examples">
 
131
      <li>
 
132
        <p> Define a set of patterns that matches all .cs files that do not contain the text <code>Test</code> in their name. </p>
 
133
        <pre class="code">
 
134
      &lt;patternset id="non.test.sources"&gt;
 
135
          &lt;include name="**/*.cs" /&gt;
 
136
          &lt;exclude name="**/*Test*" /&gt;
 
137
      &lt;/patternset&gt;
 
138
  </pre>
 
139
      </li>
 
140
      <li>
 
141
        <p> Define two sets. One holding C# sources, and one holding VB sources. Both sets only include test sources when the <code>test</code> property is set. A third set combines both C# and VB sources. </p>
 
142
        <pre class="code">
 
143
      &lt;patternset id="cs.sources"&gt;
 
144
          &lt;include name="src/**/*.cs" /&gt;
 
145
          &lt;include name="test/**/*.cs" if=${property::exist('test')}" /&gt;
 
146
      &lt;/patternset&gt;
 
147
      
 
148
      &lt;patternset id="vb.sources"&gt;
 
149
          &lt;include name="src/**/*.vb" /&gt;
 
150
          &lt;include name="test/**/*.vb" if=${property::exist('test')}" /&gt;
 
151
      &lt;/patternset&gt;
 
152
      
 
153
      &lt;patternset id="all.sources"&gt;
 
154
          &lt;patternset refid="cs.sources" /&gt;
 
155
          &lt;patternset refid="vb.sources" /&gt;
 
156
      &lt;/patternset&gt;
 
157
  </pre>
 
158
      </li>
 
159
      <li>
 
160
        <p> Define a set from patterns in a file. </p>
 
161
        <pre class="code">
 
162
      &lt;patternset id="sources"&gt;
 
163
          &lt;includesfile name="test.sources" /&gt;
 
164
          &lt;includesfile name="non.test.sources" /&gt;
 
165
      &lt;/patternset&gt;
 
166
  </pre>
 
167
      </li>
 
168
      <li>
 
169
        <p> Defines a patternset with patterns that are loaded from an external file, and shows the behavior when that patternset is passed as a reference to a nested build script. </p>
 
170
        <p> External file "c:\foo\build\service.lst" holding patterns of source files to include for the Foo.Service assembly: </p>
 
171
        <pre class="code">
 
172
    AssemblyInfo.cs
 
173
    *Channel.cs
 
174
    ServiceFactory.cs</pre>
 
175
        <p> Main build script located in "c:\foo\default.build": </p>
 
176
        <pre class="code">
 
177
    &lt;project name="main" default="build"&gt;
 
178
        &lt;property name="build.debug" value="true" /&gt;
 
179
    
 
180
        &lt;patternset id="service.sources"&gt;
 
181
            &lt;include name="TraceListener.cs" if="${build.debug}" /&gt;
 
182
            &lt;includesfile name="build/service.lst" /&gt;
 
183
        &lt;/patternset&gt;
 
184
        
 
185
        &lt;property name="build.debug" value="false" /&gt;
 
186
        
 
187
        &lt;target name="build"&gt;
 
188
            &lt;nant buildfile="service/default.build" inheritrefs="true" /&gt;
 
189
        &lt;/target&gt;
 
190
    &lt;/project&gt;</pre>
 
191
        <p> Nested build script located in "c:\foo\services\default.build" which uses the patternset to feed sources files to the C# compiler: </p>
 
192
        <pre class="code">
 
193
    &lt;project name="service" default="build"&gt;
 
194
        &lt;target name="build"&gt;
 
195
            &lt;csc output="../bin/Foo.Service.dll" target="library"&gt;
 
196
                &lt;fileset basedir="src"&gt;
 
197
                    &lt;patternset refid="service.sources" /&gt;
 
198
                &lt;/fileset&gt;
 
199
            &lt;/csc&gt;
 
200
        &lt;/target&gt;
 
201
    &lt;/project&gt;</pre>
 
202
        <p> At the time when the patternset is used in the "service" build script, the following source files in "c:\foo\services\src" match the defined patterns: </p>
 
203
        <pre class="code">
 
204
    AssemblyInfo.cs
 
205
    MsmqChannel.cs
 
206
    SmtpChannel.cs
 
207
    ServiceFactory.cs
 
208
    TraceListener.cs</pre>
 
209
        <p> You should have observed that: </p>
 
210
        <ul style="list-style-type: disc;">
 
211
          <li> although the patternset is used from the "service" build script, the path to the external file is resolved relative to the base directory of the "main" build script in which the patternset is defined. </li>
 
212
          <li> the "TraceListener.cs" file is included, even though the "build.debug" property was changed to <b xmlns="">false</b> after the patternset was defined (but before it was passed to the nested build, and used). </li>
 
213
        </ul>
 
214
      </li>
 
215
    </ul>
 
216
    <h3>Requirements</h3>
 
217
    <div style="margin-left: 20px;">
 
218
      <b>Assembly:</b> NAnt.Core (0.90.3780.0)
 
219
            </div>
 
220
    <h3>See Also</h3>
 
221
    <a href="../types/fileset.html">&lt;fileset&gt;</a>
 
222
  </body>
 
223
</html>
 
 
b'\\ No newline at end of file'