// 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;
using System.IO;
using Microsoft.Build.Framework;
protected internal override void AddResponseFileCommands (CommandLineBuilderExtension commandLine)
{
-#if !NET_4_0
- //pre-MSBuild 2 targets don't support multi-targeting, so tell compiler to use 2.0 corlib
- commandLine.AppendSwitch ("/sdk:2");
-#endif
base.AddResponseFileCommands (commandLine);
if (AdditionalLibPaths != null && AdditionalLibPaths.Length > 0)
//
if (References != null)
foreach (ITaskItem item in References) {
- string aliases = item.GetMetadata ("Aliases") ?? String.Empty;
- aliases = aliases.Trim ();
- if (aliases.Length > 0)
- commandLine.AppendSwitchIfNotNull ("/reference:" + aliases + "=", item.ItemSpec);
- else
+ string aliases = item.GetMetadata ("Aliases");
+ if (!string.IsNullOrEmpty (aliases)) {
+ AddAliasesReference (commandLine, aliases, item.ItemSpec);
+ } else {
commandLine.AppendSwitchIfNotNull ("/reference:", item.ItemSpec);
+ }
}
if (ResponseFiles != null)
commandLine.AppendSwitchIfNotNull ("/win32res:", Win32Resource);
}
+ static void AddAliasesReference (CommandLineBuilderExtension commandLine, string aliases, string reference)
+ {
+ foreach (var alias in aliases.Split (',')) {
+ var a = alias.Trim ();
+ if (a.Length == null)
+ continue;
+
+ var r = "/reference:";
+ if (!string.Equals (a, "global", StringComparison.OrdinalIgnoreCase))
+ r += a + "=";
+
+ commandLine.AppendSwitchIfNotNull (r, reference);
+ }
+ }
+
[MonoTODO]
protected override bool CallHostObjectToExecute ()
{
{
if (!string.IsNullOrEmpty (ToolPath))
return Path.Combine (ToolPath, ToolExe);
- return ToolLocationHelper.GetPathToDotNetFrameworkFile (ToolExe, TargetDotNetFrameworkVersion.VersionLatest);
+ var possibleToolPath = ToolLocationHelper.GetPathToDotNetFrameworkFile (ToolExe, TargetDotNetFrameworkVersion.VersionLatest);
+ if (!string.IsNullOrEmpty(possibleToolPath))
+ return possibleToolPath;
+
+ return ToolLocationHelper.GetPathToDotNetFrameworkBinFile(ToolExe);
}
[MonoTODO]
protected override string ToolName {
get {
- return "mcs.exe";
+ return MSBuildUtils.RunningOnWindows ? "csc.bat" : "csc.exe";
}
}
}
}
-#endif