Merge pull request #631 from kebby/master
[mono.git] / mcs / class / Microsoft.Build.Tasks / Microsoft.Build.Tasks / ManagedCompiler.cs
index cd3f66eb7773dbe37710bf17cde26044d9d7f215..461f2f6c648c641961b33bde4cb3fdc0ea8a6d4a 100644 (file)
@@ -92,8 +92,14 @@ namespace Microsoft.Build.Tasks {
                                commandLine.AppendSwitchIfNotNull ("/out:", OutputAssembly.ItemSpec);
                        
                        if (Resources != null)
-                               foreach (ITaskItem item in Resources)
+                               foreach (ITaskItem item in Resources) {
+                                       string logical_name = item.GetMetadata ("LogicalName");
+                                       if (logical_name.Length > 0)
+                                               commandLine.AppendSwitchIfNotNull ("/resource:",
+                                                               String.Format ("{0},{1}", item.ItemSpec, logical_name));
+                                       else
                                                commandLine.AppendSwitchIfNotNull ("/resource:", item.ItemSpec);
+                               }
 
                        if (Sources != null)
                                foreach (ITaskItem item in Sources)
@@ -128,7 +134,10 @@ namespace Microsoft.Build.Tasks {
                [MonoTODO]
                protected override bool HandleTaskExecutionErrors ()
                {
-                       return true;
+                       if (!Log.HasLoggedErrors && ExitCode != 0)
+                               Log.LogError ("Compiler crashed with code: {0}.", ExitCode);
+
+                       return ExitCode == 0 && !Log.HasLoggedErrors;
                }
                
                [MonoTODO]
@@ -271,7 +280,7 @@ namespace Microsoft.Build.Tasks {
                        get {
                                if (Bag.Contains ("TargetType")) {
                                        string s = (string) Bag ["TargetType"];
-                                       return s.ToLower ();
+                                       return s.ToLowerInvariant ();
                                } else
                                        return null;
                        }