| <?xml version="1.0"?> |
| <!-- |
| Licensed to the Apache Software Foundation (ASF) under one or more |
| contributor license agreements. See the NOTICE file distributed with |
| this work for additional information regarding copyright ownership. |
| The ASF licenses this file to You under the Apache License, Version 2.0 |
| (the "License"); you may not use this file except in compliance with |
| the License. You may obtain a copy of the License at |
| |
| https://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| --> |
| <project name="compilation in dir with spaces" basedir="." default="echo" |
| xmlns:au="antlib:org.apache.ant.antunit" |
| xmlns:dn="antlib:org.apache.ant.dotnet"> |
| |
| <property name="source.dir" location="src"/> |
| <property name="dest.dir" location="dest"/> |
| |
| <target name="probe_for_apps" > |
| <property environment="env"/> |
| |
| <condition property="ilasm.found"> |
| <or> |
| <available file="ilasm.exe" filepath="${env.Path}" /> |
| <available file="ilasm.exe" filepath="${env.PATH}" /> |
| <available file="ilasm" filepath="${env.PATH}" /> |
| </or> |
| </condition> |
| |
| <condition property="csc.found"> |
| <or> |
| <available file="csc.exe" filepath="${env.Path}" /> |
| <available file="csc.exe" filepath="${env.PATH}" /> |
| <available file="mcs" filepath="${env.PATH}" /> |
| </or> |
| </condition> |
| |
| <condition property="vbc.found"> |
| <or> |
| <available file="vbc.exe" filepath="${env.Path}" /> |
| <available file="vbc.exe" filepath="${env.PATH}" /> |
| <available file="vbc" filepath="${env.PATH}" /> |
| </or> |
| </condition> |
| |
| <condition property="jsharp.found"> |
| <or> |
| <available file="vjc.exe" filepath="${env.Path}" /> |
| <available file="vjc.exe" filepath="${env.PATH}" /> |
| <available file="vjc" filepath="${env.PATH}" /> |
| </or> |
| </condition> |
| |
| <condition property="ildasm.found"> |
| <or> |
| <available file="ildasm.exe" filepath="${env.Path}" /> |
| <available file="ildasm.exe" filepath="${env.PATH}" /> |
| <available file="ildasm" filepath="${env.PATH}" /> |
| </or> |
| </condition> |
| |
| </target> |
| |
| <target name="setUp"> |
| <mkdir dir="${source.dir}"/> |
| <mkdir dir="${dest.dir}"/> |
| <copy todir="${source.dir}"> |
| <fileset dir="../src"> |
| <include name="example*"/> |
| <include name="*.java"/> |
| </fileset> |
| </copy> |
| </target> |
| |
| <target name="tearDown"> |
| <delete dir="${source.dir}"/> |
| <delete dir="${dest.dir}"/> |
| </target> |
| |
| <target name="testCSC" depends="probe_for_apps" if="csc.found"> |
| <property name="testCSC.exe" |
| location="${dest.dir}/ExampleCsc.exe" /> |
| <au:assertFileDoesntExist file="${testCSC.exe}"/> |
| <dn:csc |
| destFile="${testCSC.exe}" |
| targetType="exe" |
| srcDir="${source.dir}" |
| > |
| </dn:csc> |
| <au:assertFileExists file="${testCSC.exe}"/> |
| </target> |
| |
| <target name="testJSharpc" depends="probe_for_apps" if="jsharp.found"> |
| <property name="testJSharp.exe" |
| location="${dest.dir}/jsharp.exe" /> |
| <au:assertFileDoesntExist file="${testJSharp.exe}"/> |
| <dn:jsharpc |
| destFile="${testJSharp.exe}" |
| targetType="exe" |
| > |
| <src dir="${source.dir}" includes="*.java"/> |
| </dn:jsharpc> |
| <au:assertFileExists file="${testJSharp.exe}"/> |
| </target> |
| |
| <target name="testVBC" depends="probe_for_apps" if="vbc.found"> |
| <property name="testVBC.exe" |
| location="${dest.dir}/ExampleVbc.exe" /> |
| <au:assertFileDoesntExist file="${testVBC.exe}"/> |
| <dn:vbc |
| destFile="${testVBC.exe}" |
| targetType="exe" |
| srcDir="${source.dir}" |
| > |
| </dn:vbc> |
| <au:assertFileExists file="${testVBC.exe}"/> |
| </target> |
| |
| <target name="testIlasm" depends="probe_for_apps" if="ilasm.found"> |
| <property name="testIlasm.exe" |
| location="${dest.dir}/ilasm.exe" /> |
| <au:assertFileDoesntExist file="${testIlasm.exe}"/> |
| <dn:ilasm |
| destFile="${testIlasm.exe}" |
| targetType="exe" |
| > |
| <src dir="${source.dir}" includes="*.il"/> |
| </dn:ilasm> |
| <au:assertFileExists file="${testIlasm.exe}"/> |
| </target> |
| |
| <target name="testCSCResponseFile" depends="probe_for_apps" if="csc.found"> |
| <property name="testCSC.exe" |
| location="${dest.dir}/ExampleCsc.exe" /> |
| <au:assertFileDoesntExist file="${testCSC.exe}"/> |
| <dn:csc |
| destFile="${testCSC.exe}" |
| targetType="exe" |
| srcDir="${source.dir}" |
| useResponseFile="true" |
| > |
| </dn:csc> |
| <au:assertFileExists file="${testCSC.exe}"/> |
| </target> |
| |
| <target name="testJSharpcResponseFile" depends="probe_for_apps" if="jsharp.found"> |
| <property name="testJSharp.exe" |
| location="${dest.dir}/jsharp.exe" /> |
| <au:assertFileDoesntExist file="${testJSharp.exe}"/> |
| <dn:jsharpc |
| destFile="${testJSharp.exe}" |
| targetType="exe" |
| useResponseFile="true" |
| > |
| <src dir="${source.dir}" includes="*.java"/> |
| </dn:jsharpc> |
| <au:assertFileExists file="${testJSharp.exe}"/> |
| </target> |
| |
| <target name="testVBCResponseFile" depends="probe_for_apps" if="vbc.found"> |
| <property name="testVBC.exe" |
| location="${dest.dir}/ExampleVbc.exe" /> |
| <au:assertFileDoesntExist file="${testVBC.exe}"/> |
| <dn:vbc |
| destFile="${testVBC.exe}" |
| targetType="exe" |
| srcDir="${source.dir}" |
| useResponseFile="true" |
| > |
| </dn:vbc> |
| <au:assertFileExists file="${testVBC.exe}"/> |
| </target> |
| |
| </project> |