org.apache.tools.ant.taskdefs.optional.dotnet

Class ImportTypelib

public class ImportTypelib extends Task

Import a COM type library into the .NET framework.

This task is a wrapper to .NET's tlbimport; it imports a tlb file to a NET assembly by generating a binary assembly (.dll) that contains all the binding metadata. It uses date timestamps to minimise rebuilds.

Example

     <importtypelib
       srcfile="xerces.tlb"
       destfile="xerces.dll"
       namespace="Apache.Xerces"/>
 

Since: Ant 1.6

UNKNOWN: category="dotnet"

Method Summary
voidexecute()
Create a typelib command
voidsetDestFile(File destFile)
This method names the output file.
voidsetExtraOptions(String extraOptions)
set any extra options that are not yet supported by this task.
voidsetNamespace(String namespace)
This method sets what namespace the typelib is to be in.
voidsetSrcFile(File srcFile)
This method sets which is the source .tlb file.
voidsetUnsafe(boolean unsafe)
do you want unsafe code.
voidsetUseSysArray(boolean useSysArray)
set this to map a COM SafeArray to the System.Array class
protected voidvalidate()
validation code

Method Detail

execute

public void execute()
Create a typelib command

Throws: BuildException if something goes wrong with the build

setDestFile

public void setDestFile(File destFile)
This method names the output file. This is an operation which is required to have been performed.

Parameters: destFile the output file.

setExtraOptions

public void setExtraOptions(String extraOptions)
set any extra options that are not yet supported by this task.

Parameters: extraOptions the options to use.

setNamespace

public void setNamespace(String namespace)
This method sets what namespace the typelib is to be in. This is an operation which is required to have been performed.

Parameters: namespace the namespace to use.

setSrcFile

public void setSrcFile(File srcFile)
This method sets which is the source .tlb file. This is an operation which is required to have been performed.

Parameters: srcFile the source file.

setUnsafe

public void setUnsafe(boolean unsafe)
do you want unsafe code.

Parameters: unsafe a boolean value.

setUseSysArray

public void setUseSysArray(boolean useSysArray)
set this to map a COM SafeArray to the System.Array class

Parameters: useSysArray a boolean value.

validate

protected void validate()
validation code

Throws: BuildException if validation failed