git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@275682 13f79535-47bb-0310-9956-ffa450edef68master
@@ -289,6 +289,9 @@ automatic use of response files. Bugzilla report #19630 | |||||
Other changes: | Other changes: | ||||
-------------- | -------------- | ||||
* Shipped XML parser is now Xerces 2.6.0 | |||||
* All tasks can be used outside of <target>s. Note that some tasks | * All tasks can be used outside of <target>s. Note that some tasks | ||||
will not work at all outside of targets as they would cause infinite | will not work at all outside of targets as they would cause infinite | ||||
loops (<antcall> as well as <ant> and <subant> if they invoke the | loops (<antcall> as well as <ant> and <subant> if they invoke the | ||||
@@ -46,7 +46,7 @@ | |||||
</td></tr> | </td></tr> | ||||
<tr><td><blockquote> | <tr><td><blockquote> | ||||
Compiles C# source into executables or modules. csc.exe must be on the execute path, unless another executable or the full path to that executable is specified in the <tt>executable</tt> parameter <p> All parameters are optional: <csc/> should suffice to produce a debug build of all *.cs files. However, naming an <tt>destFile</tt>stops the csc compiler from choosing an output name from random, and allows the dependency checker to determine if the file is out of date. <p> The task is a directory based task, so attributes like <b>includes="*.cs" </b> and <b>excludes="broken.cs"</b> can be used to control the files pulled in. By default, all *.cs files from the project folder down are included in the command. When this happens the output file -if not specified- is taken as the first file in the list, which may be somewhat hard to control. Specifying the output file with <tt>destFile</tt> seems prudent. <p> <p> For more complex source trees, nested <tt>src</tt> elemements can be supplied. When such an element is present, the implicit fileset is ignored. This makes sense, when you think about it :) <p> References to external files can be made through the references attribute, or (since Ant1.6), via nested <reference> filesets. With the latter, the timestamps of the references are also used in the dependency checking algorithm. <p> Example <pre><csc optimize="true" debug="false" docFile="documentation.xml" warnLevel="4" unsafe="false" targetType="exe" incremental="false" mainClass = "MainApp" destFile="NetApp.exe" > <src dir="src" includes="*.cs" /> <reference file="${testCSC.dll}" /> <define name="RELEASE" /> <define name="DEBUG" if="debug.property"/> <define name="def3" unless="def3.property"/> </csc> </pre> | |||||
Compiles C# source into executables or modules. csc.exe on Windows or mcs on any other platform must be on the execute path, unless another executable or the full path to that executable is specified in the <tt>executable</tt> parameter <p> All parameters are optional: <csc/> should suffice to produce a debug build of all *.cs files. However, naming an <tt>destFile</tt>stops the csc compiler from choosing an output name from random, and allows the dependency checker to determine if the file is out of date. <p> The task is a directory based task, so attributes like <b>includes="*.cs" </b> and <b>excludes="broken.cs"</b> can be used to control the files pulled in. By default, all *.cs files from the project folder down are included in the command. When this happens the output file -if not specified- is taken as the first file in the list, which may be somewhat hard to control. Specifying the output file with <tt>destFile</tt> seems prudent. <p> <p> For more complex source trees, nested <tt>src</tt> elemements can be supplied. When such an element is present, the implicit fileset is ignored. This makes sense, when you think about it :) <p> References to external files can be made through the references attribute, or (since Ant1.6), via nested <reference> filesets. With the latter, the timestamps of the references are also used in the dependency checking algorithm. <p> Example <pre><csc optimize="true" debug="false" docFile="documentation.xml" warnLevel="4" unsafe="false" targetType="exe" incremental="false" mainClass = "MainApp" destFile="NetApp.exe" > <src dir="src" includes="*.cs" /> <reference file="${testCSC.dll}" /> <define name="RELEASE" /> <define name="DEBUG" if="debug.property"/> <define name="def3" unless="def3.property"/> </csc> </pre> | |||||
</blockquote></td></tr> | </blockquote></td></tr> | ||||
</table> | </table> | ||||
@@ -156,7 +156,6 @@ | |||||
<csc | <csc | ||||
destFile="${testCSC.exe}" | destFile="${testCSC.exe}" | ||||
targetType="exe" | targetType="exe" | ||||
executable="mcs" | |||||
includedefaultreferences="true" | includedefaultreferences="true" | ||||
> | > | ||||
</csc> | </csc> | ||||
@@ -193,7 +192,6 @@ | |||||
destFile="${testCSC.exe}" | destFile="${testCSC.exe}" | ||||
targetType="exe" | targetType="exe" | ||||
srcDir="." | srcDir="." | ||||
executable="mcs" | |||||
includedefaultreferences="true" | includedefaultreferences="true" | ||||
> | > | ||||
</csc> | </csc> | ||||
@@ -227,7 +225,6 @@ | |||||
<csc | <csc | ||||
destFile="${testCSC.dll}" | destFile="${testCSC.dll}" | ||||
targetType="library" | targetType="library" | ||||
executable="mcs" | |||||
includedefaultreferences="true" | includedefaultreferences="true" | ||||
> | > | ||||
<src dir="${src.dir}" includes="example2.cs"/> | <src dir="${src.dir}" includes="example2.cs"/> | ||||
@@ -265,7 +262,6 @@ | |||||
<csc | <csc | ||||
destFile="${testCscReferences.exe}" | destFile="${testCscReferences.exe}" | ||||
targetType="exe" | targetType="exe" | ||||
executable="mcs" | |||||
includedefaultreferences="true" | includedefaultreferences="true" | ||||
> | > | ||||
<src file="${src.dir}/example.cs"/> | <src file="${src.dir}/example.cs"/> | ||||
@@ -70,12 +70,14 @@ package org.apache.tools.ant.taskdefs.optional.dotnet; | |||||
import java.io.File; | import java.io.File; | ||||
import org.apache.tools.ant.taskdefs.condition.Os; | |||||
// ==================================================================== | // ==================================================================== | ||||
/** | /** | ||||
* Compiles C# source into executables or modules. | * Compiles C# source into executables or modules. | ||||
* | * | ||||
* csc.exe must be on the execute path, unless another executable | |||||
* csc.exe on Windows or mcs on other platforms must be on the execute path, unless another executable | |||||
* or the full path to that executable is specified in the <tt>executable</tt> | * or the full path to that executable is specified in the <tt>executable</tt> | ||||
* parameter | * parameter | ||||
* <p> | * <p> | ||||
@@ -190,7 +192,7 @@ public class CSharp extends DotnetCompile { | |||||
unsafe = false; | unsafe = false; | ||||
noconfig = false; | noconfig = false; | ||||
definitions = null; | definitions = null; | ||||
setExecutable("csc"); | |||||
setExecutable(Os.isFamily("windows") ? "csc" : "mcs"); | |||||
} | } | ||||