Skip to content
Permalink
Browse files
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
  • Loading branch information
bodewig committed Aug 10, 2010
1 parent 00d74e3 commit 4817ceb273701b452728cea6e7a4533e9d24a1bf
Showing 4 changed files with 22 additions and 17 deletions.
@@ -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>
@@ -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 @@ public void clear() {
unsafe = false;
noconfig = false;
definitions = null;
setExecutable(isWindows ? "csc" : "mcs");
setExecutable(isWindows ? "csc" : MONO_CS_COMPILER);
}


@@ -203,7 +205,7 @@ public void setFileAlign(int fileAlign) {
*@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;
@@ -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
@@ -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>

0 comments on commit 4817ceb

Please sign in to comment.