Browse Source

Slowly approaching <csc> with Mono

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@275021 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 22 years ago
parent
commit
9642cc73f8
1 changed files with 52 additions and 7 deletions
  1. +52
    -7
      src/etc/testcases/taskdefs/optional/dotnet.xml

+ 52
- 7
src/etc/testcases/taskdefs/optional/dotnet.xml View File

@@ -9,6 +9,9 @@
<property name="out.app" location="${classes.dir}/out.exe"/> <property name="out.app" location="${classes.dir}/out.exe"/>
<property name="out.type" value="exe"/> <property name="out.type" value="exe"/>
<target name="mark-mono-ok">
<property name="mono.ok" value="true"/>
</target>
<target name="probe_for_apps" > <target name="probe_for_apps" >
<condition property="ilasm.found"> <condition property="ilasm.found">
@@ -36,18 +39,41 @@
</condition> </condition>
<echo> vbc.found=${vbc.found}</echo> <echo> vbc.found=${vbc.found}</echo>
--> -->
<condition property="dotnetapps.found">
<and>

<!-- Mono C# compiler -->
<condition property="mcs.found">
<available file="mcs" filepath="${env.PATH}" />
</condition>
<echo> mcs.found=${mcs.found}</echo>

<condition property="cs.found">
<or>
<isset property="csc.found"/> <isset property="csc.found"/>
<isset property="mcs.found"/>
</or>
</condition>
<echo> cs.found=${cs.found}</echo>

<condition property="dotnetapps.found">
<or>
<and>
<isset property="cs.found"/>
<isset property="mono.ok"/>
</and>
<and>
<not>
<isset property="mono.ok"/>
</not>
<isset property="csc.found"/>
<!-- <isset property="vbc.found"/> --> <!-- <isset property="vbc.found"/> -->
<isset property="ilasm.found"/>
</and>
<isset property="ilasm.found"/>
</and>
</or>
</condition> </condition>
<echo> dotnetapps.found=${dotnetapps.found}</echo> <echo> dotnetapps.found=${dotnetapps.found}</echo>
</target> </target>
<target name="validate" depends="probe_for_apps" >
<target name="validate" depends="probe_for_apps">
<fail unless="dotnetapps.found">Needed .net apps are missing</fail> <fail unless="dotnetapps.found">Needed .net apps are missing</fail>
</target> </target>
@@ -60,13 +86,32 @@
<delete dir="${build.dir}"/> <delete dir="${build.dir}"/>
</target> </target>
<target name="testCSC" depends="init">
<target name="testCSC" depends="testCSC-Mono,testCSC-MS"/>

<target name="testCSC-MS" depends="init" if="csc.found">
<property name="testCSC.exe"
location="${build.dir}/ExampleCsc.exe" />
<csc
destFile="${testCSC.exe}"
targetType="exe"
>
</csc>
<available property="app.created" file="${testCSC.exe}"/>
<fail unless="app.created">No app ${testCSC.exe} created</fail>
<exec executable="${testCSC.exe}" failonerror="true" />
<delete file="${testCSC.exe}"/>
</target>

<target name="testCSC-Mono" depends="mark-mono-ok,init" if="mcs.found">
<property name="testCSC.exe" <property name="testCSC.exe"
location="${build.dir}/ExampleCsc.exe" /> location="${build.dir}/ExampleCsc.exe" />
<csc <csc
destFile="${testCSC.exe}" destFile="${testCSC.exe}"
targetType="exe" targetType="exe"
executable="mcs"
includedefaultreferences="false"
> >
<reference dir="/usr/lib" includes="*.dll"/>
</csc> </csc>
<available property="app.created" file="${testCSC.exe}"/> <available property="app.created" file="${testCSC.exe}"/>
<fail unless="app.created">No app ${testCSC.exe} created</fail> <fail unless="app.created">No app ${testCSC.exe} created</fail>


Loading…
Cancel
Save