X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2FMicrosoft.Build.Tasks%2FMicrosoft.Build.Tasks%2FAL.cs;h=9b94e3798c13b3330d3314b811577d5fbfbf1aff;hb=693f414010d0a27165d4bef8d939940ff65cbb58;hp=b063aaf5e41d9a510bdaf20dc1d80d843f17be0b;hpb=7015b812166d0992223b5dc4421deab637500265;p=mono.git diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/AL.cs b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/AL.cs index b063aaf5e41..9b94e3798c1 100644 --- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/AL.cs +++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/AL.cs @@ -25,7 +25,6 @@ // 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.Diagnostics; @@ -37,8 +36,6 @@ using Mono.XBuild.Utilities; namespace Microsoft.Build.Tasks { public class AL : ToolTaskExtension { - Process alProcess; - public AL () { } @@ -51,23 +48,33 @@ namespace Microsoft.Build.Tasks { commandLine.AppendSwitchIfNotNull ("/baseaddress:", BaseAddress); commandLine.AppendSwitchIfNotNull ("/company:", CompanyName); commandLine.AppendSwitchIfNotNull ("/configuration:", Configuration); - commandLine.AppendSwitchIfNotNull ("/copyright:", Copyright); commandLine.AppendSwitchIfNotNull ("/culture:", Culture); - if (DelaySign == true) - commandLine.AppendSwitch ("/delaysign"); - if (EmbedResources != null) - foreach (ITaskItem item in EmbedResources) - commandLine.AppendSwitchIfNotNull ("/embedresource:", item.ItemSpec); + commandLine.AppendSwitchIfNotNull ("/copyright:", Copyright); + if (Bag ["DelaySign"] != null) + if (DelaySign) + commandLine.AppendSwitch ("/delaysign+"); + else + commandLine.AppendSwitch ("/delaysign-"); + commandLine.AppendSwitchIfNotNull ("/description:", Description); + if (EmbedResources != null) { + foreach (ITaskItem item in EmbedResources) { + string logical_name = item.GetMetadata ("LogicalName"); + if (!string.IsNullOrEmpty (logical_name)) + 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); - if (GenerateFullPaths == true) + if (GenerateFullPaths) commandLine.AppendSwitch ("/fullpaths"); commandLine.AppendSwitchIfNotNull ("/keyname:", KeyContainer); commandLine.AppendSwitchIfNotNull ("/keyfile:", KeyFile); if (LinkResources != null) foreach (ITaskItem item in LinkResources) - commandLine.AppendSwitchIfNotNull ("/linkresource:", item.ItemSpec); + commandLine.AppendSwitchIfNotNull ("/link:", item.ItemSpec); commandLine.AppendSwitchIfNotNull ("/main:", MainEntryPoint); if (OutputAssembly != null) commandLine.AppendSwitchIfNotNull ("/out:", OutputAssembly.ItemSpec); @@ -91,20 +98,14 @@ namespace Microsoft.Build.Tasks { public override bool Execute () { - CommandLineBuilderExtension clbe = new CommandLineBuilderExtension (); - AddResponseFileCommands (clbe); - - alProcess = new Process (); - alProcess.StartInfo.Arguments = clbe.ToString (); - alProcess.StartInfo.FileName = GenerateFullPathToTool (); - alProcess.Start (); - alProcess.WaitForExit (); - return true; + return base.Execute (); } protected override string GenerateFullPathToTool () { - return Path.Combine (ToolPath, ToolName); + if (!string.IsNullOrEmpty (ToolPath)) + return Path.Combine (ToolPath, ToolExe); + return ToolLocationHelper.GetPathToDotNetFrameworkFile (ToolExe, TargetDotNetFrameworkVersion.VersionLatest); } public string AlgorithmId { @@ -240,9 +241,7 @@ namespace Microsoft.Build.Tasks { } protected override string ToolName { - get { - return "al"; - } + get { return "al.exe"; } } public string Trademark { @@ -267,4 +266,3 @@ namespace Microsoft.Build.Tasks { } } -#endif \ No newline at end of file