From 12ffd389cdaf0ccdd382b94dc99bdc593792687a Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Thu, 11 Jun 2009 21:13:30 +0000 Subject: [PATCH] * Utilities.cs: New. * AL.cs, AspNetCompiler.cs, Csc.cs, SGen.cs, Vbc.cs (ToolName): Append ".bat" when running on windows. svn path=/trunk/mcs/; revision=135952 --- .../Microsoft.Build.Tasks.dll.sources | 1 + .../Microsoft.Build.Tasks/AL.cs | 2 +- .../Microsoft.Build.Tasks/AspNetCompiler.cs | 4 +- .../Microsoft.Build.Tasks/ChangeLog | 7 +++ .../Microsoft.Build.Tasks/Csc.cs | 4 +- .../Microsoft.Build.Tasks/SGen.cs | 2 +- .../Microsoft.Build.Tasks/Utilities.cs | 49 +++++++++++++++++++ .../Microsoft.Build.Tasks/Vbc.cs | 2 +- 8 files changed, 65 insertions(+), 6 deletions(-) create mode 100644 mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Utilities.cs diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks.dll.sources b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks.dll.sources index cf08524adb1..904e29baf9c 100644 --- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks.dll.sources +++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks.dll.sources @@ -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 diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/AL.cs b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/AL.cs index 9a2e7d9d7f2..56925f48961 100644 --- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/AL.cs +++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/AL.cs @@ -237,7 +237,7 @@ namespace Microsoft.Build.Tasks { protected override string ToolName { get { - return "al"; + return Utilities.RunningOnWindows ? "al.bat" : "al"; } } diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/AspNetCompiler.cs b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/AspNetCompiler.cs index 9a1b36bd264..9f4da84bda7 100644 --- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/AspNetCompiler.cs +++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/AspNetCompiler.cs @@ -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 diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/ChangeLog b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/ChangeLog index 6f79085618e..f21a4fe1a63 100644 --- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/ChangeLog +++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/ChangeLog @@ -1,3 +1,10 @@ +2009-06-12 Ankit Jain + + * 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 * MSBuild.cs (Execute): Copy metadata from the @Projects items diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Csc.cs b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Csc.cs index cd2d8241fb1..4afdea54680 100644 --- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Csc.cs +++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Csc.cs @@ -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 { diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/SGen.cs b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/SGen.cs index a147cf6dac6..394e897c4d3 100644 --- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/SGen.cs +++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/SGen.cs @@ -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 index 00000000000..e9a5ac5915e --- /dev/null +++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Utilities.cs @@ -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 diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Vbc.cs b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Vbc.cs index 60f6790b3da..d6584618a79 100644 --- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Vbc.cs +++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Vbc.cs @@ -258,7 +258,7 @@ namespace Microsoft.Build.Tasks { [MonoTODO] protected override string ToolName { - get { return "vbnc"; } + get { return Utilities.RunningOnWindows ? "vbnc.bat" : "vbnc"; } } [MonoTODO] -- 2.25.1