Skip to content

Commit

Permalink
Warn if SymbolPackageFormat set to snupkg
Browse files Browse the repository at this point in the history
To avoid the repeat of dotnet/extensions#4406,
warn if SymbolPackageFormat property is set to 'snupkg'.

If necessary, the warning can be suppressed with SupressSymbolPackageFormatValidation=true.
  • Loading branch information
RussKie committed Sep 18, 2023
1 parent 858c011 commit 6045905
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Microsoft.DotNet.Arcade.Sdk/sdk/Sdk.targets
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
</ItemGroup>
</Target>

<Import Project="..\tools\Pack.targets" Condition="'$(__ImportPackTargets)' == 'true'" />

<Import Project="..\tools\Imports.targets" Condition="!$(_SuppressSdkImports) and !$(_SuppressAllTargets)" />
<Import Project="..\tools\Empty.targets" Condition="!$(_SuppressSdkImports) and $(_SuppressAllTargets)"/>
</Project>
1 change: 1 addition & 0 deletions src/Microsoft.DotNet.Arcade.Sdk/tools/Build.proj
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@
<ItemGroup>
<_SolutionBuildProps Include="@(_CommonProps)"/>
<_SolutionBuildProps Include="__DeployProjectOutput=$(Deploy)" Condition="'$(Deploy)' != ''"/>
<_SolutionBuildProps Include="__ImportPackTargets=true" Condition="'$(Pack)' == 'true'" />
</ItemGroup>

<!--
Expand Down
16 changes: 16 additions & 0 deletions src/Microsoft.DotNet.Arcade.Sdk/tools/Pack.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. -->
<Project>

<PropertyGroup>
<GenerateNuspecDependsOn>$(GenerateNuspecDependsOn); _ValidationSymbolPackageFormat</GenerateNuspecDependsOn>
</PropertyGroup>

<Target
Name="_ValidationSymbolPackageFormat"
Condition="'$(IsPackable)' == 'true' AND '$(SupressSymbolPackageFormatValidation)' != 'true'">

<Error Text="&lt;SymbolPackageFormat&gt;snupkg&lt;/SymbolPackageFormat&gt; is not supported by the Arcade SDK."
Condition="'$(SymbolPackageFormat)' == 'snupkg'" />
</Target>

</Project>

0 comments on commit 6045905

Please sign in to comment.