Skip to content

Commit

Permalink
Address feedback by @nguerrera
Browse files Browse the repository at this point in the history
  • Loading branch information
swaroop-sridhar committed Apr 18, 2019
1 parent 1cc9352 commit 9246cad
Showing 2 changed files with 16 additions and 18 deletions.
14 changes: 7 additions & 7 deletions src/Tasks/Microsoft.NET.Build.Tasks/GenerateBundle.cs
Original file line number Diff line number Diff line change
@@ -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,22 +15,21 @@ 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]
public bool ShowDisgnosticOutput { get; set; }

protected override void ExecuteCore()
{
Bundler bundler = new Bundler(AppHostName, OutputDir, EmbedPDBs, ShowDisgnosticOutput);
var bundler = new Bundler(AppHostName, OutputDir, IncludeSymbols, ShowDisgnosticOutput);
var fileSpec = new List<FileSpec>(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);
}
Original file line number Diff line number Diff line change
@@ -137,7 +137,7 @@ Copyright (c) .NET Foundation. All rights reserved.
Outputs="@(_ResolvedFileToPublishPreserveNewest->'$(PublishDir)%(RelativePath)')">

<ItemGroup>
<_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.
-->
<Copy SourceFiles = "@(_ResolvedUnBundledFileToPublishPreserveNewest)"
DestinationFiles="@(_ResolvedUnBundledFileToPublishPreserveNewest->'$(PublishDir)%(RelativePath)')"
<Copy SourceFiles = "@(_ResolvedUnbundledFileToPublishPreserveNewest)"
DestinationFiles="@(_ResolvedUnbundledFileToPublishPreserveNewest->'$(PublishDir)%(RelativePath)')"
OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
Retries="$(CopyRetryCount)"
RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
@@ -173,7 +173,7 @@ Copyright (c) .NET Foundation. All rights reserved.
DependsOnTargets="_ComputeResolvedFilesToPublishTypes">

<ItemGroup>
<_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.
-->
<Copy SourceFiles = "@(_ResolvedUnBundledFileToPublishAlways)"
DestinationFiles="@(_ResolvedUnBundledFileToPublishAlways->'$(PublishDir)%(RelativePath)')"
<Copy SourceFiles = "@(_ResolvedUnbundledFileToPublishAlways)"
DestinationFiles="@(_ResolvedUnbundledFileToPublishAlways->'$(PublishDir)%(RelativePath)')"
OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
Retries="$(CopyRetryCount)"
RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
@@ -766,17 +766,15 @@ Copyright (c) .NET Foundation. All rights reserved.
Condition="'$(PublishSingleFile)' == 'true'"
DependsOnTargets="_ComputeFilesToBundle"
Inputs="@(_FilesToBundle)"
Outputs="$(PublishDir)\$(AssemblyName)$(_NativeExecutableExtension)">
Outputs="$(PublishDir)$(AssemblyName)$(_NativeExecutableExtension)">

<PropertyGroup>
<!-- Handle the case where IncludeSymbolsInSingleFile may not be defined -->
<EmbedPDBs Condition="'$(IncludeSymbolsInSingleFile)' == 'true'">true</EmbedPDBs>
<EmbedPDBs Condition="'$(IncludeSymbolsInSingleFile)' != 'true'">false</EmbedPDBs>
<IncludeSymbolsInSingleFile Condition="'$(IncludeSymbolsInSingleFile)' == ''">false</IncludeSymbolsInSingleFile>
</PropertyGroup>

<GenerateBundle FilesToBundle="@(_FilesToBundle)"
AppHostName="$(AssemblyName)$(_NativeExecutableExtension)"
EmbedPDBs="$(EmbedPDBs)"
IncludeSymbols="$(IncludeSymbolsInSingleFile)"
OutputDir="$(PublishDir)"
ShowDisgnosticOutput="false"/>

0 comments on commit 9246cad

Please sign in to comment.