This is a library of Ant tasks that support using .NET executables accross different platforms and in particular support using common .NET development tools like NAnt or NUnit from within Ant.
This version requires Ant 1.6.2 or later. If you are running Ant 1.7 or later you may want to use the latest version of this library instead.
The source code for the library lives in Ant's SVN - http://svn.apache.org/repos/asf/ant/antlibs/dotnet/branches/Ant_1.6.2_compatible/ A binary can be found at http://people.apache.org/~bodewig/dotnet/1.6_compatible/ant-dotnet.jar. A zip file containing the docs is also available.
Note that these are temporary locations and may change later.
Please direct any feedback to the Ant developer list.
If you are building this from sources, run the antlib target
and you'll get a file ant-dotnet.jar
. If you've
downloaded dotnet.jar
, you are already ready.
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
.
Copyright © 2003-2005 The Apache Software Foundation. All rights Reserved.