You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@etch.apache.org by fi...@apache.org on 2011/07/21 18:20:19 UTC

svn commit: r1149260 - in /incubator/etch/branches/singlestack: ./ binding-csharp/runtime/ binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Util/ build-support/ examples/chat/ examples/distmap/ examples/example/ examples/example_m...

Author: fitzner
Date: Thu Jul 21 16:20:05 2011
New Revision: 1149260

URL: http://svn.apache.org/viewvc?rev=1149260&view=rev
Log:
ETCH-157 binding-csharp: add mono support

updated build-system to apache-ant-dotnet 1.1
updated build-files to avoid building/executing tests on mono (NUnit not working at the moment)

Adds support for building and using the C# binding with Mono (>= 2.10.1).
Changes the build.xml files to use xbuild instead of mdtool and bumps the dependency to Mono 2.10.1. Additional the HPTimer class is rewritten to use .NET methods and not Win32 methods.

This patch comes from
    Armin Mueller <mu...@itestra.com>
    Aleksandar Kanchev <ka...@itestra.com>

Modified:
    incubator/etch/branches/singlestack/BUILD.txt
    incubator/etch/branches/singlestack/binding-csharp/runtime/build.xml
    incubator/etch/branches/singlestack/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Util/HPTimer.cs
    incubator/etch/branches/singlestack/build-support/dependencies.xml
    incubator/etch/branches/singlestack/build-support/etch.common.xml
    incubator/etch/branches/singlestack/build.dependencies
    incubator/etch/branches/singlestack/examples/chat/build.xml
    incubator/etch/branches/singlestack/examples/distmap/build.xml
    incubator/etch/branches/singlestack/examples/example/build.xml
    incubator/etch/branches/singlestack/examples/example_mixin/build.xml
    incubator/etch/branches/singlestack/examples/helloworld/build.xml
    incubator/etch/branches/singlestack/examples/perf/build.xml
    incubator/etch/branches/singlestack/scripts/antsetup.sh   (contents, props changed)
    incubator/etch/branches/singlestack/tests/build.xml

Modified: incubator/etch/branches/singlestack/BUILD.txt
URL: http://svn.apache.org/viewvc/incubator/etch/branches/singlestack/BUILD.txt?rev=1149260&r1=1149259&r2=1149260&view=diff
==============================================================================
--- incubator/etch/branches/singlestack/BUILD.txt (original)
+++ incubator/etch/branches/singlestack/BUILD.txt Thu Jul 21 16:20:05 2011
@@ -72,8 +72,8 @@ you need the following:
 To compile the C# bindings and examples:
 
  * Apache Ant DotNet 1.0
- * .NET Framework 4.0 (Visual Studio 2005 and upper)
- ** (Mono 1.9 support is experimental)
+ * .NET Framework 4.0 (Visual Studio 2010) (Windows)
+ * Mono 2.10.1 (Linux) (support is experimental)
  * NUnit 2.5.9.10348
  
 To compile NSIS installers:

Modified: incubator/etch/branches/singlestack/binding-csharp/runtime/build.xml
URL: http://svn.apache.org/viewvc/incubator/etch/branches/singlestack/binding-csharp/runtime/build.xml?rev=1149260&r1=1149259&r2=1149260&view=diff
==============================================================================
--- incubator/etch/branches/singlestack/binding-csharp/runtime/build.xml (original)
+++ incubator/etch/branches/singlestack/binding-csharp/runtime/build.xml Thu Jul 21 16:20:05 2011
@@ -66,8 +66,9 @@
     </target>
 
     <target name="build-main-with-mono" if="USE.mono" >
-        <echo message="build with mono" />
-        <mdtool dir="${src}/main/csharp" project="EtchProj.csproj" />
+        <echo message="Experimental: build w/ mono" />
+	<echo message="monohome = ${build.mono.home}"/>
+        <xbuild dir="${src}/main/csharp" project="EtchProj.csproj" />
     </target>
 
     <target name="build-main-with-dotnet" if="USE.dotnet" >
@@ -102,8 +103,8 @@
 
     <!-- TEST TARGET -->
     <target name="build-test-with-mono" if="USE.mono" unless="build.skip.tests">
-        <echo message="TODO: build w/ mono" />
-        <mdtool dir="${src}/test/csharp" project="EtchTestProj.csproj" />
+        <echo message="Experimental: build w/ mono" />
+        <xbuild dir="${src}/test/csharp" project="EtchTestProj.csproj" />
     </target>
 
     <target name="build-test-with-dotnet" if="USE.dotnet" unless="build.skip.tests">

Modified: incubator/etch/branches/singlestack/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Util/HPTimer.cs
URL: http://svn.apache.org/viewvc/incubator/etch/branches/singlestack/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Util/HPTimer.cs?rev=1149260&r1=1149259&r2=1149260&view=diff
==============================================================================
--- incubator/etch/branches/singlestack/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Util/HPTimer.cs (original)
+++ incubator/etch/branches/singlestack/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Util/HPTimer.cs Thu Jul 21 16:20:05 2011
@@ -18,41 +18,25 @@
 // under the License.
 // 
 using System;
