The Apache .NET Ant Library™ is a library of Apache Ant™ tasks developed by The Apache Software Foundation that support using .NET executables accross different platforms and in particular support using common .NET development tools like NAnt or NUnit from within Ant.
The original .NET support from Ant's core has also been moved to this library.
The current version requires Ant 1.7.0 or later.
The source code for the library lives in Ant's SVN - http://svn.apache.org/repos/asf/ant/antlibs/dotnet/trunk/, binary and source distributions are available available from the Ant website: source and binary.
Please use Ant's issue tracker for bug reports, choose "Ant" as the product and ".NET Antlib" as the category. The hints about reporting bugs certainly apply to this Ant library as well.
For questions about this Ant library use the user or dev mailing list of the Ant project. You must be subscribed to the list in order to post a question.
If you are building this from sources, run the antlib target
and you'll get a file ant-dotnet.jar
. If you've
downloaded a binary release, you are already there.
There are several ways to use the tasks:
<taskdef resource="org/apache/ant/dotnet/antlib.xml"> <classpath> <pathelement location="YOUR-PATH-TO/ant-dotnet.jar"/> </classpath> </taskdef>With this you can use the tasks like plain Ant tasks, they'll live in the default namespace. I.e. if you can run <exec> without any namespace prefix, you can do so for <dotnetexec> as well.
<taskdef uri="antlib:org.apache.ant.dotnet" resource="org/apache/ant/dotnet/antlib.xml"> <classpath> <pathelement location="YOUR-PATH-TO/ant-dotnet.jar"/> </classpath> </taskdef>This puts you task into a separate namespace than Ant's namespace. You would use the tasks like
<project xmlns:dn="antlib:org.apache.ant.dotnet" xmlns="antlib:org.apache.tools.ant"> ... <dn:nant> <dn:target name="my-target"/> </dn:nant>or
<nant xmlns="antlib:org.apache.ant.dotnet"> <target name="my-target"/> </nant>or a variation thereof.
ant-dotnet.jar
into a directory and use ant -lib
DIR-CONTAINING-THE-JAR
or copy it into
ANT_HOME/lib
- and then in your build file, simply
declare the namespace on the project
tag:
<project xmlns:dn="antlib:org.apache.ant.dotnet" xmlns="antlib:org.apache.tools.ant">And all tasks of this library will automatically be available in the
dn
namespace without any
taskdef
.
Apache Ant, Apache .NET Ant Library, Ant, .NET Ant Library, Apache, the Apache feather logo, and the Apache Ant project logos are trademarks of The Apache Software Foundation.