Repository: ant-antlibs-dotnet Updated Branches: refs/heads/master bcb2e5b9b -> 0e38fd157
add executable attribute to <nunit>. Fixes Bugzilla Issue 51023. Project: http://git-wip-us.apache.org/repos/asf/ant-antlibs-dotnet/repo Commit: http://git-wip-us.apache.org/repos/asf/ant-antlibs-dotnet/commit/0e38fd15 Tree: http://git-wip-us.apache.org/repos/asf/ant-antlibs-dotnet/tree/0e38fd15 Diff: http://git-wip-us.apache.org/repos/asf/ant-antlibs-dotnet/diff/0e38fd15 Branch: refs/heads/master Commit: 0e38fd1576803303c388a9eff9f92890c82e5f88 Parents: bcb2e5b Author: Stefan Bodewig <[email protected]> Authored: Sun Nov 16 10:37:23 2014 +0100 Committer: Stefan Bodewig <[email protected]> Committed: Sun Nov 16 10:37:23 2014 +0100 ---------------------------------------------------------------------- changes.xml | 4 ++++ docs/nunit.html | 5 +++++ src/main/org/apache/ant/dotnet/NUnitTask.java | 25 ++++++++++++++++++++-- 3 files changed, 32 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ant-antlibs-dotnet/blob/0e38fd15/changes.xml ---------------------------------------------------------------------- diff --git a/changes.xml b/changes.xml index 7a18012..ca881e3 100644 --- a/changes.xml +++ b/changes.xml @@ -43,6 +43,10 @@ on non-Windows systems. The executable attribute of the task can still be used to select the compiler explicitly. </action> + <action type="add" issue="51023"> + The <nunit> task has a new executable attribute that can + be used to override the name of the NUnit executable. + </action> </release> <release version="1.1" date="2011-02-04"> http://git-wip-us.apache.org/repos/asf/ant-antlibs-dotnet/blob/0e38fd15/docs/nunit.html ---------------------------------------------------------------------- diff --git a/docs/nunit.html b/docs/nunit.html index 04ce7c2..2e17952 100644 --- a/docs/nunit.html +++ b/docs/nunit.html @@ -46,6 +46,11 @@ <td align="center">No.</td> </tr> <tr> + <td valign="top">executable</td> + <td valign="top">NUnit executable to use. <em>since 1.2</em></td> + <td align="center">No. Defaults to <code>nunit-console.exe</code></td> + </tr> + <tr> <td valign="top">config</td> <td valign="top">Config file to use</td> <td align="center">No.</td> http://git-wip-us.apache.org/repos/asf/ant-antlibs-dotnet/blob/0e38fd15/src/main/org/apache/ant/dotnet/NUnitTask.java ---------------------------------------------------------------------- diff --git a/src/main/org/apache/ant/dotnet/NUnitTask.java b/src/main/org/apache/ant/dotnet/NUnitTask.java index 672bcc7..43a2a7f 100644 --- a/src/main/org/apache/ant/dotnet/NUnitTask.java +++ b/src/main/org/apache/ant/dotnet/NUnitTask.java @@ -118,12 +118,18 @@ public class NUnitTask extends Task { private String errorProperty; /** + * executable + */ + private String executable; + + /** * Support for nested environment variables. */ private Environment env = new Environment(); public NUnitTask() { super(); + executable = "nunit-console.exe"; } /** @@ -215,6 +221,21 @@ public class NUnitTask extends Task { } /** + * set the name of the program, overriding the defaults. + * + * <p>Can be used to set the full path to a program, or to switch + * to an alternate implementation of the command - e.g. using + * "nunit-console-x86.exe" to run the 32bit version on a 64bit + * system.</p> + * + * @param executable + * @since .NET Antlib 1.2 + */ + public void setExecutable(String executable) { + this.executable = executable; + } + + /** * Adds a test assembly by name. */ public void addTestAssembly(NamedElement a) { @@ -266,7 +287,7 @@ public class NUnitTask extends Task { } DotNetExecTask exec = DotNetExecTask.getTask(this, vm, - "nunit-console.exe", + executable, env); Iterator iter = testAssemblies.iterator(); while (iter.hasNext()) { @@ -332,4 +353,4 @@ public class NUnitTask extends Task { public void setName(String s) {name = s;} public String toString() {return getName();} } -} \ No newline at end of file +}
