Skip to content

Commit 2b0a413

Browse files
committed
Account for multi-targeting projects
1 parent 9a5aaf9 commit 2b0a413

File tree

4 files changed

+23
-16
lines changed

4 files changed

+23
-16
lines changed

CodeStyle/CodeStyle.csproj

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@
1919
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.556" PrivateAssets="none" />
2020
</ItemGroup>
2121
<ItemGroup>
22-
<None Include="build\**\*">
23-
<Pack>true</Pack>
24-
<PackagePath>%(Identity)</PackagePath>
25-
</None>
22+
<None Include="build\**\*" Pack="true" PackagePath="%(Identity)" />
23+
<None Include="buildMultiTargeting\**\*" Pack="true" PackagePath="%(Identity)" />
2624
</ItemGroup>
2725
</Project>
Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<Target Name="_PolyadicCodeStylePreventLocalPack" BeforeTargets="Pack"
4-
Condition="'$(ContinuousIntegrationBuild)' != 'true' And '$(IsPackable)' == 'true' And '$(ApiCompatGenerateSuppressionFile)' != 'true'">
5-
<PropertyGroup>
6-
<_WorkflowUrl>$(PackageProjectUrl)/actions?query=branch%253Amain</_WorkflowUrl>
7-
<_LinkPrefix>%1b]8;;</_LinkPrefix>
8-
<_LinkInfix>%1b\</_LinkInfix>
9-
<_LinkSuffix>$(_LinkPrefix)$(_LinkInfix)</_LinkSuffix>
10-
</PropertyGroup>
11-
<Error Text="Do not publish locally built packages to NuGet.org.
12-
Download the artifacts $(_LinkPrefix)$(_WorkflowUrl)$(_LinkInfix)published on GitHub Actions$(_LinkSuffix) instead.
13-
You can alternatively run `dotnet pack /p:ContinuousIntegrationBuild=true`." />
14-
</Target>
3+
<!-- Only run when we're not a multi-targeting project as that is covered by buildMultiTargeting/Polyadic.CodeStyle.targets. -->
4+
<Import Project="$(MSBuildThisFileDirectory)PreventLocalPack.targets" Condition="'$(TargetFrameworks)' == ''" />
155
</Project>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Target Name="_PolyadicCodeStylePreventLocalPack" BeforeTargets="Pack"
4+
Condition="'$(ContinuousIntegrationBuild)' != 'true' And '$(IsPackable)' == 'true' And '$(ApiCompatGenerateSuppressionFile)' != 'true'">
5+
<PropertyGroup>
6+
<_WorkflowUrl>$(PackageProjectUrl)/actions?query=branch%253Amain</_WorkflowUrl>
7+
<_LinkPrefix>%1b]8;;</_LinkPrefix>
8+
<_LinkInfix>%1b\</_LinkInfix>
9+
<_LinkSuffix>$(_LinkPrefix)$(_LinkInfix)</_LinkSuffix>
10+
</PropertyGroup>
11+
<Error Text="Do not publish locally built packages to NuGet.org.
12+
Download the artifacts $(_LinkPrefix)$(_WorkflowUrl)$(_LinkInfix)published on GitHub Actions$(_LinkSuffix) instead.
13+
You can alternatively run `dotnet pack /p:ContinuousIntegrationBuild=true`." />
14+
</Target>
15+
</Project>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildThisFileDirectory)..\build\PreventLocalPack.targets" />
4+
</Project>

0 commit comments

Comments
 (0)