-using System.Runtime.InteropServices;
+using System.Diagnostics;
 
 namespace Org.Apache.Etch.Bindings.Csharp.Util
 {
 	public abstract class HPTimer
 	{
-		[DllImport("kernel32.dll")]
-		private static extern bool QueryPerformanceCounter(out long x);
+		public const long NS_PER_MICROSECOND = 1000;
+		public const long NS_PER_MILLISECOND = 1000 * NS_PER_MICROSECOND;
+		public const long NS_PER_SECOND = 1000 * NS_PER_MILLISECOND;
 
-		[DllImport("kernel32.dll")]
-		private static extern bool QueryPerformanceFrequency(out long x);
+		private static Stopwatch stopwatch;
 
 		static HPTimer()
 		{
-			long freq = 0;
+			stopwatch = new Stopwatch();
+			stopwatch.Start();
 
-			if (!QueryPerformanceFrequency(out freq))
-				throw new Exception( "QueryPerformanceFrequency not supported" );
-			
-			// freq is ticks / second.
-			// we wanna compute seconds from ticks.
-			// the easy computation is seconds = ticks / freq
-			// to Get ns, we compute ns = ticks * 1,000,000,000 / freq
-			// the problem is ticks * 1,000,000,000 will likely overflow.
-			// what we want to do is precompute nsPerTick = 1,000,000,000 / freq
-			// and then compute ns = ticks * nsPerTick.
-
-			//Console.WriteLine( "HPTimer: freq = "+freq );
-			nsPerTick = ((double) NS_PER_SECOND)/freq;
-			//Console.WriteLine( "HPTimer: nsPerTick = "+nsPerTick );
-		}
-
-        public const long NS_PER_MICROSECOND = 1000;
-        public const long NS_PER_MILLISECOND = 1000 * NS_PER_MICROSECOND;
-        public const double NS_PER_SECOND = 1000.0 * NS_PER_MILLISECOND;
+			nsPerTick = NS_PER_SECOND / Stopwatch.Frequency;
+		}
 
 		/// <summary>
 		/// Returns the current high precision timer value in nanos.
@@ -60,12 +44,7 @@ namespace Org.Apache.Etch.Bindings.Cshar
 		/// <returns></returns>
 		public static long Now()
 		{
-			long x = 0;
-			
-			if (!QueryPerformanceCounter(out x))
-				throw new Exception( "QueryPerformanceCounter not supported" );
-
-			return (long) (x * nsPerTick);
+			return stopwatch.ElapsedTicks * nsPerTick;
 		}
 
 		/// <summary>
@@ -87,7 +66,7 @@ namespace Org.Apache.Etch.Bindings.Cshar
 		/// <returns></returns>
 		public static long MillisSince( long y )
 		{
-            return NsSince(y) / NS_PER_MILLISECOND;
+			return NsSince(y) / NS_PER_MILLISECOND;
 		}
 
 		/// <summary>
@@ -98,18 +77,18 @@ namespace Org.Apache.Etch.Bindings.Cshar
 		/// <returns></returns>
 		public static double SecondsSince( long y )
 		{
-            return NsSince(y) / NS_PER_SECOND;
+			return NsSince(y) / NS_PER_SECOND;
 		}
 
 		/// <summary>
 		/// Returns the number of high precision clock ticks per nano.
 		/// </summary>
 		/// <returns></returns>
-		public static double NsPerTick()
+		public static long NsPerTick()
 		{
 			return nsPerTick;
 		}
 
-		private static double nsPerTick;
+		private static long nsPerTick;
 	}
 }

Modified: incubator/etch/branches/singlestack/build-support/dependencies.xml
URL: http://svn.apache.org/viewvc/incubator/etch/branches/singlestack/build-support/dependencies.xml?rev=1149260&r1=1149259&r2=1149260&view=diff
==============================================================================
--- incubator/etch/branches/singlestack/build-support/dependencies.xml (original)
+++ incubator/etch/branches/singlestack/build-support/dependencies.xml Thu Jul 21 16:20:05 2011
@@ -86,7 +86,7 @@
               *
               *
               ************************************************************************
-              WARNING: ant-dotnet-1.0.jar and/or msbuild.exe and/or nunit.exe is missing, 
+              WARNING: ant-dotnet-1.1.jar and/or msbuild.exe and/or nunit.exe is missing, 
                        dotnet support will be disabled on your windows system.
                        (please check scripts/antSetup.bat for correct paths)
               ************************************************************************
@@ -101,7 +101,7 @@
              <and>
              <os family="windows" />
              <or>
