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 from within Ant.
Ant 1.6.2 is required.
If you are building this from sources, run the antlib target
and you'll get a file dotnet.jar
. If you've
downloaded dotnet.jar
, you are already ready.
There are several ways to use the tasks:
<taskdef resource="org/apache/tools/ant/taskdefs/optional/dotnet/antlib.xml"> <classpath> <pathelement location="YOUR-PATH-TO/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.tools.ant.taskdefs.optional.dotnet" resource="org/apache/tools/ant/taskdefs/optional/dotnet/antlib.xml"> <classpath> <pathelement location="YOUR-PATH-TO/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.tools.ant.taskdefs.optional.dotnet" xmlns="antlib:org.apache.tools.ant"> ... <dn:nant> <dn:target name="my-target"/> </dn:nant>or
<nant xmlns="antlib:org.apache.tools.ant.taskdefs.optional.dotnet"> <target name="my-target"/> </nant>or a variation thereof.
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.tools.ant.taskdefs.optional.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-2004 The Apache Software Foundation. All rights Reserved.