git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@274218 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -0,0 +1,108 @@ | |||
| <?xml version="1.0"?> | |||
| <project name="dotnet" basedir="." default="init"> | |||
| <property environment="env"/> | |||
| <property name="build.dir" location="dotnet/build"/> | |||
| <property name="src.dir" location="dotnet"/> | |||
| <property name="out.csc" location="${src.dir}/out.cs"/> | |||
| <property name="out.app" location="${classes.dir}/out.exe"/> | |||
| <property name="out.type" value="exe"/> | |||
| <target name="probe_for_apps" > | |||
| <condition property="ilasm.found"> | |||
| <or> | |||
| <available file="ilasm" filepath="${env.PATH}" /> | |||
| <available file="ilasm.exe" filepath="${env.PATH}" /> | |||
| <available file="ilasm.exe" filepath="${env.Path}" /> | |||
| </or> | |||
| </condition> | |||
| <echo> ilasm.found=${ilasm.found}</echo> | |||
| <condition property="csc.found"> | |||
| <or> | |||
| <available file="csc" filepath="${env.PATH}" /> | |||
| <available file="csc.exe" filepath="${env.PATH}" /> | |||
| <available file="csc.exe" filepath="${env.Path}" /> | |||
| </or> | |||
| </condition> | |||
| <echo> csc.found=${csc.found}</echo> | |||
| <!-- <condition property="vbc.found"> | |||
| <or> | |||
| <available file="vbc" filepath="${env.PATH}" /> | |||
| <available file="vbc.exe" filepath="${env.PATH}" /> | |||
| <available file="vbc.exe" filepath="${env.Path}" /> | |||
| </or> | |||
| </condition> | |||
| <echo> vbc.found=${vbc.found}</echo> | |||
| --> | |||
| <condition property="dotnetapps.found"> | |||
| <and> | |||
| <isset property="csc.found"/> | |||
| <!-- <isset property="vbc.found"/> --> | |||
| <isset property="ilasm.found"/> | |||
| </and> | |||
| </condition> | |||
| <echo> dotnetapps.found=${dotnetapps.found}</echo> | |||
| </target> | |||
| <target name="validate" depends="probe_for_apps" > | |||
| <fail unless="dotnetapps.found">Needed .net apps are missing</fail> | |||
| </target> | |||
| <target name="init" depends="validate"> | |||
| <mkdir dir="${build.dir}"/> | |||
| </target> | |||
| <target name="teardown"> | |||
| <delete dir="${build.dir}"/> | |||
| </target> | |||
| <target name="testCSC" depends="init"> | |||
| <property name="testCSC.exe" | |||
| location="${build.dir}/ExampleCsc.exe" /> | |||
| <csc | |||
| destFile="${testCSC.exe}" | |||
| targetType="exe" | |||
| > | |||
| <src dir="${src.dir}" includes="**/*.cs"/> | |||
| </csc> | |||
| <available property="app.created" file="${testCSC.exe}"/> | |||
| <fail unless="app.created">No app ${testCSC.exe}created</fail> | |||
| <exec executable="${testCSC.exe}" failonerror="true" /> | |||
| </target> | |||
| <target name="testILASM" depends="init"> | |||
| <property name="testILASM.exe" | |||
| location="${build.dir}/ExampleIlasm.exe" /> | |||
| <ilasm | |||
| destFile="${testILASM.exe}" | |||
| targetType="exe" | |||
| > | |||
| <src dir="${src.dir}" includes="**/*.il"/> | |||
| </ilasm> | |||
| <available property="app.created" file="${testILASM.exe}"/> | |||
| <fail unless="app.created">No app ${testCSC.exe}created</fail> | |||
| <exec executable="${testILASM.exe}" failonerror="true" /> | |||
| </target> | |||
| <!-- not including this in the test as it creates an exe in the src dir --> | |||
| <target name="testIlasmNoDestFile" depends="init"> | |||
| <ilasm | |||
| targetType="exe" | |||
| > | |||
| <src dir="${src.dir}" includes="**/*.il"/> | |||
| </ilasm> | |||
| </target> | |||
| <!-- just here to look at fileset refid conversion by hand --> | |||
| <target name="echoFileset"> | |||
| <fileset id="ilasm" dir="${src.dir}" includes="**/*.il" /> | |||
| <property name="ilasm.string" refid="ilasm"/> | |||
| <echo>${ilasm.string}</echo> | |||
| </target> | |||
| </project> | |||
| @@ -0,0 +1,54 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <definitions name="HelloWorld" | |||
| targetNamespace="http://hello.jaxrpc.samples/" | |||
| xmlns:tns="http://hello.jaxrpc.samples/" | |||
| xmlns="http://schemas.xmlsoap.org/wsdl/" | |||
| xmlns:xsd="http://www.w3.org/2001/XMLSchema" | |||
| xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"> | |||
| <types /> | |||
| <message name="sayHello"> | |||
| <part name="String_1" type="xsd:string" /> | |||
| </message> | |||
| <message name="sayHelloResponse"> | |||
| <part name="result" type="xsd:string" /> | |||
| </message> | |||
| <portType name="Hello"> | |||
| <operation name="sayHello" parameterOrder="String_1"> | |||
| <input message="tns:sayHello" /> | |||
| <output message="tns:sayHelloResponse" /> | |||
| </operation> | |||
| </portType> | |||
| <binding name="HelloBinding" type="tns:Hello"> | |||
| <operation name="sayHello"> | |||
| <input> | |||
| <soap:body | |||
| encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" | |||
| use="encoded" namespace="http://hello.jaxrpc.samples/" /> | |||
| </input> | |||
| <output> | |||
| <soap:body | |||
| encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" | |||
| use="encoded" namespace="http://hello.jaxrpc.samples/" /> | |||
| </output> | |||
| <soap:operation soapAction="" /> | |||
| </operation> | |||
| <soap:binding transport="http://schemas.xmlsoap.org/soap/http" | |||
| style="rpc" /> | |||
| </binding> | |||
| <service name="HelloWorld"> | |||
| <port name="HelloPort" binding="tns:HelloBinding"> | |||
| <soap:address | |||
| location="http://localhost:8080/axis/Hello" /> | |||
| </port> | |||
| </service> | |||
| </definitions> | |||
| @@ -0,0 +1,62 @@ | |||
| /* | |||
| * The Apache Software License, Version 1.1 | |||
| * | |||
| * Copyright (c) 2001-2003 The Apache Software Foundation. All rights | |||
| * reserved. | |||
| * | |||
| * Redistribution and use in source and binary forms, with or without | |||
| * modification, are permitted provided that the following conditions | |||
| * are met: | |||
| * | |||
| * 1. Redistributions of source code must retain the above copyright | |||
| * notice, this list of conditions and the following disclaimer. | |||
| * | |||
| * 2. Redistributions in binary form must reproduce the above copyright | |||
| * notice, this list of conditions and the following disclaimer in | |||
| * the documentation and/or other materials provided with the | |||
| * distribution. | |||
| * | |||
| * 3. The end-user documentation included with the redistribution, if | |||
| * any, must include the following acknowlegement: | |||
| * "This product includes software developed by the | |||
| * Apache Software Foundation (http://www.apache.org/)." | |||
| * Alternately, this acknowlegement may appear in the software itself, | |||
| * if and wherever such third-party acknowlegements normally appear. | |||
| * | |||
| * 4. The names "Ant" and "Apache Software | |||
| * Foundation" must not be used to endorse or promote products derived | |||
| * from this software without prior written permission. For written | |||
| * permission, please contact apache@apache.org. | |||
| * | |||
| * 5. Products derived from this software may not be called "Apache" | |||
| * nor may "Apache" appear in their names without prior written | |||
| * permission of the Apache Group. | |||
| * | |||
| * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
| * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
| * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
| * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
| * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
| * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
| * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
| * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
| * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
| * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
| * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
| * SUCH DAMAGE. | |||
| * ==================================================================== | |||
| * | |||
| * This software consists of voluntary contributions made by many | |||
| * individuals on behalf of the Apache Software Foundation. For more | |||
| * information on the Apache Software Foundation, please see | |||
| * <http://www.apache.org/>. | |||
| */ | |||
| using System; | |||
| public class Example { | |||
| public static void Main(String[] args) { | |||
| Console.WriteLine("hello, I look like Java, but I'm really .NET"); | |||
| } | |||
| } | |||
| @@ -0,0 +1,78 @@ | |||
| //created from ildasm of example.cs | |||
| .assembly extern /*23000001*/ mscorlib | |||
| { | |||
| .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4.. | |||
| .ver 1:0:3300:0 | |||
| } | |||
| .assembly /*20000001*/ example | |||
| { | |||
| // --- The following custom attribute is added automatically, do not uncomment ------- | |||
| // .custom /*0C000001:0A000001*/ instance void [mscorlib/* 23000001 */]System.Diagnostics.DebuggableAttribute/* 01000002 */::.ctor(bool, | |||
| // bool) /* 0A000001 */ = ( 01 00 00 01 00 00 ) | |||
| .hash algorithm 0x00008004 | |||
| .ver 0:0:0:0 | |||
| } | |||
| .module example.exe | |||
| // MVID: {641E4709-F7B6-4BB0-BC5D-49C2CF1F1CF8} | |||
| .imagebase 0x00400000 | |||
| .subsystem 0x00000003 | |||
| .file alignment 512 | |||
| .corflags 0x00000001 | |||
| // Image base: 0x03180000 | |||
| // | |||
| // ============== CLASS STRUCTURE DECLARATION ================== | |||
| // | |||
| .class /*02000002*/ public auto ansi beforefieldinit Example | |||
| extends [mscorlib/* 23000001 */]System.Object/* 01000001 */ | |||
| { | |||
| } // end of class Example | |||
| // ============================================================= | |||
| // =============== GLOBAL FIELDS AND METHODS =================== | |||
| // ============================================================= | |||
| // =============== CLASS MEMBERS DECLARATION =================== | |||
| // note that class flags, 'extends' and 'implements' clauses | |||
| // are provided here for information only | |||
| .class /*02000002*/ public auto ansi beforefieldinit Example | |||
| extends [mscorlib/* 23000001 */]System.Object/* 01000001 */ | |||
| { | |||
| .method /*06000001*/ public hidebysig static | |||
| void Main(string[] args) cil managed | |||
| // SIG: 00 01 01 1D 0E | |||
| { | |||
| .entrypoint | |||
| // Method begins at RVA 0x2050 | |||
| // Code size 11 (0xb) | |||
| .maxstack 1 | |||
| IL_0000: /* 72 | (70)000001 */ ldstr "hello, I look like Java, but I'm really .NET" /* 70000001 */ | |||
| IL_0005: /* 28 | (0A)000002 */ call void [mscorlib/* 23000001 */]System.Console/* 01000003 */::WriteLine(string) /* 0A000002 */ | |||
| IL_000a: /* 2A | */ ret | |||
| } // end of method Example::Main | |||
| .method /*06000002*/ public hidebysig specialname rtspecialname | |||
| instance void .ctor() cil managed | |||
| // SIG: 20 00 01 | |||
| { | |||
| // Method begins at RVA 0x2068 | |||
| // Code size 7 (0x7) | |||
| .maxstack 1 | |||
| IL_0000: /* 02 | */ ldarg.0 | |||
| IL_0001: /* 28 | (0A)000003 */ call instance void [mscorlib/* 23000001 */]System.Object/* 01000001 */::.ctor() /* 0A000003 */ | |||
| IL_0006: /* 2A | */ ret | |||
| } // end of method Example::.ctor | |||
| } // end of class Example | |||
| @@ -0,0 +1,52 @@ | |||
| // Microsoft (R) .NET Framework IL Disassembler. Version 1.0.3705.0 | |||
| // Copyright (C) Microsoft Corporation 1998-2001. All rights reserved. | |||
| // Image base: 0x03180000 | |||
| // | |||
| // ============== CLASS STRUCTURE DECLARATION ================== | |||
| // | |||
| .class public auto ansi beforefieldinit Example2 | |||
| extends [mscorlib]System.Object | |||
| { | |||
| } // end of class Example2 | |||
| // ============================================================= | |||
| // =============== GLOBAL FIELDS AND METHODS =================== | |||
| // ============================================================= | |||
| // =============== CLASS MEMBERS DECLARATION =================== | |||
| // note that class flags, 'extends' and 'implements' clauses | |||
| // are provided here for information only | |||
| .class public auto ansi beforefieldinit Example2 | |||
| extends [mscorlib]System.Object | |||
| { | |||
| .field public int32 some_variable | |||
| .method public hidebysig specialname rtspecialname | |||
| instance void .ctor() cil managed | |||
| { | |||
| // Code size 14 (0xe) | |||
| .maxstack 2 | |||
| IL_0000: ldarg.0 | |||
| IL_0001: ldc.i4.3 | |||
| IL_0002: stfld int32 Example2::some_variable | |||
| IL_0007: ldarg.0 | |||
| IL_0008: call instance void [mscorlib]System.Object::.ctor() | |||
| IL_000d: ret | |||
| } // end of method Example2::.ctor | |||
| } // end of class Example2 | |||
| // ============================================================= | |||
| //*********** DISASSEMBLY COMPLETE *********************** | |||
| // WARNING: Created Win32 resource file example2.res | |||
| @@ -0,0 +1,115 @@ | |||
| /* | |||
| * The Apache Software License, Version 1.1 | |||
| * | |||
| * Copyright (c) 2002-2003 The Apache Software Foundation. All rights | |||
| * reserved. | |||
| * | |||
| * Redistribution and use in source and binary forms, with or without | |||
| * modification, are permitted provided that the following conditions | |||
| * are met: | |||
| * | |||
| * 1. Redistributions of source code must retain the above copyright | |||
| * notice, this list of conditions and the following disclaimer. | |||
| * | |||
| * 2. Redistributions in binary form must reproduce the above copyright | |||
| * notice, this list of conditions and the following disclaimer in | |||
| * the documentation and/or other materials provided with the | |||
| * distribution. | |||
| * | |||
| * 3. The end-user documentation included with the redistribution, if | |||
| * any, must include the following acknowlegement: | |||
| * "This product includes software developed by the | |||
| * Apache Software Foundation (http://www.apache.org/)." | |||
| * Alternately, this acknowlegement may appear in the software itself, | |||
| * if and wherever such third-party acknowlegements normally appear. | |||
| * | |||
| * 4. The names "Ant" and "Apache Software | |||
| * Foundation" must not be used to endorse or promote products derived | |||
| * from this software without prior written permission. For written | |||
| * permission, please contact apache@apache.org. | |||
| * | |||
| * 5. Products derived from this software may not be called "Apache" | |||
| * nor may "Apache" appear in their names without prior written | |||
| * permission of the Apache Group. | |||
| * | |||
| * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||
| * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
| * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
| * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||
| * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
| * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
| * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||
| * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||
| * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
| * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||
| * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
| * SUCH DAMAGE. | |||
| * ==================================================================== | |||
| * | |||
| * This software consists of voluntary contributions made by many | |||
| * individuals on behalf of the Apache Software Foundation. For more | |||
| * information on the Apache Software Foundation, please see | |||
| * <http://www.apache.org/>. | |||
| */ | |||
| package org.apache.tools.ant.taskdefs.optional; | |||
| import java.io.*; | |||
| import java.util.Properties; | |||
| import org.apache.tools.ant.BuildFileTest; | |||
| /** | |||
| * Tests the Dotnet tasks, based off WsdlToDotnetTest | |||
| * | |||
| * @author steve loughran | |||
| * @since Ant 1.6 | |||
| */ | |||
| public class DotnetTest extends BuildFileTest { | |||
| /** | |||
| * Description of the Field | |||
| */ | |||
| private final static String TASKDEFS_DIR = "src/etc/testcases/taskdefs/optional/"; | |||
| /** | |||
| * Constructor | |||
| * | |||
| * @param name testname | |||
| */ | |||
| public DotnetTest(String name) { | |||
| super(name); | |||
| } | |||
| /** | |||
| * The JUnit setup method | |||
| */ | |||
| public void setUp() { | |||
| configureProject(TASKDEFS_DIR + "dotnet.xml"); | |||
| } | |||
| /** | |||
| * The teardown method for JUnit | |||
| */ | |||
| public void tearDown() { | |||
| executeTarget("teardown"); | |||
| } | |||
| /** | |||
| * A unit test for JUnit | |||
| */ | |||
| public void testCSC() throws Exception { | |||
| executeTarget("testCSC"); | |||
| } | |||
| /** | |||
| * A unit test for JUnit | |||
| */ | |||
| public void testILASM() throws Exception { | |||
| executeTarget("testILASM"); | |||
| } | |||
| } | |||