From 9246cad2cbf59586a65b816135049704297ebf6d Mon Sep 17 00:00:00 2001 From: Swaroop Sridhar Date: Thu, 18 Apr 2019 16:03:33 -0700 Subject: [PATCH] Address feedback by @nguerrera --- .../GenerateBundle.cs | 14 ++++++------- .../targets/Microsoft.NET.Publish.targets | 20 +++++++++---------- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/GenerateBundle.cs b/src/Tasks/Microsoft.NET.Build.Tasks/GenerateBundle.cs index f882f744002d..c86dab9cb334 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/GenerateBundle.cs +++ b/src/Tasks/Microsoft.NET.Build.Tasks/GenerateBundle.cs @@ -3,6 +3,7 @@ using Microsoft.Build.Framework; using Microsoft.NET.HostModel.Bundle; +using System; using System.Collections.Generic; namespace Microsoft.NET.Build.Tasks @@ -14,7 +15,7 @@ public class GenerateBundle : TaskBase [Required] public string AppHostName { get; set; } [Required] - public bool EmbedPDBs { get; set; } + public bool IncludeSymbols { get; set; } [Required] public string OutputDir { get; set; } [Required] @@ -22,14 +23,13 @@ public class GenerateBundle : TaskBase protected override void ExecuteCore() { - Bundler bundler = new Bundler(AppHostName, OutputDir, EmbedPDBs, ShowDisgnosticOutput); + var bundler = new Bundler(AppHostName, OutputDir, IncludeSymbols, ShowDisgnosticOutput); var fileSpec = new List(FilesToBundle.Length); - foreach(var item in FilesToBundle) - { - fileSpec.Add(new FileSpec(sourcePath: item.ItemSpec, - bundleRelativePath: item.GetMetadata("RelativePath"))); - } + Array.ForEach(FilesToBundle, + item => fileSpec.Add( + new FileSpec(sourcePath: item.ItemSpec, + bundleRelativePath: item.GetMetadata(MetadataKeys.RelativePath)))); bundler.GenerateBundle(fileSpec); } diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Publish.targets b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Publish.targets index 8973aa6d28d4..2dd5b88ece70 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Publish.targets +++ b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Publish.targets @@ -137,7 +137,7 @@ Copyright (c) .NET Foundation. All rights reserved. Outputs="@(_ResolvedFileToPublishPreserveNewest->'$(PublishDir)%(RelativePath)')"> - <_ResolvedUnBundledFileToPublishPreserveNewest + <_ResolvedUnbundledFileToPublishPreserveNewest Include="@(_ResolvedFileToPublishPreserveNewest)" Condition="'$(PublishSingleFile)' != 'true' or '%(_ResolvedFileToPublishPreserveNewest.ExcludeFromSingleFile)'=='true'" /> @@ -147,8 +147,8 @@ Copyright (c) .NET Foundation. All rights reserved. Not using SkipUnchangedFiles="true" because the application may want to change one of these files and not have an incremental build replace it. --> - - <_ResolvedUnBundledFileToPublishAlways + <_ResolvedUnbundledFileToPublishAlways Include="@(_ResolvedFileToPublishAlways)" Condition="'$(PublishSingleFile)' != 'true' or '%(_ResolvedFileToPublishAlways.ExcludeFromSingleFile)'=='true'" /> @@ -183,8 +183,8 @@ Copyright (c) .NET Foundation. All rights reserved. Not using SkipUnchangedFiles="true" because the application may want to change one of these files and not have an incremental build replace it. --> - + Outputs="$(PublishDir)$(AssemblyName)$(_NativeExecutableExtension)"> - - true - false + false