REFERENCE_OPTION
protected static final String REFERENCE_OPTION
additionalModules
protected String additionalModules
list of extra modules to refer to
debug
protected boolean debug
debug flag. Controls generation of debug information.
definitionList
protected Vector definitionList
a list of definitions to support;
executable
protected String executable
executable
extraOptions
protected String extraOptions
any extra command options?
mainClass
protected String mainClass
main class (or null for automatic choice)
referenceFilesets
protected Vector referenceFilesets
filesets of references
resources
protected Vector resources
our resources
targetType
protected String targetType
type of target. Should be one of exe|library|module|winexe|(null)
default is exe; the actual value (if not null) is fed to the command
line.
See /target
utf8output
protected boolean utf8output
utf out flag
addCompilerSpecificOptions
protected void addCompilerSpecificOptions(NetCommand command)
add any compiler specifics
command
-
addDefine
public void addDefine(DotnetDefine define)
add a define to the list of definitions
define
-
addReference
public void addReference(FileSet reference)
add a new reference fileset to the compilation
reference
-
addReferenceFilesets
protected int addReferenceFilesets(NetCommand command,
long outputTimestamp)
run through the list of reference files and add them to the command
outputTimestamp
- timestamp to compare against
- number of files out of date
addResource
public void addResource(DotnetResource resource)
link or embed a resource
resource
-
addResources
protected void addResources(NetCommand command)
for every resource declared, we get the (language specific)
resource setting
clear
public void clear()
reset all contents.
createNetCommand
protected NetCommand createNetCommand()
create our helper command
- a command prefilled with the exe name and task name
createResourceParameter
protected String createResourceParameter(DotnetResource resource)
from a resource, get the
resource
-
- a string containing the resource param, or a null string
to conditionally exclude a resource.
execute
public void execute()
throws BuildException
do the work by building the command line and then calling it
- execute in interface Task
BuildException
- if validation or execution failed
fillInSharedParameters
protected void fillInSharedParameters(NetCommand command)
fill in the common information
command
-
getAdditionalModulesParameter
protected String getAdditionalModulesParameter()
get the argument or null for no argument needed
- The AdditionalModules Parameter to CSC
getDebug
public boolean getDebug()
query the debug flag
- true if debug is turned on
getDebugParameter
protected String getDebugParameter()
get the debug switch argument
- The Debug Parameter to CSC
getDefinitionsDelimiter
public String getDefinitionsDelimiter()
override point for delimiting definitions.
- The definitions limiter, i.e., ";"
getDefinitionsParameter
protected String getDefinitionsParameter()
throws BuildException
get a list of definitions or null
- a string beginning /D: or null for no definitions
getDestFileParameter
protected String getDestFileParameter()
get the argument or null for no argument needed
- The OutputFile Parameter to CSC
getExecutable
protected String getExecutable()
This method gets the name of the executable.
- the name of the executable
getExtraOptions
public String getExtraOptions()
Gets the ExtraOptions attribute
- The ExtraOptions value
getExtraOptionsParameter
protected String getExtraOptionsParameter()
get any extra options or null for no argument needed
- The ExtraOptions Parameter to CSC
getFailOnError
public boolean getFailOnError()
query fail on error flag
- The FailFailOnError value
getFileExtension
public String getFileExtension()
Get the extension of filenames to compile.
- The string extension of files to compile.
getFilePattern
public String getFilePattern()
Get the pattern for files to compile.
- The compilation file pattern.
getIncludeDefaultReferences
public boolean getIncludeDefaultReferences()
query automatic reference inclusion flag
- true if flag is turned on
getIncludeDefaultReferencesParameter
protected String getIncludeDefaultReferencesParameter()
get the include default references flag or null for no argument needed
- The Parameter to CSC
getMainClass
public String getMainClass()
Gets the MainClass attribute
- The MainClass value
getMainClassParameter
protected String getMainClassParameter()
get the /main argument or null for no argument needed
- The MainClass Parameter to CSC
getOptimize
public boolean getOptimize()
query the optimise flag
- true if optimise is turned on
getOptimizeParameter
protected String getOptimizeParameter()
get the optimise flag or null for no argument needed
- The Optimize Parameter to CSC
getReferenceDelimiter
public String getReferenceDelimiter()
Get the delimiter that the compiler uses between references.
For example, c# will return ";"; VB.NET will return ","
- The string delimiter for the reference string.
getReferenceFilesParameter
protected String getReferenceFilesParameter()
turn the path list into a list of files and a /references argument
- null or a string of references.
getReferencesParameter
protected String getReferencesParameter()
get the reference string or null for no argument needed
- The References Parameter to CSC
getTargetType
public String getTargetType()
Gets the TargetType attribute
- The TargetType value
getTargetTypeParameter
protected String getTargetTypeParameter()
get the argument or null for no argument needed
- The TargetType Parameter to CSC
getUtf8OutputParameter
protected String getUtf8OutputParameter()
Gets the utf8OutpuParameter attribute of the CSharp object
- The utf8OutpuParameter value
getWarnLevel
public int getWarnLevel()
query warn level
- current value
getWarnLevelParameter
protected String getWarnLevelParameter()
get the warn level switch
- The WarnLevel Parameter to CSC
getWin32IconParameter
protected String getWin32IconParameter()
get the argument or null for no argument needed
- The Win32Icon Parameter to CSC
getWin32Res
public File getWin32Res()
Gets the file of the win32 .res file to include.
- path to the file.
getWin32ResParameter
protected String getWin32ResParameter()
get the argument or null for no argument needed
- The Win32Res Parameter to CSC
isFileManagedBinary
protected static boolean isFileManagedBinary(File file)
test for a file being managed or not
- true if we think this is a managed executable, and thus OK
for linking
- look at the PE header of the exe and see if it is managed or not.
isUseResponseFile
public boolean isUseResponseFile()
getter for flag
- The flag indicating whether the compilation is using a response file.
notEmpty
protected boolean notEmpty(String s)
test for a string containing something useful
s
- string in
- true if the argument is not null or empty
setAdditionalModules
public void setAdditionalModules(String params)
Semicolon separated list of modules to refer to.
params
- The new additionalModules value
setDebug
public void setDebug(boolean f)
set the debug flag on or off.
f
- on/off flag
setDestDir
public void setDestDir(File dirName)
Set the destination directory of files to be compiled.
dirName
- The new DestDir value
setExecutable
public void setExecutable(String executable)
set the name of the program, overriding the defaults.
Can be used to set the full path to a program, or to switch
to an alternate implementation of the command, such as the Mono or Rotor
versions -provided they use the same command line arguments as the
.NET framework edition
executable
-
setExtraOptions
public void setExtraOptions(String extraOptions)
Any extra options which are not explicitly supported
by this task.
extraOptions
- The new ExtraOptions value
setFailOnError
public void setFailOnError(boolean b)
If true, fail on compilation errors.
b
- The new FailOnError value
setIncludeDefaultReferences
public void setIncludeDefaultReferences(boolean f)
If true, automatically includes the common assemblies
in dotnet, and tells the compiler to link in mscore.dll.
set the automatic reference inclusion flag on or off this flag controls
the /nostdlib option in CSC
f
- on/off flag
setMainClass
public void setMainClass(String mainClass)
Sets the name of main class for executables.
mainClass
- The new MainClass value
setOptimize
public void setOptimize(boolean f)
If true, enables optimization flag.
f
- on/off flag
setReferenceFiles
public void setReferenceFiles(Path path)
Path of references to include.
Wildcards should work.
path
- another path to append
setReferences
public void setReferences(String s)
Semicolon separated list of DLLs to refer to.
s
- The new References value
setTargetType
public void setTargetType(String ttype)
throws BuildException
Set the type of target.
ttype
- The new TargetType value
BuildException
- if target is not one of
exe|library|module|winexe
setTargetType
public void setTargetType(DotnetCompile.TargetTypes targetType)
set the target type to one of exe|library|module|winexe
targetType
-
setUseResponseFile
public void setUseResponseFile(boolean useResponseFile)
Flag to turn on response file use; default=false.
When set the command params are saved to a file and
this is passed in with @file. The task automatically switches
to this mode with big commands; this option is here for
testing and emergencies
useResponseFile
-
setUtf8Output
public void setUtf8Output(boolean enabled)
If true, require all compiler output to be in UTF8 format.
enabled
- The new utf8Output value
setWarnLevel
public void setWarnLevel(int warnLevel)
Level of warning currently between 1 and 4
with 4 being the strictest.
warnLevel
- warn level -see .net docs for valid range (probably
0-4)
setWin32Icon
public void setWin32Icon(File fileName)
Set the filename of icon to include.
fileName
- path to the file. Can be relative, absolute, whatever.
setWin32Res
public void setWin32Res(File fileName)
Sets the filename of a win32 resource (.RES) file to include.
This is not a .NET resource, but what Windows is used to.
fileName
- path to the file. Can be relative, absolute, whatever.