Skip to content

Commit

Permalink
Try harder to default PackageId when IsPackable=true
Browse files Browse the repository at this point in the history
i.e. for cases where the SDK hasn't defaulted yet the AssemblyName even, the SDK targets use the MSBuildProjectName too as a fallback. So we do the same too.
  • Loading branch information
kzu committed Oct 8, 2020
1 parent b73c6ca commit c19f327
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/NuGetizer.Tasks/NuGetizer.PackageMetadata.targets
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ Copyright (c) .NET Foundation. All rights reserved.

<PropertyGroup Label="Hidden">
<!-- Matches the SDK Pack default when set to true. -->
<PackageId Condition="'$(IsPackable)' == 'true' and '$(PackageId)' == ''">$(AssemblyName)</PackageId>
<PackageId Condition="'$(IsPackable)' == 'true' and '$(PackageId)' == ''">$(AssemblyName)</PackageId>
<PackageId Condition="'$(IsPackable)' == 'true' and '$(PackageId)' == ''">$(MSBuildProjectName)</PackageId>
</PropertyGroup>

<ItemDefinitionGroup>
Expand Down
1 change: 1 addition & 0 deletions src/NuGetizer.Tasks/NuGetizer.Shared.targets
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Copyright (c) .NET Foundation. All rights reserved.
<PropertyGroup Label="Hidden">
<!-- Matches the SDK Pack default when set to true. -->
<PackageId Condition="'$(IsPackable)' == 'true' and '$(PackageId)' == ''">$(AssemblyName)</PackageId>
<PackageId Condition="'$(IsPackable)' == 'true' and '$(PackageId)' == ''">$(MSBuildProjectName)</PackageId>

<IsPackable Condition="'$(IsPackable)' == '' and '$(PackageId)' != ''">true</IsPackable>
<IsPackable Condition="'$(IsPackable)' == '' and '$(PackageId)' == ''">false</IsPackable>
Expand Down

0 comments on commit c19f327

Please sign in to comment.