-                <not><available file="${build.ant-dotnet.lib}/ant-dotnet-1.0.jar" /></not>
+                <not><available file="${build.ant-dotnet.lib}/ant-dotnet-1.1.jar" /></not>
                 <not><available file="${env.DOTNET_HOME}/msbuild.exe" /></not>
                 <not><available file="${env.NUNIT_HOME}/bin/net-2.0/nunit.exe" /></not>
              </or>

Modified: incubator/etch/branches/singlestack/build-support/etch.common.xml
URL: http://svn.apache.org/viewvc/incubator/etch/branches/singlestack/build-support/etch.common.xml?rev=1149260&r1=1149259&r2=1149260&view=diff
==============================================================================
--- incubator/etch/branches/singlestack/build-support/etch.common.xml (original)
+++ incubator/etch/branches/singlestack/build-support/etch.common.xml Thu Jul 21 16:20:05 2011
@@ -191,7 +191,7 @@
     <property   name="Etch.dependency.junit.jar" location="${build.junit.lib}/junit-4.3.1.jar" />
     <property   name="Etch.dependency.velocity.jar" value="${build.velocity.lib}/velocity-1.5.jar" />
     <property   name="Etch.dependency.velocity-dep.jar" value="${build.velocity.lib}/velocity-dep-1.5.jar" />
-    <property   name="Etch.dependency.ant-dotnet-1.0.jar" value="${build.ant-dotnet.lib}/ant-dotnet-1.0.jar" />
+    <property   name="Etch.dependency.ant-dotnet.jar" value="${build.ant-dotnet.lib}/ant-dotnet-1.1.jar" />
     <property   name="Etch.dependency.ant-cmake.jar" value="${build.ant-cmake.lib}/cmakeant.jar" />
 
     <!-- Csharp Support -->
@@ -206,9 +206,7 @@
     <condition property="USE.mono">
         <and>
             <not><os family="windows" /></not>
-            <!-- TODO mono support is not fully baked, use -DUSE.mono to test -->
-            <!-- <available file="${build.mono.home}/bin/mdtool" /> -->
-            <isset property="USE.mono" />
+            <available file="${build.mono.home}/bin/xbuild" />
         </and>
     </condition>
     <condition property="BUILD.csharp">
@@ -217,7 +215,7 @@
             <isset property="USE.mono" />
         </or>
     </condition>
-    <property name="tool.mdtool" value="${build.mono.home}/bin/mdtool" />
+    <property name="tool.xbuild" value="${build.mono.home}/bin/xbuild" />
 
     <!-- CMake ANT Support -->
     <condition property="USE.cmake" value="true" >
@@ -261,7 +259,7 @@
     <property name="EXAMPLE.ant.dotnet.jar" value="${Etch.dependency.ant-dotnet-1.0.jar}" />
 
     <!-- csharp ANT support -->
-    <taskdef onerror="report" resource="org/apache/ant/dotnet/antlib.xml" classpath="${Etch.dependency.ant-dotnet-1.0.jar}" />
+    <taskdef onerror="report" resource="org/apache/ant/dotnet/antlib.xml" classpath="${Etch.dependency.ant-dotnet.jar}" />
 
     <!-- CMake ANT support -->
     <taskdef onerror="report" name="cmake" classname="org.iainhull.ant.CmakeBuilder" classpath="${Etch.dependency.ant-cmake.jar}"/>
@@ -372,16 +370,18 @@
         </sequential>
     </macrodef>
 
-    <!-- MONO mdtool macro -->
-    <macrodef name="mdtool">
+    <!-- MONO xbuild macro -->
+    <macrodef name="xbuild">
         <attribute name="dir"         default="." />
         <attribute name="failonerror" default="false" />
-        <attribute name="project"     default="project.csproj" />
+        <attribute name="project"     default="" />
         <attribute name="target"      default="${Etch.build.target}" />
         <sequential>
-            <exec executable="${tool.mdtool}" dir="@{dir}" failonerror="@{failonerror}" >
-                <arg value="build" />
-                <arg value="--buildfile:@{project}" />
+
+	<echo message="xbuild tool ${tool.xbuild}"/>
+            <exec executable="${tool.xbuild}" dir="@{dir}" failonerror="@{failonerror}" >
+                <arg value="/property:Configuration=@{target}" />
+                <arg value="@{project}" />
             </exec>
         </sequential>
     </macrodef>

Modified: incubator/etch/branches/singlestack/build.dependencies
URL: http://svn.apache.org/viewvc/incubator/etch/branches/singlestack/build.dependencies?rev=1149260&r1=1149259&r2=1149260&view=diff
==============================================================================
--- incubator/etch/branches/singlestack/build.dependencies (original)
+++ incubator/etch/branches/singlestack/build.dependencies Thu Jul 21 16:20:05 2011
@@ -34,11 +34,14 @@ nsis.home=${env.ETCH_EXTERNAL_DEPENDS}/n
 clover.home=${env.ETCH_EXTERNAL_DEPENDS}/clover-ant/2.3.2
 
 ## Csharp ANT support
