* Utilities.cs: New.
authorAnkit Jain <radical@corewars.org>
Thu, 11 Jun 2009 21:13:30 +0000 (21:13 -0000)
committerAnkit Jain <radical@corewars.org>
Thu, 11 Jun 2009 21:13:30 +0000 (21:13 -0000)
* AL.cs, AspNetCompiler.cs, Csc.cs,
SGen.cs, Vbc.cs (ToolName): Append ".bat" when running
on windows.

svn path=/trunk/mcs/; revision=135952

mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks.dll.sources
mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/AL.cs
mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/AspNetCompiler.cs
mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/ChangeLog
mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Csc.cs
mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/SGen.cs
mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Utilities.cs [new file with mode: 0644]
mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Vbc.cs

index cf08524adb128ca7afc2915dd42aa18020002d06..904e29baf9c0452cc8ac003e573ab70a8c0d6e50 100644 (file)
@@ -100,6 +100,7 @@ Microsoft.Build.Tasks/ToolTaskExtension.cs
 Microsoft.Build.Tasks/Touch.cs
 Microsoft.Build.Tasks/UnregisterAssembly.cs
 Microsoft.Build.Tasks/UpdateManifest.cs
+Microsoft.Build.Tasks/Utilities.cs
 Microsoft.Build.Tasks/Vbc.cs
 Microsoft.Build.Tasks/VCBuild.cs
 Microsoft.Build.Tasks/Warning.cs
index 9a2e7d9d7f2ba738eee62a6839583f4b9f3243b2..56925f489610681b7d1f7ac8ee6723da6eadc6ff 100644 (file)
@@ -237,7 +237,7 @@ namespace Microsoft.Build.Tasks {
 
                protected override string ToolName {
                        get {
-                               return "al";
+                               return Utilities.RunningOnWindows ? "al.bat" : "al";
                        }
                }
 
index 9a1b36bd264b2a1cd3c274915c4c38c9504267ab..9f4da84bda76e7d9165c0997f5863ec00ef3c577 100644 (file)
@@ -142,9 +142,9 @@ namespace Microsoft.Build.Tasks {
                }
                
                protected override string ToolName {
-                       get { return "aspnet_compiler"; }
+                       get { return Utilities.RunningOnWindows ? "aspnet_compiler.bat" : "aspnet_compiler"; }
                }
        }
 }
 
-#endif
\ No newline at end of file
+#endif
index 6f79085618e6b958e5a8f5f4738b7d5f497242a5..f21a4fe1a63b102c7d0239df46561a6eed2b2e39 100644 (file)
@@ -1,3 +1,10 @@
+2009-06-12  Ankit Jain  <jankit@novell.com>
+
+       * Utilities.cs: New.
+       * AL.cs, AspNetCompiler.cs, Csc.cs,
+       SGen.cs, Vbc.cs (ToolName): Append ".bat" when running
+       on windows.
+
 2009-06-09  Ankit Jain  <jankit@novell.com>
 
        * MSBuild.cs (Execute): Copy metadata from the @Projects items
index cd2d8241fb1c65f3c5d57c0f85dd704357342c1d..4afdea546807eaae5f7118ecb2481f98fa6c102a 100644 (file)
@@ -186,7 +186,9 @@ namespace Microsoft.Build.Tasks {
                }
 
                protected override string ToolName {
-                       get { return "gmcs"; }
+                       get {
+                               return Utilities.RunningOnWindows ? "gmcs.bat" : "gmcs";
+                       }
                }
 
                public bool UseHostCompilerIfAvailable {
index a147cf6dac632e5c9a1052a916bd6c1c297d24df..394e897c4d3ebb96696eb0a775e78218976dff8b 100644 (file)
@@ -115,7 +115,7 @@ namespace Microsoft.Build.Tasks {
 
                [MonoTODO]
                protected override string ToolName {
-                       get { return "sgen"; }
+                       get { return Utilities.RunningOnWindows ? "sgen.bat" : "sgen"; }
                }
 
                [MonoTODO]
diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Utilities.cs b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Utilities.cs
new file mode 100644 (file)
index 0000000..e9a5ac5
--- /dev/null
@@ -0,0 +1,49 @@
+//
+// Utilities.cs:
+//
+// Author:
+//     Ankit Jain (jankit@novell.com)
+//
+// Copyright (c) 2009 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+#if NET_2_0
+
+using System;
+
+namespace Microsoft.Build.Tasks {
+       internal static class Utilities {
+
+               public static bool RunningOnWindows {
+                       get {
+                               // Code from Mono.GetOptions/Options.cs
+                               // check for non-Unix platforms - see FAQ for more details
+                               // http://www.mono-project.com/FAQ:_Technical#How_to_detect_the_execution_platform_.3F
+                               int platform = (int) Environment.OSVersion.Platform;
+                               return ((platform != 4) && (platform != 128));
+                       }
+
+               }
+       }
+
+}
+
+#endif
index 60f6790b3da1fe28d2b0c78178367ceabe5e7103..d6584618a795a0b6fcafb23b95dc5ce0be41e10c 100644 (file)
@@ -258,7 +258,7 @@ namespace Microsoft.Build.Tasks {
 
                [MonoTODO]
                protected override string ToolName {
-                       get { return "vbnc"; }
+                       get { return Utilities.RunningOnWindows ? "vbnc.bat" : "vbnc"; }
                }
 
                [MonoTODO]