Skip to content

Commit b1754cc

Browse files
authored
Remove duplicate package Icon (#5818)
We were double-including the package icon after we started including @(None) items in the package. Remove the redundant item and use the same property as CSProj pack target for specifying the Icon.
1 parent 57ebbb1 commit b1754cc

File tree

4 files changed

+3
-10
lines changed

4 files changed

+3
-10
lines changed

src/Microsoft.DotNet.Build.Tasks.Packaging/src/GenerateNuSpec.cs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ private Manifest CreateManifest()
205205
}
206206
if (!string.IsNullOrEmpty(Icon))
207207
{
208-
manifestMetadata.Icon = Path.GetFileName(Icon);
208+
manifestMetadata.Icon = Icon;
209209
}
210210
manifestMetadata.UpdateMember(x => x.Id, Id);
211211
manifestMetadata.UpdateMember(x => x.Language, Language);
@@ -260,12 +260,7 @@ from f in Files.NullAsEmpty()
260260
Target = f.GetMetadata(Metadata.FileTarget).Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar),
261261
Exclude = f.GetMetadata(Metadata.FileExclude)
262262
};
263-
264-
if (!string.IsNullOrEmpty(Icon))
265-
{
266-
manifestFiles = manifestFiles.Append(new ManifestFile { Source = Icon, Target = Path.GetFileName(Icon) });
267-
}
268-
263+
269264
return manifestFiles.OrderBy(f => f.Target, StringComparer.OrdinalIgnoreCase).ToList();
270265
}
271266

src/Microsoft.DotNet.Build.Tasks.Packaging/src/Microsoft.DotNet.Build.Tasks.Packaging.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
so we must provide one.
5454
nuget's pack task treats _._ as special, to pack it must be in a folder on its own -->
5555
<None Include="build\content\_._" Pack="true" PackagePath="build\content\_._" />
56-
<None Include="build\Icon.png" Pack="true" PackagePath="build\Icon.png" />
5756
</ItemGroup>
5857

5958
<ItemGroup>
Binary file not shown.

src/Microsoft.DotNet.Build.Tasks.Packaging/src/build/Packaging.targets

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@
7171
<RuntimeFilePath Condition="'$(RuntimeFilePath)' == ''">$(NuSpecOutputPath)$(Id)$(NuspecSuffix)/runtime.json</RuntimeFilePath>
7272
<PackedPackageRuntimeFilePath Condition="'$(PackedPackageRuntimeFilePath)' == ''">$(NuSpecOutputPath)$(Id)$(NuspecSuffix)/$(PackedPackageNamePrefix).runtime.json</PackedPackageRuntimeFilePath>
7373
<PlaceholderFile>$(MSBuildThisFileDirectory)content/_._</PlaceholderFile>
74-
<PackageIconFile Condition="'$(PackageIconFile)' == ''">$(MSBuildThisFileDirectory)Icon.png</PackageIconFile>
7574
<PackageDescriptionFile Condition="'$(PackageDescriptionFile)' == ''">path to descriptions.json must be specified</PackageDescriptionFile>
7675
<ValidationSuppressionFile Condition="'$(ValidationSuppressionFile)' == ''">ValidationSuppression.txt</ValidationSuppressionFile>
7776
<SyncInfoFile Condition="'$(SyncInfoFile)' == ''">unspecified</SyncInfoFile>
@@ -1211,7 +1210,7 @@
12111210
Language="$(Language)"
12121211
ProjectUrl="$(ProjectUrl)"
12131212
IconUrl="$(IconUrl)"
1214-
Icon="$(PackageIconFile)"
1213+
Icon="$(PackageIcon)"
12151214
LicenseUrl="$(LicenseUrl)"
12161215
PackageLicenseExpression="$(PackageLicenseExpression)"
12171216
Copyright="$(Copyright)"

0 commit comments

Comments
 (0)