This task compiles Visual Basic.NET source into executables or modules.
The task requires vbc.exe on the execute path, unless it or an equivalent
program is specified in the
executable parameter
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.
As with <csc> nested
src filesets of source,
reference filesets, definitions and resources can be provided.
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>
createResourceParameter
protected String createResourceParameter(DotnetResource resource)
from a resource, get the resource param
- createResourceParameter in interface DotnetCompile
- a string containing the resource param, or a null string
to conditionally exclude a resource.
getFileExtension
public String getFileExtension()
Get the extension of filenames to compile.
- getFileExtension in interface DotnetCompile
- The string extension of files to compile.
getImports
public String getImports()
Get global imports for namespaces in referenced metadata files.
getImportsParameter
protected String getImportsParameter()
Format the option for imports.
- the formatted import option.
getOptionCompare
public String getOptionCompare()
"binary" or "text" for the string-comparison style.
- the option compare style.
getOptionCompareParameter
protected String getOptionCompareParameter()
Format the option for string comparison style.
getOptionExplicit
public boolean getOptionExplicit()
Get the flag for whether to require explicit declaration of variables.
- true if flag is turned on
getOptionExplicitParameter
public String getOptionExplicitParameter()
Form the option string for optionExplicit..
getOptionStrict
public boolean getOptionStrict()
Get the flag for whether to enforce strict language semantics.
- true if flag is turned on
getOptionStrictParameter
public String getOptionStrictParameter()
For the option string for optionStrict.
getReferenceDelimiter
public String getReferenceDelimiter()
Get the delimiter that the compiler uses between references.
For example, c# will return ";"; VB.NET will return ","
- getReferenceDelimiter in interface DotnetCompile
- The string delimiter for the reference string.
getRemoveIntChecks
public boolean getRemoveIntChecks()
Get the flag for removing integer checks.
- true if flag is turned on
getRemoveIntChecksParameter
public String getRemoveIntChecksParameter()
Form the option string for removeIntChecks.
getRootNamespace
public String getRootNamespace()
Get the root namespace.
getRootNamespaceParameter
protected String getRootNamespaceParameter()
Form the option string for rootNamespace.
- the root namespace option string.
getWin32ResParameter
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:"
- getWin32ResParameter in interface DotnetCompile
- The Win32Res Parameter to CSC
setImports
public void setImports(String imports)
Declare global imports for namespaces in referenced metadata files.
imports
- the imports string
setOptionCompare
public void setOptionCompare(String optionCompare)
Specify binary- or text-style string comparisons. Defaults
to "binary"
optionCompare
- the option compare style. "text" | "binary".
setOptionExplicit
public void setOptionExplicit(boolean flag)
Whether to require explicit declaration of variables.
setOptionStrict
public void setOptionStrict(boolean flag)
Enforce strict language semantics.
setRemoveIntChecks
public void setRemoveIntChecks(boolean flag)
Whether to remove integer checks. Default false.
setRootNamespace
public void setRootNamespace(String rootNamespace)
Specifies the root namespace for all type declarations.
rootNamespace
- a root namespace.