New test.
[mono.git] / mcs / class / Microsoft.Build.Tasks / Microsoft.Build.Tasks / ManagedCompiler.cs
index f8184a6dd42c0cfdd749f6b18a190a3aff3ae3da..f2c11375b71ddff95653b4199b7988161f7a6eb9 100644 (file)
@@ -28,6 +28,7 @@
 #if NET_2_0
 
 using System;
+using System.Collections;
 using System.IO;
 using System.Text;
 using Microsoft.Build.Framework;
@@ -39,11 +40,13 @@ namespace Microsoft.Build.Tasks {
                {
                }
 
+               [MonoTODO]
                protected internal override void AddCommandLineCommands (
                                                 CommandLineBuilderExtension commandLine)
                {
                }
 
+               [MonoTODO]
                protected internal override void AddResponseFileCommands (
                                                 CommandLineBuilderExtension commandLine)
                {
@@ -91,13 +94,15 @@ namespace Microsoft.Build.Tasks {
                                                commandLine.AppendFileNameIfNotNull (item.ItemSpec);
                                }
                        }
-                       commandLine.AppendSwitchIfNotNull ("/target:", TargetType);
+                       if (TargetType != null)
+                               commandLine.AppendSwitchIfNotNull ("/target:", TargetType);
                        if (TreatWarningsAsErrors)
                                commandLine.AppendSwitch ("/warnaserror");
                        commandLine.AppendSwitchIfNotNull ("/win32icon:", Win32Icon);
                        commandLine.AppendSwitchIfNotNull ("/win32res:", Win32Resource);
                }
 
+               [MonoTODO]
                protected bool CheckAllReferencesExistOnDisk ()
                {
                        foreach (ITaskItem item in (ITaskItem[])Bag ["References"]) 
@@ -106,11 +111,13 @@ namespace Microsoft.Build.Tasks {
                        return true;
                }
 
+               [MonoTODO]
                protected void CheckHostObjectSupport (string parameterName,
                                                       bool resultFromHostObjectSetOperation)
                {
                }
                
+               [MonoTODO]
                protected override bool HandleTaskExecutionErrors ()
                {
                        return true;
@@ -120,9 +127,19 @@ namespace Microsoft.Build.Tasks {
                protected bool ListHasNoDuplicateItems (ITaskItem[] itemList,
                                                        string parameterName)
                {
+                       Hashtable items = new Hashtable ();
+                       
+                       foreach (ITaskItem item in itemList) {
+                               if (items.Contains (item.ItemSpec))
+                                       items.Add (item.ItemSpec, null);
+                               else
+                                       return false;
+                       }
+                       
                        return true;
                }
 
+               [MonoTODO]
                protected override bool ValidateParameters ()
                {
                        return true;
@@ -238,8 +255,11 @@ namespace Microsoft.Build.Tasks {
                        get { return Console.Error.Encoding; }
                }
 
+               // FIXME: hack to get build of hello world working
                public string TargetType {
-                       get { return (string) Bag ["TargetType"]; }
+                       get {
+                               return  (Bag.Contains ("TargetType")) ? (((string) Bag ["TargetType"]).ToLower ()) : null;
+                       }
                        set { Bag ["TargetType"] = value; }
                }