org.apache.tools.ant.taskdefs.optional.dotnet
public class VisualBasicCompile extends DotnetCompile
All parameters are optional: <vbc/> should suffice to produce a debug build of all *.vb files.
The task is a directory based task, so attributes like includes="**\/*.vb" and excludes="broken.vb" can be used to control the files pulled in. By default, all *.vb files from the project folder down are included in the command. When this happens the destFile -if not specified- is taken as the first file in the list, which may be somewhat hard to control. Specifying the output file with destfile is prudent.
Also, dependency checking only works if destfile is set.
For historical reasons the pattern
**
/*.vb
is preset as includes list and
you can not override it with an explicit includes attribute. Use
nested <src>
elements instead of the basedir
attribute if you need more control.
Example
<vbc optimize="true" debug="false" warnLevel="4" targetType="exe" definitions="RELEASE" excludes="src/unicode_class.vb" mainClass = "MainApp" destFile="NetApp.exe" optionExplicit="true" optionCompare="text" references="System.Xml,System.Web.Xml" > <reference file="${testCSC.dll}" /> <define name="RELEASE" /> <define name="DEBUG" if="debug.property"/> <define name="def3" unless="def2.property"/> </vbc>
UNKNOWN: name="vbc" category="dotnet"
Constructor Summary | |
---|---|
VisualBasicCompile()
Constructor for VisualBasicCompile. |
Method Summary | |
---|---|
protected void | addCompilerSpecificOptions(NetCommand command)
implement VBC commands |
void | clear()
reset all contents. |
protected String | createResourceParameter(DotnetResource resource)
from a resource, get the resource param |
String | getFileExtension()
Get the extension of filenames to compile. |
String | getImports()
Get global imports for namespaces in referenced metadata files. |
protected String | getImportsParameter()
Format the option for imports. |
String | getOptionCompare()
"binary" or "text" for the string-comparison style. |
protected String | getOptionCompareParameter()
Format the option for string comparison style. |
boolean | getOptionExplicit()
Get the flag for whether to require explicit declaration of variables. |
String | getOptionExplicitParameter()
Form the option string for optionExplicit.. |
boolean | getOptionStrict()
Get the flag for whether to enforce strict language semantics. |
String | getOptionStrictParameter()
For the option string for optionStrict. |
String | getReferenceDelimiter()
Get the delimiter that the compiler uses between references.
|
boolean | getRemoveIntChecks()
Get the flag for removing integer checks. |
String | getRemoveIntChecksParameter()
Form the option string for removeIntChecks. |
String | getRootNamespace()
Get the root namespace. |
protected String | getRootNamespaceParameter()
Form the option string for rootNamespace. |
protected String | getWin32ResParameter()
get the argument or null for no argument needed
This is overridden from DotnetCompile.java because VBC uses
"/win32resource:" rather than "/win32res:"
|
void | setImports(String imports)
Declare global imports for namespaces in referenced metadata files. |
void | setOptionCompare(String optionCompare)
Specify binary- or text-style string comparisons. |
void | setOptionExplicit(boolean flag)
Whether to require explicit declaration of variables. |
void | setOptionStrict(boolean flag)
Enforce strict language semantics. |
void | setRemoveIntChecks(boolean flag)
Whether to remove integer checks. |
void | setRootNamespace(String rootNamespace)
Specifies the root namespace for all type declarations. |
protected void | validate()
validation code |
Parameters: command
Parameters: resource
Returns: a string containing the resource param, or a null string to conditionally exclude a resource.
Returns: The string extension of files to compile.
Returns: the imports string.
Returns: the formatted import option.
Returns: the option compare style.
Returns: The formatted option.
Returns: true if flag is turned on
Returns: The parameter string.
Returns: true if flag is turned on
Returns: The parameter string.
Returns: The string delimiter for the reference string.
Returns: true if flag is turned on
Returns: The parameter string.
Returns: the root namespace.
Returns: the root namespace option string.
Returns: The Win32Res Parameter to CSC
Parameters: imports the imports string
Parameters: optionCompare the option compare style. "text" | "binary".
Parameters: flag on/off flag
Parameters: flag on/off flag
Parameters: flag on/off flag
Parameters: rootNamespace a root namespace.
Throws: BuildException if validation failed