Save This Page
Home » apache-ant-1.7.1-src » org.apache.tools » ant » taskdefs » optional » dotnet » [javadoc | source]
org.apache.tools.ant.taskdefs.optional.dotnet
abstract public class: DotnetCompile [javadoc | source]
java.lang.Object
   org.apache.tools.ant.ProjectComponent
      org.apache.tools.ant.Task
         org.apache.tools.ant.taskdefs.MatchingTask
            org.apache.tools.ant.taskdefs.optional.dotnet.DotnetBaseMatchingTask
               org.apache.tools.ant.taskdefs.optional.dotnet.DotnetCompile

All Implemented Interfaces:
    SelectorContainer, Cloneable

Direct Known Subclasses:
    CSharp, JSharp, VisualBasicCompile

Abstract superclass for dotnet compiler tasks. History
0.1 First creation Most of the code here was copied verbatim from v0.3 of Steve Loughran's CSharp optional task. Abstracted functionality to allow subclassing of other dotnet compiler types.
Nested Class Summary:
public static class  DotnetCompile.TargetTypes  Target types to build. valid build types are exe|library|module|winexe 
Field Summary
protected  Vector definitionList    a list of definitions to support; 
protected  Vector resources    our resources 
protected  String executable    executable 
protected static final  String REFERENCE_OPTION     
protected  boolean debug    debug flag. Controls generation of debug information. 
protected  String mainClass    main class (or null for automatic choice) 
protected  String extraOptions    any extra command options? 
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 
protected  boolean utf8output    utf out flag 
protected  String additionalModules    list of extra modules to refer to 
protected  Vector referenceFilesets    filesets of references 
Fields inherited from org.apache.tools.ant.taskdefs.optional.dotnet.DotnetBaseMatchingTask:
outputFile,  filesets,  srcDir,  isWindows
Fields inherited from org.apache.tools.ant.taskdefs.MatchingTask:
fileset
Fields inherited from org.apache.tools.ant.Task:
target,  taskName,  taskType,  wrapper
Fields inherited from org.apache.tools.ant.ProjectComponent:
project,  location,  description
Constructor:
 public DotnetCompile() 
