else
commandLine.AppendSwitch ("/delaysign-");
commandLine.AppendSwitchIfNotNull ("/description:", Description);
- if (EmbedResources != null)
- foreach (ITaskItem item in EmbedResources)
- commandLine.AppendSwitchIfNotNull ("/embed:", item.ItemSpec);
+ if (EmbedResources != null) {
+ foreach (ITaskItem item in EmbedResources) {
+ string logical_name = item.GetMetadata ("LogicalName");
+ if (logical_name.Length > 0)
+ commandLine.AppendSwitchIfNotNull ("/embed:", string.Format ("{0},{1}", item.ItemSpec, logical_name));
+ else
+ commandLine.AppendSwitchIfNotNull ("/embed:", item.ItemSpec);
+ }
+ }
commandLine.AppendSwitchIfNotNull ("/evidence:", EvidenceFile);
commandLine.AppendSwitchIfNotNull ("/fileversion:", FileVersion);
commandLine.AppendSwitchIfNotNull ("/flags:", Flags);
using System;
using System.Collections;
+using System.Collections.Generic;
using Microsoft.Build.BuildEngine;
using Microsoft.Build.Framework;
using Microsoft.Build.Tasks;
Assert.AreEqual ("/embed:a /embed:b", clbe.ToString (), "A1");
}
+ [Test]
+ public void TestEmbedResourcesWithLogicalName ()
+ {
+ ALExtended ale = new ALExtended ();
+ CommandLineBuilderExtension clbe = new CommandLineBuilderExtension ();
+ var dict = new Dictionary<string, string> ();
+ dict ["LogicalName"] = "value";
+
+ ale.EmbedResources = new ITaskItem [2] { new TaskItem ("a", dict), new TaskItem ("b", dict) };
+ ale.ARFC (clbe);
+
+ Assert.AreEqual ("/embed:a,value /embed:b,value", clbe.ToString (), "A1");
+ }
+
[Test]
public void TestEvidenceFile ()
{