-ant-dotnet.lib=${env.ETCH_EXTERNAL_DEPENDS}/apache-ant-dotnet/1.0
+ant-dotnet.lib=${env.ETCH_EXTERNAL_DEPENDS}/apache-ant-dotnet/1.1
 
 ## CMake ANT support
 ant-cmake.lib=${env.ETCH_EXTERNAL_DEPENDS}/apache-ant-cmake/1.0
 
+## Mono Home
+mono.home=${env.ETCH_EXTERNAL_DEPENDS}/mono/2.10.1
+
 ## include experimental bindings in build? (comment this to exclude)
 #include.experimental=true
 
@@ -46,4 +49,4 @@ ant-cmake.lib=${env.ETCH_EXTERNAL_DEPEND
 #skip.tests=true
 
 ## skip example build? (comment this to exclude)
-#skip.examples=true
\ No newline at end of file
+#skip.examples=true

Modified: incubator/etch/branches/singlestack/examples/chat/build.xml
URL: http://svn.apache.org/viewvc/incubator/etch/branches/singlestack/examples/chat/build.xml?rev=1149260&r1=1149259&r2=1149260&view=diff
==============================================================================
--- incubator/etch/branches/singlestack/examples/chat/build.xml (original)
+++ incubator/etch/branches/singlestack/examples/chat/build.xml Thu Jul 21 16:20:05 2011
@@ -60,9 +60,7 @@
     <condition property="USE.mono" >
         <and>
             <not><os family="windows" /></not>
-            <!-- TODO mono support is not fully baked, use -DUSE.mono to test -->
-            <!-- <available file="${env.MONO_HOME}/bin/mdtool" /> -->
-            <isset property="USE.mono" />
+            <available file="${build.mono.home}/bin/xbuild" />
         </and>
     </condition>
     <condition property="BUILD.csharp" >
@@ -71,6 +69,7 @@
             <isset property="USE.mono" />
         </or>
     </condition>
+	<property name="tool.xbuild" value="${build.mono.home}/bin/xbuild" />
 
     <!-- import etch task -->
     <taskdef
@@ -88,15 +87,15 @@
         resource="org/apache/ant/dotnet/antlib.xml"
         classpath="${ant.dotnet.jar}" />
 
-    <macrodef name="mdtool" >
+    <macrodef name="xbuild">
         <attribute name="dir"         default="." />
         <attribute name="failonerror" default="false" />
-        <attribute name="project"     default="project.csproj" />
+        <attribute name="project"     default="" />
         <attribute name="target"      default="${build.target}" />
         <sequential>
-            <exec executable="${env.MONO_HOME}/bin/mdtool" dir="@{dir}" failonerror="@{failonerror}" >
-                <arg value="build" />
-                <arg value="--buildfile:@{project}" />
+            <exec executable="${tool.xbuild}" dir="@{dir}" failonerror="@{failonerror}" >
+                <arg value="/property:Configuration=@{target}" />
+                <arg value="@{project}" />
             </exec>
         </sequential>
     </macrodef>
@@ -188,8 +187,16 @@
     </target>
 
     <target name="build-csharp-with-mono" depends="generate-sources" if="USE.mono" >
-        <mdtool dir="${src}/main/csharp/ChatClientProj" project="ChatClientProj.csproj" />
-        <mdtool dir="${src}/main/csharp/ChatListenerProj" project="ChatListenerProj.csproj" />
+        <xbuild dir="${src}/main/csharp/ChatClientProj" project="ChatClientProj.csproj" />
+        <xbuild dir="${src}/main/csharp/ChatListenerProj" project="ChatListenerProj.csproj" />
+	<copy todir="${bin}" >
+            <fileset dir="${src}/main/csharp/ChatListenerProj/bin/${build.target}" >
+                <include name="*" />
+            </fileset>
+            <fileset dir="${src}/main/csharp/ChatClientProj/bin/${build.target}" >
+                <include name="*" />
+            </fileset>
+        </copy>
     </target>
 
     <target name="build-csharp-with-dotnet" depends="generate-sources" if="USE.dotnet" >
@@ -236,7 +243,7 @@
         </junit>
     </target>
 
-    <target name="test-csharp" depends="build-csharp" if="BUILD.csharp" unless="build.skip.tests">
+    <target name="test-csharp" depends="build-csharp" if="USE.dotnet" unless="build.skip.tests">
          <nunit xmlout="${nunit-results}/NUnitResults.xml" >
              <testassembly name="${src}/test/csharp/ChatTestProj/bin/${build.target}/ChatTestProj.dll" />
          </nunit>

Modified: incubator/etch/branches/singlestack/examples/distmap/build.xml
URL: http://svn.apache.org/viewvc/incubator/etch/branches/singlestack/examples/distmap/build.xml?rev=1149260&r1=1149259&r2=1149260&view=diff
==============================================================================
--- incubator/etch/branches/singlestack/examples/distmap/build.xml (original)
+++ incubator/etch/branches/singlestack/examples/distmap/build.xml Thu Jul 21 16:20:05 2011
@@ -60,9 +60,7 @@
     <condition property="USE.mono" >
         <and>
             <not><os family="windows" /></not>
-            <!-- TODO mono support is not fully baked, use -DUSE.mono to test -->
-            <!-- <available file="${env.MONO_HOME}/bin/mdtool" /> -->
-            <isset property="USE.mono" />
+            <available file="${build.mono.home}/bin/xbuild" />
         </and>
     </condition>
     <condition property="BUILD.csharp" >
@@ -71,6 +69,7 @@
             <isset property="USE.mono" />
         </or>
     </condition>
+	<property name="tool.xbuild" value="${build.mono.home}/bin/xbuild" />
 
     <!-- import etch task -->
     <taskdef
@@ -88,15 +87,15 @@
         resource="org/apache/ant/dotnet/antlib.xml"
         classpath="${ant.dotnet.jar}" />
 
-    <macrodef name="mdtool" >
+    <macrodef name="xbuild">
         <attribute name="dir"         default="." />
         <attribute name="failonerror" default="false" />
-        <attribute name="project"     default="project.csproj" />
+        <attribute name="project"     default="" />
         <attribute name="target"      default="${build.target}" />
         <sequential>
-            <exec executable="${env.MONO_HOME}/bin/mdtool" dir="@{dir}" failonerror="@{failonerror}" >
-                <arg value="build" />
-                <arg value="--buildfile:@{project}" />
+            <exec executable="${tool.xbuild}" dir="@{dir}" failonerror="@{failonerror}" >
+                <arg value="/property:Configuration=@{target}" />
+                <arg value="@{project}" />
             </exec>
         </sequential>
     </macrodef>
@@ -188,8 +187,16 @@
     </target>
 
     <target name="build-csharp-with-mono" depends="generate-sources" if="USE.mono" >
-        <mdtool dir="${src}/main/csharp/DistMapClientProj" project="DistMapClientProj.csproj" />
-        <mdtool dir="${src}/main/csharp/DistMapListenerProj" project="DistMapListenerProj.csproj" />
+        <xbuild dir="${src}/main/csharp/DistMapClientProj" project="DistMapClientProj.csproj" />
+        <xbuild dir="${src}/main/csharp/DistMapListenerProj" project="DistMapListenerProj.csproj" />
+	<copy todir="${bin}" >
+            <fileset dir="${src}/main/csharp/DistMapListenerProj/bin/${build.target}" >
+                <include name="*" />
+            </fileset>
+            <fileset dir="${src}/main/csharp/DistMapClientProj/bin/${build.target}" >
+                <include name="*" />
+            </fileset>
+        </copy>
     </target>
 
     <target name="build-csharp-with-dotnet" depends="generate-sources" if="USE.dotnet" >
@@ -236,7 +243,7 @@
         </junit>
     </target>
 
-    <target name="test-csharp" depends="build-csharp" if="BUILD.csharp" unless="build.skip.tests">
+    <target name="test-csharp" depends="build-csharp" if="USE.dotnet" unless="build.skip.tests">
          <nunit xmlout="${nunit-results}/NUnitResults.xml">
              <testassembly name="${src}/test/csharp/DistMapTestProj/bin/${build.target}/DistMapTestProj.dll" />
          </nunit>

Modified: incubator/etch/branches/singlestack/examples/example/build.xml
URL: http://svn.apache.org/viewvc/incubator/etch/branches/singlestack/examples/example/build.xml?rev=1149260&r1=1149259&r2=1149260&view=diff
==============================================================================
--- incubator/etch/branches/singlestack/examples/example/build.xml (original)
+++ incubator/etch/branches/singlestack/examples/example/build.xml Thu Jul 21 16:20:05 2011
@@ -60,9 +60,7 @@
     <condition property="USE.mono" >
         <and>
             <not><os family="windows" /></not>
-            <!-- TODO mono support is not fully baked, use -DUSE.mono to test -->
-            <!-- <available file="${env.MONO_HOME}/bin/mdtool" /> -->
-            <isset property="USE.mono" />
+            <available file="${build.mono.home}/bin/xbuild" />
         </and>
     </condition>
     <condition property="BUILD.csharp" >
@@ -71,6 +69,7 @@
             <isset property="USE.mono" />
         </or>
     </condition>
+	<property name="tool.xbuild" value="${build.mono.home}/bin/xbuild" />
 
     <!-- import etch task -->
     <taskdef
@@ -88,15 +87,15 @@
         resource="org/apache/ant/dotnet/antlib.xml"
         classpath="${ant.dotnet.jar}" />
 
-    <macrodef name="mdtool" >
+    <macrodef name="xbuild">
         <attribute name="dir"         default="." />
         <attribute name="failonerror" default="false" />
-        <attribute name="project"     default="project.csproj" />
+        <attribute name="project"     default="" />
         <attribute name="target"      default="${build.target}" />
         <sequential>
-            <exec executable="${env.MONO_HOME}/bin/mdtool" dir="@{dir}" failonerror="@{failonerror}" >
-                <arg value="build" />
-                <arg value="--buildfile:@{project}" />
+            <exec executable="${tool.xbuild}" dir="@{dir}" failonerror="@{failonerror}" >
+                <arg value="/property:Configuration=@{target}" />
+                <arg value="@{project}" />
             </exec>
         </sequential>
     </macrodef>
@@ -188,8 +187,16 @@
     </target>
 
     <target name="build-csharp-with-mono" depends="generate-sources" if="USE.mono" >
-        <mdtool dir="${src}/main/csharp/ExampleClientProj" project="ExampleClientProj.csproj" />
-        <mdtool dir="${src}/main/csharp/ExampleListenerProj" project="ExampleListenerProj.csproj" />
+        <xbuild dir="${src}/main/csharp/ExampleClientProj" project="ExampleClientProj.csproj" />
+        <xbuild dir="${src}/main/csharp/ExampleListenerProj" project="ExampleListenerProj.csproj" />
+	<copy todir="${bin}" >
+            <fileset dir="${src}/main/csharp/ExampleListenerProj/bin/${build.target}" >
+                <include name="*" />
+            </fileset>
+            <fileset dir="${src}/main/csharp/ExampleClientProj/bin/${build.target}" >
+                <include name="*" />
+            </fileset>
+        </copy>
     </target>
 
     <target name="build-csharp-with-dotnet" depends="generate-sources" if="USE.dotnet" >
@@ -236,7 +243,7 @@
         </junit>
     </target>
 
-    <target name="test-csharp" depends="build-csharp" if="BUILD.csharp" unless="build.skip.tests">
+    <target name="test-csharp" depends="build-csharp" if="USE.dotnet" unless="build.skip.tests">
          <nunit xmlout="${nunit-results}/NUnitResults.xml">
              <testassembly name="${src}/test/csharp/ExampleTestProj/bin/${build.target}/ExampleTestProj.dll" />
          </nunit>

Modified: incubator/etch/branches/singlestack/examples/example_mixin/build.xml
URL: http://svn.apache.org/viewvc/incubator/etch/branches/singlestack/examples/example_mixin/build.xml?rev=1149260&r1=1149259&r2=1149260&view=diff
==============================================================================
--- incubator/etch/branches/singlestack/examples/example_mixin/build.xml (original)
+++ incubator/etch/branches/singlestack/examples/example_mixin/build.xml Thu Jul 21 16:20:05 2011
@@ -60,9 +60,7 @@
     <condition property="USE.mono" >
         <and>
             <not><os family="windows" /></not>
-            <!-- TODO mono support is not fully baked, use -DUSE.mono to test -->
-            <!-- <available file="${env.MONO_HOME}/bin/mdtool" /> -->
-            <isset property="USE.mono" />
+            <available file="${build.mono.home}/bin/xbuild" />
         </and>
     </condition>
     <condition property="BUILD.csharp" >
@@ -71,6 +69,7 @@
             <isset property="USE.mono" />
         </or>
     </condition>
+    <property name="tool.xbuild" value="${build.mono.home}/bin/xbuild" />
 
     <!-- import etch task -->
     <taskdef onerror="report" resource="org/apache/etch/tools/ant/etch.xml" classpath="${etch.home}/lib/apache-etch-ant-plugin-${etch.longversion}.jar" />
@@ -85,15 +84,15 @@
         resource="org/apache/ant/dotnet/antlib.xml"
         classpath="${ant.dotnet.jar}" />
 
-    <macrodef name="mdtool" >
+    <macrodef name="xbuild">
         <attribute name="dir"         default="." />
         <attribute name="failonerror" default="false" />
-        <attribute name="project"     default="project.csproj" />
+        <attribute name="project"     default="" />
         <attribute name="target"      default="${build.target}" />
         <sequential>
-            <exec executable="${env.MONO_HOME}/bin/mdtool" dir="@{dir}" failonerror="@{failonerror}" >
-                <arg value="build" />
-                <arg value="--buildfile:@{project}" />
+            <exec executable="${tool.xbuild}" dir="@{dir}" failonerror="@{failonerror}" >
+                <arg value="/property:Configuration=@{target}" />
+                <arg value="@{project}" />
             </exec>
         </sequential>
     </macrodef>
@@ -188,8 +187,16 @@
     </target>
 
     <target name="build-csharp-with-mono" depends="generate-sources" if="USE.mono" >
-        <mdtool dir="${src}/main/csharp/ExampleClientProj" project="ExampleClientProj.csproj" />
-        <mdtool dir="${src}/main/csharp/ExampleListenerProj" project="ExampleListenerProj.csproj" />
+        <xbuild dir="${src}/main/csharp/ExampleClientProj" project="ExampleClientProj.csproj" />
+        <xbuild dir="${src}/main/csharp/ExampleListenerProj" project="ExampleListenerProj.csproj" />
+	<copy todir="${bin}" >
+            <fileset dir="${src}/main/csharp/ExampleListenerProj/bin/${build.target}" >
+                <include name="*" />
+            </fileset>
+            <fileset dir="${src}/main/csharp/ExampleClientProj/bin/${build.target}" >
+                <include name="*" />
+            </fileset>
+        </copy>
     </target>
 
     <target name="build-csharp-with-dotnet" depends="generate-sources" if="USE.dotnet" >
@@ -257,7 +264,7 @@
         </junit>
     </target>
 
-    <target name="test-csharp" depends="build-csharp" if="BUILD.csharp" unless="build.skip.tests">
+    <target name="test-csharp" depends="build-csharp" if="USE.dotnet" unless="build.skip.tests">
          <nunit xmlout="${nunit-results}/NUnitResults.xml">
              <testassembly name="${src}/test/csharp/ExampleTestProj/bin/${build.target}/ExampleTestProj.dll" />
          </nunit>

Modified: incubator/etch/branches/singlestack/examples/helloworld/build.xml
URL: http://svn.apache.org/viewvc/incubator/etch/branches/singlestack/examples/helloworld/build.xml?rev=1149260&r1=1149259&r2=1149260&view=diff
==============================================================================
--- incubator/etch/branches/singlestack/examples/helloworld/build.xml (original)
+++ incubator/etch/branches/singlestack/examples/helloworld/build.xml Thu Jul 21 16:20:05 2011
@@ -60,9 +60,7 @@
     <condition property="USE.mono" >
         <and>
             <not><os family="windows" /></not>
-            <!-- TODO mono support is not fully baked, use -DUSE.mono to test -->
-            <!-- <available file="${env.MONO_HOME}/bin/mdtool" /> -->
-            <isset property="USE.mono" />
+            <available file="${build.mono.home}/bin/xbuild" />
         </and>
     </condition>
     <condition property="BUILD.csharp" >
@@ -71,6 +69,7 @@
             <isset property="USE.mono" />
         </or>
     </condition>
+	<property name="tool.xbuild" value="${build.mono.home}/bin/xbuild" />
 
     <!-- import etch task -->
     <taskdef onerror="report" resource="org/apache/etch/tools/ant/etch.xml" classpath="${etch.home}/lib/apache-etch-ant-plugin-${etch.longversion}.jar" />
@@ -85,15 +84,15 @@
         resource="org/apache/ant/dotnet/antlib.xml"
         classpath="${ant.dotnet.jar}" />
 
-    <macrodef name="mdtool" >
+    <macrodef name="xbuild">
         <attribute name="dir"         default="." />
         <attribute name="failonerror" default="false" />
-        <attribute name="project"     default="project.csproj" />
+        <attribute name="project"     default="" />
         <attribute name="target"      default="${build.target}" />
         <sequential>
-            <exec executable="${env.MONO_HOME}/bin/mdtool" dir="@{dir}" failonerror="@{failonerror}" >
-                <arg value="build" />
-                <arg value="--buildfile:@{project}" />
+            <exec executable="${tool.xbuild}" dir="@{dir}" failonerror="@{failonerror}" >
+                <arg value="/property:Configuration=@{target}" />
+                <arg value="@{project}" />
             </exec>
         </sequential>
     </macrodef>
@@ -188,8 +187,17 @@
     </target>
 
     <target name="build-csharp-with-mono" depends="generate-sources" if="USE.mono" >
-        <mdtool dir="${src}/main/csharp/HelloWorldClientProj" project="HelloWorldClientProj.csproj" />
-        <mdtool dir="${src}/main/csharp/HelloWorldListenerProj" project="HelloWorldListenerProj.csproj" />
+        <xbuild dir="${src}/main/csharp/HelloWorldClientProj" project="HelloWorldClientProj.csproj" />
+        <xbuild dir="${src}/main/csharp/HelloWorldListenerProj" project="HelloWorldListenerProj.csproj" />
+	<copy todir="${bin}" >
+            <fileset dir="${src}/main/csharp/HelloWorldListenerProj/bin/${build.target}" >
+                <include name="*" />
+            </fileset>
+            <fileset dir="${src}/main/csharp/HelloWorldClientProj/bin/${build.target}" >
+                <include name="*" />
+            </fileset>
+        </copy>
+
     </target>
 
     <target name="build-csharp-with-dotnet" depends="generate-sources" if="USE.dotnet" >
@@ -257,7 +265,7 @@
         </junit>
     </target>
 
-    <target name="test-csharp" depends="build-csharp" if="BUILD.csharp" unless="build.skip.tests">
+    <target name="test-csharp" depends="build-csharp" if="USE.dotnet" unless="build.skip.tests">
          <nunit xmlout="${nunit-results}/NUnitResults.xml">
              <testassembly name="${src}/test/csharp/HelloWorldTestProj/bin/${build.target}/HelloWorldTestProj.dll" />
          </nunit>

Modified: incubator/etch/branches/singlestack/examples/perf/build.xml
URL: http://svn.apache.org/viewvc/incubator/etch/branches/singlestack/examples/perf/build.xml?rev=1149260&r1=1149259&r2=1149260&view=diff
==============================================================================
--- incubator/etch/branches/singlestack/examples/perf/build.xml (original)
+++ incubator/etch/branches/singlestack/examples/perf/build.xml Thu Jul 21 16:20:05 2011
@@ -60,9 +60,7 @@
     <condition property="USE.mono" >
         <and>
             <not><os family="windows" /></not>
-            <!-- TODO mono support is not fully baked, use -DUSE.mono to test -->
-            <!-- <available file="${env.MONO_HOME}/bin/mdtool" /> -->
-            <isset property="USE.mono" />
+            <available file="${build.mono.home}/bin/xbuild" />
         </and>
     </condition>
     <condition property="BUILD.csharp" >
@@ -71,6 +69,7 @@
             <isset property="USE.mono" />
         </or>
     </condition>
+	<property name="tool.xbuild" value="${build.mono.home}/bin/xbuild" />
 
     <!-- import etch task -->
     <taskdef
@@ -88,15 +87,15 @@
         resource="org/apache/ant/dotnet/antlib.xml"
         classpath="${ant.dotnet.jar}" />
 
-    <macrodef name="mdtool" >
+    <macrodef name="xbuild">
         <attribute name="dir"         default="." />
         <attribute name="failonerror" default="false" />
-        <attribute name="project"     default="project.csproj" />
+        <attribute name="project"     default="" />
         <attribute name="target"      default="${build.target}" />
         <sequential>
-            <exec executable="${env.MONO_HOME}/bin/mdtool" dir="@{dir}" failonerror="@{failonerror}" >
-                <arg value="build" />
-                <arg value="--buildfile:@{project}" />
+            <exec executable="${tool.xbuild}" dir="@{dir}" failonerror="@{failonerror}" >
+                <arg value="/property:Configuration=@{target}" />
+                <arg value="@{project}" />
             </exec>
         </sequential>
     </macrodef>
@@ -188,8 +187,16 @@
     </target>
 
     <target name="build-csharp-with-mono" depends="generate-sources" if="USE.mono" >
-        <mdtool dir="${src}/main/csharp/PerfClientProj" project="PerfClientProj.csproj" />
-        <mdtool dir="${src}/main/csharp/PerfListenerProj" project="PerfListenerProj.csproj" />
+        <xbuild dir="${src}/main/csharp/PerfClientProj" project="PerfClientProj.csproj" />
+        <xbuild dir="${src}/main/csharp/PerfListenerProj" project="PerfListenerProj.csproj" />
+	<copy todir="${bin}" >
+            <fileset dir="${src}/main/csharp/PerfListenerProj/bin/${build.target}" >
+                <include name="*" />
+            </fileset>
+            <fileset dir="${src}/main/csharp/PerfClientProj/bin/${build.target}" >
+                <include name="*" />
+            </fileset>
+        </copy>
     </target>
 
     <target name="build-csharp-with-dotnet" depends="generate-sources" if="USE.dotnet" >
@@ -236,7 +243,7 @@
         </junit>
     </target>
 
-    <target name="test-csharp" depends="build-csharp" if="BUILD.csharp" >
+    <target name="test-csharp" depends="build-csharp" if="USE.dotnet" unless="build.skip.tests">
          <nunit xmlout="${nunit-results}/NUnitResults.xml">
              <testassembly name="${src}/test/csharp/PerfTestProj/bin/${build.target}/PerfTestProj.dll" />
          </nunit>

Modified: incubator/etch/branches/singlestack/scripts/antsetup.sh
URL: http://svn.apache.org/viewvc/incubator/etch/branches/singlestack/scripts/antsetup.sh?rev=1149260&r1=1149259&r2=1149260&view=diff
==============================================================================
    (empty)

Propchange: incubator/etch/branches/singlestack/scripts/antsetup.sh
------------------------------------------------------------------------------
    svn:executable = *

Modified: incubator/etch/branches/singlestack/tests/build.xml
URL: http://svn.apache.org/viewvc/incubator/etch/branches/singlestack/tests/build.xml?rev=1149260&r1=1149259&r2=1149260&view=diff
==============================================================================
--- incubator/etch/branches/singlestack/tests/build.xml (original)
+++ incubator/etch/branches/singlestack/tests/build.xml Thu Jul 21 16:20:05 2011
@@ -175,7 +175,7 @@
         <echo message="TODO: build w/ mono" />
     </target>
 
-    <target name="test-csharp" depends="build-csharp" if="BUILD.csharp" >
+    <target name="test-csharp" depends="build-csharp" if="USE.dotnet" >
         <mkdir dir="${nunit-results}" />
 
         <nunit xmlout="${nunit-results}/NUnitResults.xml">