Method from org.apache.tools.ant.taskdefs.optional.dotnet.DotnetCompile Summary:
addCompilerSpecificOptions,   addDefine,   addReference,   addReferenceFilesets,   addResource,   addResources,   clear,   createNetCommand,   createResourceParameter,   execute,   fillInSharedParameters,   getAdditionalModulesParameter,   getDebug,   getDebugParameter,   getDefinitionsDelimiter,   getDefinitionsParameter,   getDestFileParameter,   getExecutable,   getExtraOptions,   getExtraOptionsParameter,   getExtraOptionsParameters,   getFailOnError,   getFileExtension,   getFilePattern,   getIncludeDefaultReferences,   getIncludeDefaultReferencesParameter,   getMainClass,   getMainClassParameter,   getOptimize,   getOptimizeParameter,   getReferenceDelimiter,   getReferenceFilesParameter,   getReferencesParameter,   getTargetType,   getTargetTypeParameter,   getUtf8OutputParameter,   getWarnLevel,   getWarnLevelParameter,   getWin32IconParameter,   getWin32Res,   getWin32ResParameter,   isFileManagedBinary,   isUseResponseFile,   notEmpty,   setAdditionalModules,   setDebug,   setDestDir,   setExecutable,   setExtraOptions,   setFailOnError,   setIncludeDefaultReferences,   setMainClass,   setOptimize,   setReferenceFiles,   setReferences,   setTargetType,   setTargetType,   setUseResponseFile,   setUtf8Output,   setWarnLevel,   setWin32Icon,   setWin32Res,   validate
Methods from org.apache.tools.ant.taskdefs.optional.dotnet.DotnetBaseMatchingTask:
addFilesAndExecute,   addFilesToCommand,   addSrc,   buildFileList,   getDestFile,   getOutputFileTimestamp,   getSrcDir,   setDestFile,   setSrcDir
Methods from org.apache.tools.ant.taskdefs.MatchingTask:
XsetIgnore,   XsetItems,   add,   addAnd,   addContains,   addContainsRegexp,   addCustom,   addDate,   addDepend,   addDepth,   addDifferent,   addFilename,   addMajority,   addModified,   addNone,   addNot,   addOr,   addPresent,   addSelector,   addSize,   addType,   appendSelector,   createExclude,   createExcludesFile,   createInclude,   createIncludesFile,   createPatternSet,   getDirectoryScanner,   getImplicitFileSet,   getSelectors,   hasSelectors,   selectorCount,   selectorElements,   setCaseSensitive,   setDefaultexcludes,   setExcludes,   setExcludesfile,   setFollowSymlinks,   setIncludes,   setIncludesfile,   setProject
Methods from org.apache.tools.ant.Task:
bindToOwner,   execute,   getOwningTarget,   getRuntimeConfigurableWrapper,   getTaskName,   getTaskType,   getWrapper,   handleErrorFlush,   handleErrorOutput,   handleFlush,   handleInput,   handleOutput,   init,   isInvalid,   log,   log,   log,   log,   markInvalid,   maybeConfigure,   perform,   reconfigure,   setOwningTarget,   setRuntimeConfigurableWrapper,   setTaskName,   setTaskType
Methods from org.apache.tools.ant.ProjectComponent:
clone,   getDescription,   getLocation,   getProject,   log,   log,   setDescription,   setLocation,   setProject
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.tools.ant.taskdefs.optional.dotnet.DotnetCompile Detail:
 abstract protected  void addCompilerSpecificOptions(NetCommand command)
    add any compiler specifics
 public  void addDefine(DotnetDefine define) 
    add a define to the list of definitions
 public  void addReference(FileSet reference) 
    add a new reference fileset to the compilation
 protected int addReferenceFilesets(NetCommand command,
    long outputTimestamp) 
    run through the list of reference files and add them to the command
 public  void addResource(DotnetResource resource) 
    link or embed a resource
 protected  void addResources(NetCommand command) 
    for every resource declared, we get the (language specific) resource setting
 public  void clear() 
    reset all contents.
 protected NetCommand createNetCommand() 
    create our helper command
 abstract protected  void createResourceParameter(NetCommand command,
    DotnetResource resource)
    Build a C# style parameter.
 public  void execute() throws BuildException 
    do the work by building the command line and then calling it
 protected  void fillInSharedParameters(NetCommand command) 
    fill in the common information
 protected String getAdditionalModulesParameter() 
    get the argument or null for no argument needed
 public boolean getDebug() 
    query the debug flag
 protected String getDebugParameter() 
    get the debug switch argument
 public String getDefinitionsDelimiter() 
    override point for delimiting definitions.
 protected String getDefinitionsParameter() throws BuildException 
    get a list of definitions or null
 protected String getDestFileParameter() 
    get the argument or null for no argument needed
 protected String getExecutable() 
    This method gets the name of the executable.
 public String getExtraOptions() 
    Gets the ExtraOptions attribute
 protected String getExtraOptionsParameter() 
    get any extra options or null for no argument needed
 protected String[] getExtraOptionsParameters() 
    get any extra options or null for no argument needed, split them if they represent multiple options.
 public boolean getFailOnError() 
    query fail on error flag
 abstract public String getFileExtension()
    Get the extension of filenames to compile.
 public String getFilePattern() 
    Get the pattern for files to compile.
 public boolean getIncludeDefaultReferences() 
    query automatic reference inclusion flag
 protected String getIncludeDefaultReferencesParameter() 
    get the include default references flag or null for no argument needed
 public String getMainClass() 
    Gets the MainClass attribute
 protected String getMainClassParameter() 
    get the /main argument or null for no argument needed
 public boolean getOptimize() 
    query the optimise flag
 protected String getOptimizeParameter() 
    get the optimise flag or null for no argument needed
 abstract public String getReferenceDelimiter()
    Get the delimiter that the compiler uses between references. For example, c# will return ";"; VB.NET will return ","
 protected String getReferenceFilesParameter() 
    turn the path list into a list of files and a /references argument
 protected String getReferencesParameter() 
    get the reference string or null for no argument needed
 public String getTargetType() 
    Gets the TargetType attribute
 protected String getTargetTypeParameter() 
    get the argument or null for no argument needed
 protected String getUtf8OutputParameter() 
    Gets the utf8OutpuParameter attribute of the CSharp object
 public int getWarnLevel() 
    query warn level
 protected String getWarnLevelParameter() 
    get the warn level switch
 protected String getWin32IconParameter() 
    get the argument or null for no argument needed
 public File getWin32Res() 
    Gets the file of the win32 .res file to include.
 protected String getWin32ResParameter() 
    get the argument or null for no argument needed
 protected static boolean isFileManagedBinary(File file) 
    test for a file being managed or not
 public boolean isUseResponseFile() 
    getter for flag
 protected boolean notEmpty(String s) 
    test for a string containing something useful
 public  void setAdditionalModules(String params) 
    Semicolon separated list of modules to refer to.
 public  void setDebug(boolean f) 
    set the debug flag on or off.
 public  void setDestDir(File dirName) 
    Set the destination directory of files to be compiled.
 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
 public  void setExtraOptions(String extraOptions) 
    Any extra options which are not explicitly supported by this task.
 public  void setFailOnError(boolean b) 
    If true, fail on compilation errors.
 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
 public  void setMainClass(String mainClass) 
    Sets the name of main class for executables.
 public  void setOptimize(boolean f) 
    If true, enables optimization flag.
 public  void setReferenceFiles(Path path) 
    Path of references to include. Wildcards should work.
 public  void setReferences(String s) 
    Semicolon separated list of DLLs to refer to.
 public  void setTargetType(DotnetCompile.TargetTypes targetType) 
    set the target type to one of exe|library|module|winexe
 public  void setTargetType(String ttype) throws BuildException 
    Set the type of target.
 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
 public  void setUtf8Output(boolean enabled) 
    If true, require all compiler output to be in UTF8 format.
 public  void setWarnLevel(int warnLevel) 
    Level of warning currently between 1 and 4 with 4 being the strictest.
 public  void setWin32Icon(File fileName) 
    Set the filename of icon to include.
 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.
 protected  void validate() throws BuildException 
    validation code