Return-Path:
This one could as well be implemented as
+ *
+ *
+ * <macrodef name=3D"assertTrue">
+ * <attribute name=3D"message" default=3D"Assertion failed"/>
+ * <element name=3D"assertion" implicit=3D"true"/>
+ * <sequential>
+ * <fail message=3D"@{message}">
+ * <condition>
+ * <assertion/>
+ * </condition>
+ * </fail>
+ * </sequential>
+ * </macrodef>
+ *
+ *=20
+ * but wouldn't be able to throw a specialized exception that way -
+ * and the macrodef would nest the exception in yet another
+ * BuildException.
Executes a .NET assembly that's on your PATH or pointed to + directly by the executable attribute.
+ +This task is an extension of Ant's exec + task and supports all attributes and nested child elements of that + task. Use the executable attribute to specify the name of the + assembly (including the extension).
+ +This task allows you to choose the .NET framework via the
+ vm
attribute. The default value is "microsoft" on
+ Windows and "mono" on all other platforms. "microsoft" is a magic
+ name that means "run the assembly as executable directly" - this
+ may also work for Mono on Linux systems with the binfmt feature
+ described in the Mono FAQ.
Copyright © 2003-2004 The Apache Software F= oundation. All rights Reserved.
+ + \ No newline at end of file Propchange: ant/sandbox/antlibs/dotnet/branches/Ant_1.6.2_compatible/docs/d= otnetexec.html ---------------------------------------------------------------------------= --- svn:eol-style =3D native Added: ant/sandbox/antlibs/dotnet/branches/Ant_1.6.2_compatible/docs/index.= html URL: http://svn.apache.org/viewcvs/ant/sandbox/antlibs/dotnet/branches/Ant_= 1=2E6.2_compatible/docs/index.html?view=3Dauto&rev=3D161469 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- ant/sandbox/antlibs/dotnet/branches/Ant_1.6.2_compatible/docs/index.htm= l (added) +++ ant/sandbox/antlibs/dotnet/branches/Ant_1.6.2_compatible/docs/index.htm= l Fri Apr 15 07:32:50 2005 @@ -0,0 +1,142 @@ + + + +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.
+ +The current version requires Ant 1.6.2 or later and may even + work better for a CVS build of Ant created from CVS HEAD.
+ +The source code for the library currently lives in the + developer sandbox in Ant's CVS - http://cvs.apache.org/viewcvs.cgi/ant/proposal/sandbox/dotnet/. + A binary can be found at http://cvs.a= pache.org/~bodewig/dotnet/dotnet.jar. + A zip file containing the docs is also available.=
+ +Note that these are temporary locations and may change later.
+ +Right now direct any feedback either directly to me or the Ant + developer list. + +
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=20 + resource=3D"org/apache/tools/ant/taskdefs/optional/dotnet/antl= ib.xml"> + <classpath> + <pathelement location=3D"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=20 + uri=3D"antlib:org.apache.tools.ant.taskdefs.optional.dotnet" + resource=3D"org/apache/tools/ant/taskdefs/optional/dotnet/antl= ib.xml"> + <classpath> + <pathelement location=3D"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=3D"antlib:org.apache.tools.ant.taskdefs.optional.dotn= et" + xmlns=3D"antlib:org.apache.tools.ant"> + ... + <dn:nant> + <dn:target name=3D"my-target"/> + </dn:nant> ++ + or + +
+ <nant xmlns=3D"antlib:org.apache.tools.ant.taskdefs.optional.= dotnet"> + <target name=3D"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=3D"antlib:org.apache.tools.ant.taskdefs.optional.dotn= et" + xmlns=3D"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 F= oundation. All rights Reserved.
+ + Propchange: ant/sandbox/antlibs/dotnet/branches/Ant_1.6.2_compatible/docs/i= ndex.html ---------------------------------------------------------------------------= --- svn:eol-style =3D native Added: ant/sandbox/antlibs/dotnet/branches/Ant_1.6.2_compatible/docs/msbuil= d=2Ehtml URL: http://svn.apache.org/viewcvs/ant/sandbox/antlibs/dotnet/branches/Ant_= 1=2E6.2_compatible/docs/msbuild.html?view=3Dauto&rev=3D161469 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- ant/sandbox/antlibs/dotnet/branches/Ant_1.6.2_compatible/docs/msbuild.h= tml (added) +++ ant/sandbox/antlibs/dotnet/branches/Ant_1.6.2_compatible/docs/msbuild.h= tml Fri Apr 15 07:32:50 2005 @@ -0,0 +1,109 @@ + + + +Runs the MSBuild build tool presented at the 2003 PDC. This + task is completely untested as the developers have no access to + the tool, it has been implemented by looking at the docs only.
+ +You can either use an existing build file or nest a build file + (snippet) as a child into the task. If you don't specify either, + MSBuild's default build file search algorithm will apply.
+ +Attribute | +Description | +Required | +
buildfile | +External build file to invoke MSBuild on. | +No. | +
vm | +Same as dotnetexec's vm attribute. + Specify the framework to use. | +No. | +
target
has a single required attribute name -
+ specifies a target to be run.
property
has two required attributes. name and
+ value that specify name and value of a property that is to be
+ defined in the MSBuild invocation.
This element allows no attributes. You can nest a MSBuild build
+ file into it and MSBuild will be executed on that. You can also nest
+ a build file snippet instead and Ant will wrap the necessary MSBuild
+ <Project> around it.
Let MSBuild search for a *.proj file in the (Ant) project's base + directory and execute the default target in it:
+ +<msbuild/>+ =20 +
Let MSBuild execute the targets named foo and bar in the build
+ file msbuild.proj in Ant's basedir and pass the property
+ /property:test=3Dtestvalue
to it:
+ <msbuild buildfile=3D"msbuild.proj"> + <target name=3D"foo"/> + <target name=3D"bar"/> + <property name=3D"test" value=3D"testvalue"/> + </msbuild> ++ +
Define a build file embeded into the task, let MSBuild execute the + echo target of that build file.
+ ++ <msbuild> + <target name=3D"echo"> + <build> + <Project DefaultTargets=3D"empty"> + <Target Name=3D"empty"/> + <Target Name=3D"echo"> + <Task Name=3D"Echo" Message=3D"This is MSBuild"/> + </Target> + </Project> + </build> + </msbuild> ++ +
Run MSBuild's Echo task (if there actually is one):
+ ++ <msbuild> + <build> + <Task Name=3D"Echo" Message=3D"This is MSBuild"/> + </build> + </msbuild> ++ +
Copyright © 2003-2004 The Apache Software F= oundation. All rights Reserved.
+ + \ No newline at end of file Propchange: ant/sandbox/antlibs/dotnet/branches/Ant_1.6.2_compatible/docs/m= sbuild.html ---------------------------------------------------------------------------= --- svn:eol-style =3D native Added: ant/sandbox/antlibs/dotnet/branches/Ant_1.6.2_compatible/docs/nant.h= tml URL: http://svn.apache.org/viewcvs/ant/sandbox/antlibs/dotnet/branches/Ant_= 1=2E6.2_compatible/docs/nant.html?view=3Dauto&rev=3D161469 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- ant/sandbox/antlibs/dotnet/branches/Ant_1.6.2_compatible/docs/nant.html= (added) +++ ant/sandbox/antlibs/dotnet/branches/Ant_1.6.2_compatible/docs/nant.html= Fri Apr 15 07:32:50 2005 @@ -0,0 +1,108 @@ + + + +Runs the NAnt build + tool.
+ +You can either use an existing build file or nest a build file + (snippet) as a child into the task. If you don't specify either, + NAnt's default build file search algorithm will apply.
+ +Attribute | +Description | +Required | +
buildfile | +External build file to invoke NAnt on. | +No. | +
vm | +Same as dotnetexec's vm attribute. + Specify the framework to use. | +No. | +
target
has a single required attribute name -
+ specifies a target to be run.
property
has two required attributes. name and
+ value that specify name and value of a property that is to be
+ defined in the NAnt invocation.
This element allows no attributes. You can nest a NAnt build
+ file into it and NAnt will be executed on that. You can also nest
+ a build file snippet instead and Ant will wrap the necessary NAnt
+ <project> around it.
Let NAnt search for a *.build file in the (Ant) project's base + directory and execute the default target in it:
+ +<nant/>+ =20 +
Let NAnt execute the targets named foo and bar in the build
+ file nant.build in Ant's basedir and pass the property
+ -D:test=3Dtestvalue
to it:
+ <nant buildfile=3D"nant.build"> + <target name=3D"foo"/> + <target name=3D"bar"/> + <property name=3D"test" value=3D"testvalue"/> + </nant> ++ +
Define a build file embeded into the task, let NAnt execute the + echo target of that build file.
+ ++ <nant> + <target name=3D"echo"> + <build> + <project basedir=3D"." default=3D"empty"> + <target name=3D"empty"/> + <target name=3D"echo"> + <echo message=3D"this is NAnt"/> + </target> + </project> + </build> + </nant> ++ +
Run NAnt's echo task:
+ ++ <nant> + <build> + <echo message=3D"this is NAnt"/> + </build> + </nant> ++ +
Copyright © 2003-2004 The Apache Software F= oundation. All rights Reserved.
+ + \ No newline at end of file Propchange: ant/sandbox/antlibs/dotnet/branches/Ant_1.6.2_compatible/docs/n= ant.html ---------------------------------------------------------------------------= --- svn:eol-style =3D native Added: ant/sandbox/antlibs/dotnet/branches/Ant_1.6.2_compatible/docs/nunit.= html URL: http://svn.apache.org/viewcvs/ant/sandbox/antlibs/dotnet/branches/Ant_= 1=2E6.2_compatible/docs/nunit.html?view=3Dauto&rev=3D161469 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- ant/sandbox/antlibs/dotnet/branches/Ant_1.6.2_compatible/docs/nunit.htm= l (added) +++ ant/sandbox/antlibs/dotnet/branches/Ant_1.6.2_compatible/docs/nunit.htm= l Fri Apr 15 07:32:50 2005 @@ -0,0 +1,177 @@ + + + +Runs the NUnit console + test runner.
+ +Attribute | +Description | +Required | +
vm | +Same as dotnetexec's vm attribute. + Specify the framework to use. | +No. | +
config | +Config file to use | +No. | +
output | +Where test output should go. | +No. | +
error | +Where test error output should go. | +No. | +
xmlout | +Where NUnit's XML output should go. | +No. | +
transform | +The transformation to apply. | +No. | +
thread | +Causes a separate thread to be created for + running the tests - see the NUnit documentation for + details. | +No - defaults to false. | +
noshadow | +Disables shadow copying of the assembly in + order to provide improved performance.. | +No - defaults to false. | +
fixture | +Test fixture to run. | +No. | +
labels | +Causes an identifying label to be displayed + at the start of each test case. | +No - defaults to false. | +
failOnError | +Stops the build if NUnit returns with a code + indicating an error or failure. | +No - defaults to false. | +
testassembly
has a single required attribute name -
+ specifies an assembly or a project file holding tests.
in/exclude
have a single required attribute name -
+ specifies a category to include or exclude from the tests.
Note that in current versions of NUnit (up to 2.2) you + may choose to either include or exclude categories in a run, but + not both. This task does not enforce this restriction + since future versions of NUnit may change behavior.
+ +A nested I/O
+ Redirector can be specified. Any file mapping is done using a
+ null
sourcefile; therefore not all Mapper
+ types will return results.
It is possible to specify environment variables to
+ pass to the system command via nested <env>
+ elements. They support the same attributes as the nested en=
v
+ element of the <exec>
task.
+ <nunit> + <testassembly name=3D"nunit.tests.dll"/> + </nunit> ++ =20 +
or
+ ++ <nunit> + <testassembly name=3D"nunit.tests.csproj"/> + </nunit> ++ =20 +
+ <nunit fixture=3D"NUnit.Tests.AssertionTests"> + <testassembly name=3D"nunit.tests.dll"/> + </nunit> ++ +
+ <nunit> + <testassembly name=3D"nunit.tests.dll"/> + <include name=3D"Baseline"/> + </nunit> ++ +
+ <nunit xmlout=3D"console-test.xml"> + <testassembly name=3D"nunit.tests.dll"/> + </nunit> ++ +
changes the name of the output file to "console-test.xml" - + note that this task will resolve file names relative to the + project's base directory, not the current working directory.
+ ++ <nunit> + <testassembly name=3D"assembly1.dll"/> + <testassembly name=3D"assembly2.dll"/> + <testassembly name=3D"assembly3.dll"/> + </nunit> ++ +
Copyright © 2004 The Apache Software Founda= tion. All rights Reserved.
+ + \ No newline at end of file Propchange: ant/sandbox/antlibs/dotnet/branches/Ant_1.6.2_compatible/docs/n= unit.html ---------------------------------------------------------------------------= --- svn:eol-style =3D native Added: ant/sandbox/antlibs/dotnet/branches/Ant_1.6.2_compatible/docs/wix.ht= ml URL: http://svn.apache.org/viewcvs/ant/sandbox/antlibs/dotnet/branches/Ant_= 1=2E6.2_compatible/docs/wix.html?view=3Dauto&rev=3D161469 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- ant/sandbox/antlibs/dotnet/branches/Ant_1.6.2_compatible/docs/wix.html = (added) +++ ant/sandbox/antlibs/dotnet/branches/Ant_1.6.2_compatible/docs/wix.html = Fri Apr 15 07:32:50 2005 @@ -0,0 +1,177 @@ + + + +Runs the candle, light or both from the Wix toolset.
+ +Attribute | +Description | +Required | +
source | +The single source file to process. | +Either this or at least one nested + <sources> set. | +
target | +The expected target file. | +Yes, unless you run candle without light. | +
mode | +Which part of the toolset to run, one of + "candle", "light" or + "both". | +No, default is "both". | +
vm | +Same as dotnetexec's vm attribute. + Specify the framework to use. | +No. | +
Specify source files that shall be passed on the command line. + This is a fileset= a>.
+ +Specify source files that shall not be passed on the command + line. This is a fileset= a>.
+ +Typically this would list include files when running candle or + the files that vecome part of the MSI file when running light. + The files in this set are only used for timestamp comparisons. If + neither these files nor the given "normal" sources are + newer than the expected target, the task won't do anything.
+ + +Create product.wixobj
from product.wxs
:=
p>
+
+
+ <wix mode=3D"candle" source=3D"product.wxs"/> ++ +
The same but using a nested sources element:
+ ++ <wix mode=3D"candle"> + <sources dir=3D"."> + <include name=3D"product.wxs"/> + </sources> + </wix> ++ +
Create product.msi
from product.wixobj
:=
p>
+
+
+ <wix mode=3D"light" source=3D"product.wixobj" target=3D"product.m= si"/> ++ +
Combine the examples into a single step:
+ ++ <wix source=3D"product.wxs" target=3D"product.msi"/> ++ +
Note that the task wouldn't do anything if
+ product.wxs
was older than
+ product.wixobj
and product.wixobj
was
+ older than product.msi
.
Compile multiple .wxs
files at once:
+ <wix mode=3D"candle"> + <sources dir=3D"."> + <include name=3D"*.wxs"/> + </sources> + </wix> ++ +
Compile multiple .wxs
files at once, specify some
+ include files in addition to that:
+ <wix mode=3D"candle"> + <sources dir=3D"."> + <include name=3D"*.wxs"/> + </sources> + <moresources dir=3D"."> + <include name=3D"*.wxi"/> + </moresources> + </wix> ++ +
Link multiple .wixobj
files at once:
+ <wix mode=3D"light" target=3D"product.msi"> + <sources dir=3D"."> + <include name=3D"*.wixobj"/> + </sources> + </wix> ++ +
Link multiple .wixobj
files at once and specify
+ that the files in directory "source" will become part of
+ the package:
+ <wix mode=3D"light" target=3D"product.msi"> + <sources dir=3D"."> + <include name=3D"*.wixobj"/> + </sources> + <moresources dir=3D"source"/> + </wix> ++ +
Combine multiple .wxs
files and include files
+ into a single package and specify that the package will contain
+ files from the source directory:
+
+ + <wix target=3D"product.msi"> + <sources dir=3D"."> + <include name=3D"*.wxs"/> + </sources> + <moresources dir=3D"."> + <include name=3D"*.wxi"/> + </moresources> + <moresources dir=3D"source"/> + </wix> ++ +
Again, if the intermediate .wixobj
files are newer
+ that the corresponding .wxs
files (and all include
+ files) the candle step will be skipped. If
+ product.msi
is newer than all files, the task won't
+ do anything.
Copyright © 2004 The Apache Software Founda= tion. All rights Reserved.
+ + \ No newline at end of file Propchange: ant/sandbox/antlibs/dotnet/branches/Ant_1.6.2_compatible/docs/w= ix.html ---------------------------------------------------------------------------= --- svn:eol-style =3D native Added: ant/sandbox/antlibs/dotnet/branches/Ant_1.6.2_compatible/src/etc/tes= tcases/dotnetexec.xml URL: http://svn.apache.org/viewcvs/ant/sandbox/antlibs/dotnet/branches/Ant_= 1=2E6.2_compatible/src/etc/testcases/dotnetexec.xml?view=3Dauto&rev=3D161469 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- ant/sandbox/antlibs/dotnet/branches/Ant_1.6.2_compatible/src/etc/testca= ses/dotnetexec.xml (added) +++ ant/sandbox/antlibs/dotnet/branches/Ant_1.6.2_compatible/src/etc/testca= ses/dotnetexec.xml Fri Apr 15 07:32:50 2005 @@ -0,0 +1,89 @@ + + + +