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 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!-- Documenting T:NAnt.DotNet.Tasks.VbcTask-->
<head>
<meta http-equiv="Content-Language" content="en-ca" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="../style.css" />
<title><vbc> Task</title>
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="2" class="NavBar">
<tr>
<td class="NavBar-Cell">
<a href="http://nant.sourceforge.net">
<b>NAnt</b>
</a>
<img alt="->" src="../images/arrow.gif" />
<a href="../index.html">Help</a>
<img alt="->" src="../images/arrow.gif" />
<a href="../tasks/index.html">Task Reference</a>
<img alt="->" src="../images/arrow.gif" /> <vbc></td>
<td class="NavBar-Cell" align="right">
v0.85</td>
</tr>
</table>
<h1><vbc></h1>
<p> Compiles Visual Basic.NET programs. </p>
<p class="i2">
<b>Note:</b> In order to have <a href="../tasks/vbc.html"><vbc></a> task generate manifest resource names that match those generated by Microsoft Visual Studio.NET, the value of the <code>prefix</code> attribute of the <<code>resources</code>> element should match the "Root namespace" of the VB.NET project, and the value of the <code>dynamicprefix</code> attribute should be set to "<b>false</b>". </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">baseaddress</td>
<td style="text-align: center;">string</td>
<td> The preferred base address at which to load a DLL. The default base address for a DLL is set by the .NET Framework common language runtime. </td>
<td style="text-align: center;">False</td>
</tr>
<tr>
<td valign="top">debug</td>
<td style="text-align: center;">
<a href="../enums/NAnt.DotNet.Types.DebugOutput.html">DebugOutput</a>
</td>
<td> Specifies the type of debugging information generated by the compiler. The default is <code>None</code>. </td>
<td style="text-align: center;">False</td>
</tr>
<tr>
<td valign="top">doc</td>
<td style="text-align: center;">file</td>
<td> The name of the XML documentation file to generate. Only supported when targeting .NET 2.0 (or higher). </td>
<td style="text-align: center;">False</td>
</tr>
<tr>
<td valign="top">imports</td>
<td style="text-align: center;">string</td>
<td>
<i>Deprecated.</i> Specifies whether the <code>/imports</code> option gets passed to the compiler. </td>
<td style="text-align: center;">False</td>
</tr>
<tr>
<td valign="top">nostdlib</td>
<td style="text-align: center;">bool</td>
<td> Instructs the compiler not to reference standard libraries (system.dll and VBC.RSP). The default is <b>false</b>. Only supported when targeting .NET 2.0 (or higher). </td>
<td style="text-align: center;">False</td>
</tr>
<tr>
<td valign="top">optioncompare</td>
<td style="text-align: center;">string</td>
<td> Specifies whether <code>/optioncompare</code> option gets passed to the compiler. </td>
<td style="text-align: center;">False</td>
</tr>
<tr>
<td valign="top">optionexplicit</td>
<td style="text-align: center;">bool</td>
<td> Specifies whether the <code>/optionexplicit</code> option gets passed to the compiler. The default is <b>false</b>. </td>
<td style="text-align: center;">False</td>
</tr>
<tr>
<td valign="top">optionoptimize</td>
<td style="text-align: center;">bool</td>
<td> Specifies whether the <code>/optimize</code> option gets passed to the compiler. The default is <b>false</b>. </td>
<td style="text-align: center;">False</td>
</tr>
<tr>
<td valign="top">optionstrict</td>
<td style="text-align: center;">bool</td>
<td> Specifies whether the <code>/optionstrict</code> option gets passed to the compiler. The default is <b>false</b>. </td>
<td style="text-align: center;">False</td>
</tr>
<tr>
<td valign="top">platform</td>
<td style="text-align: center;">string</td>
<td> Specifies which platform version of common language runtime (CLR) can run the output file. </td>
<td style="text-align: center;">False</td>
</tr>
<tr>
<td valign="top">removeintchecks</td>
<td style="text-align: center;">bool</td>
<td> Specifies whether the <code>/removeintchecks</code> option gets passed to the compiler. The default is <b>false</b>. </td>
<td style="text-align: center;">False</td>
</tr>
<tr>
<td valign="top">rootnamespace</td>
<td style="text-align: center;">string</td>
<td> Specifies whether the <code>/rootnamespace</code> option gets passed to the compiler. </td>
<td style="text-align: center;">False</td>
</tr>
<tr>
<td valign="top" class="required">output</td>
<td style="text-align: center;">file</td>
<td> The output file created by the compiler. </td>
<td style="text-align: center;">True</td>
</tr>
<tr>
<td valign="top" class="required">target</td>
<td style="text-align: center;">string</td>
<td> Output type. Possible values are <code>exe</code>, <code>winexe</code>, <code>library</code> or <code>module</code>. </td>
<td style="text-align: center;">True</td>
</tr>
<tr>
<td valign="top">define</td>
<td style="text-align: center;">string</td>
<td> Define conditional compilation symbol(s). </td>
<td style="text-align: center;">False</td>
</tr>
<tr>
<td valign="top">failonerror</td>
<td style="text-align: center;">bool</td>
<td> Determines if task failure stops the build, or is just reported. The default is <b>true</b>. </td>
<td style="text-align: center;">False</td>
</tr>
<tr>
<td valign="top">if</td>
<td style="text-align: center;">bool</td>
<td> If <b>true</b> then the task will be executed; otherwise, skipped. The default is <b>true</b>. </td>
<td style="text-align: center;">False</td>
</tr>
<tr>
<td valign="top">keycontainer</td>
<td style="text-align: center;">string</td>
<td> Specifies the key pair container used to strongname the assembly. </td>
<td style="text-align: center;">False</td>
</tr>
<tr>
<td valign="top">keyfile</td>
<td style="text-align: center;">file</td>
<td> Specifies a strong name key file. </td>
<td style="text-align: center;">False</td>
</tr>
<tr>
<td valign="top">main</td>
<td style="text-align: center;">string</td>
<td> Specifies which type contains the Main method that you want to use as the entry point into the program. </td>
<td style="text-align: center;">False</td>
</tr>
<tr>
<td valign="top">nowarn</td>
<td style="text-align: center;">string</td>
<td>
<i>Deprecated.</i> Specifies a comma-separated list of warnings that should be suppressed by the compiler. </td>
<td style="text-align: center;">False</td>
</tr>
<tr>
<td valign="top">rebuild</td>
<td style="text-align: center;">bool</td>
<td> Instructs NAnt to recompile the output file regardless of the file timestamps. </td>
<td style="text-align: center;">False</td>
</tr>
<tr>
<td valign="top">timeout</td>
<td style="text-align: center;">int</td>
<td> The maximum amount of time the application is allowed to execute, expressed in milliseconds. Defaults to no time-out. </td>
<td style="text-align: center;">False</td>
</tr>
<tr>
<td valign="top">unless</td>
<td style="text-align: center;">bool</td>
<td> Opposite of <code>if</code>. If <b>false</b> then the task will be executed; otherwise, skipped. The default is <b>false</b>. </td>
<td style="text-align: center;">False</td>
</tr>
<tr>
<td valign="top">verbose</td>
<td style="text-align: center;">bool</td>
<td> Determines whether the task should report detailed build log messages. The default is <b>false</b>. </td>
<td style="text-align: center;">False</td>
</tr>
<tr>
<td valign="top">warnaserror</td>
<td style="text-align: center;">bool</td>
<td> Instructs the compiler to treat all warnings as errors. The default is <b>false</b>. </td>
<td style="text-align: center;">False</td>
</tr>
<tr>
<td valign="top">win32icon</td>
<td style="text-align: center;">file</td>
<td> Icon to associate with the application. </td>
<td style="text-align: center;">False</td>
</tr>
</table>
</div>
<h3>Framework-configurable 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">exename</td>
<td style="text-align: center;">string</td>
<td> The name of the executable that should be used to launch the external program. </td>
<td style="text-align: center;">False</td>
</tr>
<tr>
<td valign="top">nostdlib</td>
<td style="text-align: center;">bool</td>
<td> Instructs the compiler not to reference standard libraries (system.dll and VBC.RSP). The default is <b>false</b>. Only supported when targeting .NET 2.0 (or higher). </td>
<td style="text-align: center;">False</td>
</tr>
<tr>
<td valign="top">supportsdocgeneration</td>
<td style="text-align: center;">bool</td>
<td> Specifies whether the compiler for the active target framework supports generation of XML Documentation file. The default is <b>false</b>. </td>
<td style="text-align: center;">False</td>
</tr>
<tr>
<td valign="top">supportskeycontainer</td>
<td style="text-align: center;">bool</td>
<td> Indicates whether the compiler for a given target framework supports the "keycontainer" option. The default is <b>false</b>. </td>
<td style="text-align: center;">False</td>
</tr>
<tr>
<td valign="top">supportskeyfile</td>
<td style="text-align: center;">bool</td>
<td> Indicates whether the compiler for a given target framework supports the "keyfile" option. The default is <b>false</b>. </td>
<td style="text-align: center;">False</td>
</tr>
<tr>
<td valign="top">supportsnostdlib</td>
<td style="text-align: center;">bool</td>
<td> Specifies whether the compiler for the active target framework supports NOT referencing standard libraries (system.dll and VBC.RSP). The default is <b>false</b>. </td>
<td style="text-align: center;">False</td>
</tr>
<tr>
<td valign="top">supportsnowarnlist</td>
<td style="text-align: center;">bool</td>
<td> Indicates whether the compiler for a given target framework supports a command line option that allows a list of warnings to be suppressed. The default is <b>false</b>. </td>
<td style="text-align: center;">False</td>
</tr>
<tr>
<td valign="top">supportspackagereferences</td>
<td style="text-align: center;">bool</td>
<td> Indicates whether package references are supported by compiler for a given target framework. The default is <b>false</b>. </td>
<td style="text-align: center;">False</td>
</tr>
<tr>
<td valign="top">supportsplatform</td>
<td style="text-align: center;">bool</td>
<td> Specifies whether the compiler for the active target framework supports limiting the platform on which the compiled code can run. The default is <b>false</b>. </td>
<td style="text-align: center;">False</td>
</tr>
<tr>
<td valign="top">supportswarnaserrorlist</td>
<td style="text-align: center;">bool</td>
<td> Indicates whether the compiler for a given target framework supports the "warnaserror" option that takes a list of warnings. The default is <b>false</b>. </td>
<td style="text-align: center;">False</td>
</tr>
<tr>
<td valign="top">useruntimeengine</td>
<td style="text-align: center;">bool</td>
<td> Specifies whether the external program should be executed using a runtime engine, if configured. The default is <b>false</b>. </td>
<td style="text-align: center;">False</td>
</tr>
</table>
</div>
<h3>Nested Elements:</h3>
<!--Element-->
<h4>
<a id="imports">
</a>
<<a href="../types/namespaceimports.html">imports</a>>
</h4>
<div class="nested-element"> The namespaces to import. <p /></div>
<h4>
<a id="imports">
</a>
</<a href="../types/namespaceimports.html">imports</a>>
</h4>
<!--Element-->
<h4>
<a id="warnaserror">
</a>
<<a href="../types/warnaserror.html">warnaserror</a>>
</h4>
<div class="nested-element"> Controls which warnings should be reported as errors. <p /></div>
<h4>
<a id="warnaserror">
</a>
</<a href="../types/warnaserror.html">warnaserror</a>>
</h4>
<!--Collection-->
<h4>
<a id="nowarn">
</a>
<nowarn>
</h4>
<div class="nested-element"> Specifies a list of warnings that you want the compiler to suppress. <h5><warning></h5><div class="nested-element"><p> Represents a compiler warning. </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">number</td><td style="text-align: center;">string</td><td> A warning number, or comma-separated list of warnings, that you want the compiler to suppress or report. </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 element will be processed; 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>true</b> then the element will be skipped; otherwise, processed. The default is <b>false</b>. </td><td style="text-align: center;">False</td></tr></table></div></div><h5></warning></h5></div>
<h4></nowarn></h4>
<!--Element-->
<h4>
<a id="lib">
</a>
<<a href="../types/fileset.html">lib</a>>
</h4>
<div class="nested-element">
<i>Deprecated.</i> Additional directories to search in for assembly references. <p /></div>
<h4>
<a id="lib">
</a>
</<a href="../types/fileset.html">lib</a>>
</h4>
<!--Element-->
<h4>
<a id="references">
</a>
<<a href="../types/assemblyfileset.html">references</a>>
</h4>
<div class="nested-element"> Reference metadata from the specified assembly files. <p /></div>
<h4>
<a id="references">
</a>
</<a href="../types/assemblyfileset.html">references</a>>
</h4>
<!--Collection-->
<h4>
<a id="pkg-references">
</a>
<pkg-references>
</h4>
<div class="nested-element"> Specifies list of packages to reference. <h5><package></h5><div class="nested-element"><p> Represents a package. </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> Name of the package to reference. Multiple package can be specified with a single element as a semi-colon separated list of package names. </td><td style="text-align: center;">True</td></tr><tr><td valign="top">if</td><td style="text-align: center;">bool</td><td> Indicates if the package should be passed to the task. If <b>true</b> then the package will be passed; 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> Indicates if the package should not be passed to the task. If <b>false</b> then the package will be passed; otherwise, skipped. The default is <b>false</b>. </td><td style="text-align: center;">False</td></tr></table></div></div><h5></package></h5></div>
<h4></pkg-references></h4>
<!--Array-->
<!--NestedElementArray=T:NAnt.DotNet.Types.ResourceFileSet-->
<h4>
<a id="resources">
</a>
<<a href="../types/resourcefileset.html">resources</a>>
</h4>
<div class="nested-element"> Resources to embed. </div>
<h4>
<a id="resources">
</a>
</<a href="../types/resourcefileset.html">resources</a>>
</h4>
<!--Element-->
<h4>
<a id="modules">
</a>
<<a href="../types/assemblyfileset.html">modules</a>>
</h4>
<div class="nested-element"> Link the specified modules into this assembly. <p /></div>
<h4>
<a id="modules">
</a>
</<a href="../types/assemblyfileset.html">modules</a>>
</h4>
<!--Element-->
<h4>
<a id="sources">
</a>
<<a href="../types/fileset.html">sources</a>>
</h4>
<div class="nested-element"> The set of source files for compilation. <p /></div>
<h4>
<a id="sources">
</a>
</<a href="../types/fileset.html">sources</a>>
</h4>
<!--Array-->
<!--NestedElementArray=T:NAnt.Core.Types.Argument-->
<h4>
<a id="arg">
</a>
<arg>
</h4>
<div class="nested-element"> The command-line arguments for the external program. <p> Represents a command-line argument. </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">dir</td><td style="text-align: center;">directory</td><td> The value for a directory-based command-line argument; will be replaced with the absolute path of the directory. </td><td style="text-align: center;">False</td></tr><tr><td valign="top">file</td><td style="text-align: center;">file</td><td> The name of a file as a single command-line argument; will be replaced with the absolute filename of the file. </td><td style="text-align: center;">False</td></tr><tr><td valign="top">if</td><td style="text-align: center;">bool</td><td> Indicates if the argument should be passed to the external program. If <b>true</b> then the argument will be passed; otherwise, skipped. The default is <b>true</b>. </td><td style="text-align: center;">False</td></tr><tr><td valign="top">line</td><td style="text-align: center;">string</td><td> List of command-line arguments; will be passed to the executable as is. </td><td style="text-align: center;">False</td></tr><tr><td valign="top">path</td><td style="text-align: center;"><path></td><td> The value for a PATH-like command-line argument; you can use <code>:</code> or <code>;</code> as path separators and NAnt will convert it to the platform's local conventions, while resolving references to environment variables. </td><td style="text-align: center;">False</td></tr><tr><td valign="top">unless</td><td style="text-align: center;">bool</td><td> Indicates if the argument should not be passed to the external program. If <b>false</b> then the argument will be passed; otherwise, skipped. The default is <b>false</b>. </td><td style="text-align: center;">False</td></tr><tr><td valign="top">value</td><td style="text-align: center;">string</td><td> A single command-line argument; can contain space characters. </td><td style="text-align: center;">False</td></tr></table></div><h3>Nested Elements:</h3><!--Element--><h4><a id="path"></a>
<<a href="../types/path.html">path</a>>
</h4><div class="nested-element"> Sets a single command-line argument and treats it like a PATH - ensures the right separator for the local platform is used. <p /></div><h4><a id="path"></a>
</<a href="../types/path.html">path</a>>
</h4><h3>Examples</h3><ul class="examples"><li><p> A single command-line argument containing a space character. </p><pre class="code">
<arg value="-l -a" />
</pre></li><li><p> Two separate command-line arguments. </p><pre class="code">
<arg line="-l -a" />
</pre></li><li><p> A single command-line argument with the value <code>\dir;\dir2;\dir3</code> on DOS-based systems and <code>/dir:/dir2:/dir3</code> on Unix-like systems. </p><pre class="code">
<arg path="/dir;/dir2:\dir3" />
</pre></li></ul></div>
<h4>
<a id="arg">
</a>
</arg>
</h4>
<h3>Examples</h3>
<ul class="examples">
<li>
<p>Example build file using this task.</p>
<pre class="code">
<project name="Hello World" default="build" basedir=".">
<property name="basename" value="HelloWorld" />
<target name="clean">
<delete file="${basename}-vb.exe" failonerror="false" />
<delete file="${basename}-vb.pdb" failonerror="false" />
</target>
<target name="build">
<vbc target="exe" output="${basename}-vb.exe" rootnamespace="${basename}">
<imports>
<import namespace="System" />
<import namespace="System.Data" />
</imports>
<sources>
<include name="${basename}.vb" />
</sources>
<resources prefix="${basename}" dynamicprefix="true">
<include name="**/*.resx" />
</resources>
<references>
<include name="System.dll" />
<include name="System.Data.dll" />
</references>
</vbc>
</target>
<target name="rebuild" depends="clean, build" />
</project>
</pre>
</li>
</ul>
<h3>Requirements</h3>
<div style="margin-left: 20px;">
<b>Assembly:</b> NAnt.DotNetTasks (0.85.2478.0)
</div>
</body>
</html>
|