New test.
[mono.git] / mcs / class / Microsoft.Build.Tasks / Microsoft.Build.Tasks / Csc.cs
index 6a3f20c3b7736d8e9f497a37b933a6bb1ca96b6a..2b334d88d811a4a3bcd1adf93cf78782a65455b8 100644 (file)
@@ -25,6 +25,8 @@
 // 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;
@@ -38,104 +40,43 @@ namespace Microsoft.Build.Tasks {
                {
                }
 
-               // FIXME: move some commands to managedcompiler
+               [MonoTODO]
                protected internal override void AddResponseFileCommands (CommandLineBuilderExtension commandLine)
                {
                        base.AddResponseFileCommands (commandLine);
                        
-                       commandLine.AppendSwitchIfNotNull ("/lib:", AdditionalLibPaths, ",");
-                       commandLine.AppendSwitchIfNotNull ("/addmodule:", AddModules, ",");
                        if (AllowUnsafeBlocks == true)
                                commandLine.AppendSwitch ("/unsafe");
                        //baseAddress
                        //checkForOverflowUnderflow
-                       //commandLine.AppendSwitchIfNotNull ("/codepage:", CodePage.ToString ());
-                       //debugType
-                       commandLine.AppendSwitchIfNotNull ("/define:", DefineConstants);
-                       //delaySign
                        commandLine.AppendSwitchIfNotNull ("/nowarn:", DisabledWarnings);
                        commandLine.AppendSwitchIfNotNull ("/doc:", DocumentationFile);
-                       if (EmitDebugInformation)
-                               commandLine.AppendSwitch ("/debug");
                        //errorReport
-                       //fileAlignment
-                       commandLine.AppendSwitchIfNotNull ("/keycontainer:", KeyContainer);
-                       commandLine.AppendSwitchIfNotNull ("/keyfile:", KeyFile);
                        commandLine.AppendSwitchIfNotNull ("/langversion:", LangVersion);
-                       // FIXME: add ids from metadata
-                       if (LinkResources != null) {
-                               foreach (ITaskItem item in LinkResources) {
-                                       if (GenerateFullPaths)
-                                               commandLine.AppendSwitchIfNotNull ("/linkresource:", item.GetMetadata ("FullPath"));
-                                       else
-                                               commandLine.AppendSwitchIfNotNull ("/linkresource:", item.ItemSpec);
-                               }
-                       }
-                       commandLine.AppendSwitchIfNotNull ("/main:", MainEntryPoint);
                        //moduleAssemblyName
-                       if (NoConfig)
-                               commandLine.AppendSwitch ("/noconfig");
                        if (NoStandardLib)
                                commandLine.AppendSwitch ("/nostdlib");
-                       if (Optimize)
-                               commandLine.AppendSwitch ("/optimize");
-                       commandLine.AppendSwitchIfNotNull ("/out:", OutputAssembly.ItemSpec);
                        //platform
-                       if (References != null) {
-                               foreach (ITaskItem item in References) {
-                                       commandLine.AppendSwitchIfNotNull ("/reference:", item.ItemSpec);
-                               }
-                       }
-                       if (Resources != null) {
-                               foreach (ITaskItem item in Resources) {
-                                       if (GenerateFullPaths)
-                                               commandLine.AppendSwitchIfNotNull ("/resource:", item.GetMetadata ("FullPath"));
-                                       else
-                                               commandLine.AppendSwitchIfNotNull ("/resource:", item.ItemSpec);
-                               }
-                       }
-                       if (ResponseFiles != null) {
-                               foreach (ITaskItem item in ResponseFiles) {
-                                       if (GenerateFullPaths)
-                                               commandLine.AppendFileNameIfNotNull (String.Format ("@{0}",item.GetMetadata ("FullPath")));
-                                       else
-                                               commandLine.AppendFileNameIfNotNull (String.Format ("@{0}",item.ItemSpec));
-                               }
-                       }
-                       if (Sources != null) {
-                               foreach (ITaskItem item in Sources) {
-                                       if (GenerateFullPaths)
-                                               commandLine.AppendFileNameIfNotNull (item.GetMetadata ("FullPath"));
-                                       else
-                                               commandLine.AppendFileNameIfNotNull (item.ItemSpec);
-                               }
-                       }
-                       commandLine.AppendSwitchIfNotNull ("/target:", TargetType);
-                       if (TreatWarningsAsErrors)
-                               commandLine.AppendSwitch ("/warnaserror");
                        commandLine.AppendSwitchIfNotNull ("/warn:", WarningLevel.ToString ());
                        //warningsAsErrors
                        //warningNotAsErrors
-                       commandLine.AppendSwitchIfNotNull ("/win32icon:", Win32Icon);
-                       commandLine.AppendSwitchIfNotNull ("/win32res:", Win32Resource);
                }
 
+               [MonoTODO]
                protected override bool CallHostObjectToExecute ()
                {
-                       return true;
+                       throw new NotImplementedException ();
                }
 
                protected override string GenerateFullPathToTool ()
                {
-                       return "/usr/local/bin/mcs";
+                       return Path.Combine (ToolPath, ToolName);
                }
 
-               protected override bool InitializeHostObject (out bool appropriateHostObjectExists,
-                                                             out bool continueBuild)
+               [MonoTODO]
+               protected override HostObjectInitializationStatus InitializeHostObject ()
                {
-                       appropriateHostObjectExists = true;
-                       continueBuild = true;
-                       return true;
+                       return HostObjectInitializationStatus.NoActionReturnSuccess;
                }
 
                public bool AllowUnsafeBlocks {
@@ -148,9 +89,9 @@ namespace Microsoft.Build.Tasks {
                        set { Bag ["BaseAddress"] = value; }
                }
 
-               public bool CheckForOverflowUnderFlow {
-                       get { return GetBoolParameterWithDefault ("CheckForOverflowUnderFlow", false); }
-                       set { Bag ["CheckForOverflowUnderFlow"] = value; }
+               public bool CheckForOverflowUnderflow {
+                       get { return GetBoolParameterWithDefault ("CheckForOverflowUnderflow", false); }
+                       set { Bag ["CheckForOverflowUnderflow"] = value; }
                }
 
                public string DisabledWarnings {
@@ -187,6 +128,11 @@ namespace Microsoft.Build.Tasks {
                        get { return GetBoolParameterWithDefault ("NoStandardLib", false); }
                        set { Bag ["NoStandardLib"] = value; }
                }
+               
+               public string PdbFile {
+                       get { return (string) Bag ["PdbFile"]; }
+                       set { Bag ["PdbFile"] = value; }
+               }
 
                public string Platform {
                        get { return (string) Bag ["Platform"]; }
@@ -194,7 +140,7 @@ namespace Microsoft.Build.Tasks {
                }
 
                protected override string ToolName {
-                       get { return "mcs"; }
+                       get { return "gmcs"; }
                }
 
                public bool UseHostCompilerIfAvailable {
@@ -218,3 +164,5 @@ namespace Microsoft.Build.Tasks {
                }
        }
 }
+
+#endif