bodewig 2003/11/25 01:16:57 Modified: . WHATSNEW docs/manual/OptionalTasks csc.html src/etc/testcases/taskdefs/optional dotnet.xml src/main/org/apache/tools/ant/taskdefs/optional/dotnet CSharp.java Log: Make <csc> default to mcs on non-Windows platforms Revision Changes Path 1.512 +3 -0 ant/WHATSNEW Index: WHATSNEW =================================================================== RCS file: /home/cvs/ant/WHATSNEW,v retrieving revision 1.511 retrieving revision 1.512 diff -u -r1.511 -r1.512 --- WHATSNEW 6 Nov 2003 20:39:52 -0000 1.511 +++ WHATSNEW 25 Nov 2003 09:16:56 -0000 1.512 @@ -289,6 +289,9 @@ Other changes: -------------- + +* Shipped XML parser is now Xerces 2.6.0 + * 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 loops (<antcall> as well as <ant> and <subant> if they invoke the 1.2 +1 -1 ant/docs/manual/OptionalTasks/csc.html Index: csc.html =================================================================== RCS file: /home/cvs/ant/docs/manual/OptionalTasks/csc.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- csc.html 24 Sep 2003 00:56:45 -0000 1.1 +++ csc.html 25 Nov 2003 09:16:57 -0000 1.2 @@ -46,7 +46,7 @@ </td></tr> <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> </table> 1.17 +0 -4 ant/src/etc/testcases/taskdefs/optional/dotnet.xml Index: dotnet.xml =================================================================== RCS file: /home/cvs/ant/src/etc/testcases/taskdefs/optional/dotnet.xml,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- dotnet.xml 24 Oct 2003 05:52:55 -0000 1.16 +++ dotnet.xml 25 Nov 2003 09:16:57 -0000 1.17 @@ -156,7 +156,6 @@ <csc destFile="${testCSC.exe}" targetType="exe" - executable="mcs" includedefaultreferences="true" > </csc> @@ -193,7 +192,6 @@ destFile="${testCSC.exe}" targetType="exe" srcDir="." - executable="mcs" includedefaultreferences="true" > </csc> @@ -227,7 +225,6 @@ <csc destFile="${testCSC.dll}" targetType="library" - executable="mcs" includedefaultreferences="true" > <src dir="${src.dir}" includes="example2.cs"/> @@ -265,7 +262,6 @@ <csc destFile="${testCscReferences.exe}" targetType="exe" - executable="mcs" includedefaultreferences="true" > <src file="${src.dir}/example.cs"/> 1.38 +4 -2 ant/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/CSharp.java Index: CSharp.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/CSharp.java,v retrieving revision 1.37 retrieving revision 1.38 diff -u -r1.37 -r1.38 --- CSharp.java 24 Sep 2003 00:58:29 -0000 1.37 +++ CSharp.java 25 Nov 2003 09:16:57 -0000 1.38 @@ -70,12 +70,14 @@ import java.io.File; +import org.apache.tools.ant.taskdefs.condition.Os; + // ==================================================================== /** * 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> * parameter * <p> @@ -190,7 +192,7 @@ unsafe = false; noconfig = false; definitions = null; - setExecutable("csc"); + setExecutable(Os.isFamily("windows") ? "csc" : "mcs"); }
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]