embrace .NET 2.0 on Mono

git-svn-id: https://svn.apache.org/repos/asf/ant/antlibs/dotnet/trunk@984111 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/changes.xml b/changes.xml
index c266e4d..bb4e4c2 100644
--- a/changes.xml
+++ b/changes.xml
@@ -38,6 +38,9 @@
     </properties>
 
     <release version="SVN trunk" date="unpublished">
+      <action type="update" breaks-bwc="true">
+        The C# compiler uses gmcs on Mono by default now.
+      </action>
       <action type="add">
         A new F# compiler task has been added.
       </action>
diff --git a/src/main/org/apache/ant/dotnet/compile/CSharp.java b/src/main/org/apache/ant/dotnet/compile/CSharp.java
index 86d2584..3ab31a9 100644
--- a/src/main/org/apache/ant/dotnet/compile/CSharp.java
+++ b/src/main/org/apache/ant/dotnet/compile/CSharp.java
@@ -40,7 +40,7 @@
 /**
  *  Compiles C# source into executables or modules.
  *
- * csc.exe on Windows or mcs on other platforms must be on the execute
+ * csc.exe on Windows or gmcs 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>
@@ -102,6 +102,8 @@
 
 public class CSharp extends DotnetCompile {
 
+    private static final String MONO_CS_COMPILER = "gmcs";
+
     /**
      *  defines list: RELEASE;WIN32;NO_SANITY_CHECKS;;SOMETHING_ELSE'
      */
@@ -160,7 +162,7 @@
         unsafe = false;
         noconfig = false;
         definitions = null;
-        setExecutable(isWindows ? "csc" : "mcs");
+        setExecutable(isWindows ? "csc" : MONO_CS_COMPILER);
     }
 
 
@@ -203,7 +205,7 @@
      *@return    The OutputFile Parameter to CSC
      */
     protected String getFileAlignParameter() {
-        if (fileAlign != 0 && !"mcs".equals(getExecutable())) {
+        if (fileAlign != 0 && !MONO_CS_COMPILER.equals(getExecutable())) {
             return "/filealign:" + fileAlign;
         } else {
             return null;
diff --git a/src/tests/antunit/old-core-test.xml b/src/tests/antunit/old-core-test.xml
index 9efb9d1..70fdb8e 100644
--- a/src/tests/antunit/old-core-test.xml
+++ b/src/tests/antunit/old-core-test.xml
@@ -64,16 +64,16 @@
    <echo> jsharp.found=${jsharp.found}</echo>
 
    <!-- Mono C# compiler -->
-   <condition property="mcs.found">
-      <available file="mcs"     filepath="${env.PATH}" />
+   <condition property="gmcs.found">
+      <available file="gmcs"     filepath="${env.PATH}" />
     </condition>
-   <echo> mcs.found=${mcs.found}</echo>
+   <echo> gmcs.found=${gmcs.found}</echo>
 
    <!-- any C# compiler -->
    <condition property="c#.found">
       <or>
         <isset property="csc.found"/>
-        <isset property="mcs.found"/>
+        <isset property="gmcs.found"/>
       </or>
    </condition>
 
@@ -95,7 +95,7 @@
    <condition property="dotnetapps.found">
       <or>
         <and>
-          <isset property="mcs.found"/>
+          <isset property="gmcs.found"/>
           <isset property="mono.ilasm.found"/>
         </and>
         <and>
@@ -120,8 +120,8 @@
       <isset property="csc.found"/>
    </condition>
 
-   <condition property="cs.compiler" value="mcs">
-      <isset property="mcs.found"/>
+   <condition property="cs.compiler" value="gmcs">
+      <isset property="gmcs.found"/>
    </condition>
 
     <condition property="ms.net20+">
@@ -169,7 +169,7 @@
     <delete file="${testCSC.exe}"/>
   </target>
 
-  <target name="CSC-Mono" depends="validate_csc" if="mcs.found">
+  <target name="CSC-Mono" depends="validate_csc" if="gmcs.found">
     <property name="testCSC.exe"
       location="${build.dir}/ExampleCsc.exe" />
     <dn:csc
@@ -215,7 +215,7 @@
     <delete file="${testCSCRes.exe}"/>
   </target>
 
-  <target name="CSCResources-Mono" depends="validate_csc" if="mcs.found">
+  <target name="CSCResources-Mono" depends="validate_csc" if="gmcs.found">
     <property name="testCSCRes.exe"
       location="${build.dir}/ExampleCscRes.exe" />
     <dn:csc
@@ -251,7 +251,7 @@
     <delete file="${testCSC.exe}"/>
   </target>
 
-  <target name="CSCintrinsicFileset-Mono" depends="validate_csc" if="mcs.found">
+  <target name="CSCintrinsicFileset-Mono" depends="validate_csc" if="gmcs.found">
     <property name="testCSC.exe"
       location="${build.dir}/ExampleCsc.exe"/>
     <dn:csc
@@ -295,7 +295,7 @@
     <au:assertFileExists file="${testCSC2.dll}"/>
   </target>
 
-  <target name="CSCdll-Mono" depends="validate_csc" if="mcs.found">
+  <target name="CSCdll-Mono" depends="validate_csc" if="gmcs.found">
     <property name="testCSC.dll"
       location="${build.dir}/Example2.dll" />
     <dn:csc
@@ -332,7 +332,7 @@
   </target>
 
   <target name="CscReferences-Mono" depends="validate_csc,CSCdll-Mono"
-          if="mcs.found">
+          if="gmcs.found">
     <property name="testCscReferences.exe"
       location="${build.dir}/ExampleCsc2.exe" />
     <dn:csc
diff --git a/src/tests/antunit/wsdl2dotnet-test.xml b/src/tests/antunit/wsdl2dotnet-test.xml
index 1c553ba..cb82c4c 100644
--- a/src/tests/antunit/wsdl2dotnet-test.xml
+++ b/src/tests/antunit/wsdl2dotnet-test.xml
@@ -56,7 +56,7 @@
    <echo> wsdl.found=${wsdl.found}</echo>
    <condition property="csc.found">
       <or>
-        <available file="mcs"     filepath="${env.PATH}" />
+        <available file="gmcs"     filepath="${env.PATH}" />
         <available file="csc"     filepath="${env.PATH}" />
         <available file="csc.exe" filepath="${env.PATH}" />
         <available file="csc.exe" filepath="${env.Path}" />
@@ -80,7 +80,7 @@
    <echo> dotnetapps.found=${dotnetapps.found}</echo>
    <condition property="is.mono">
       <and>
-        <available file="mcs"     filepath="${env.PATH}" />
+        <available file="gmcs"     filepath="${env.PATH}" />
         <not>
           <available file="csc.exe"     filepath="${env.PATH}" />
         </not>