Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make NuGetizer targets buildTransitive to fix SponsorLink #353

Merged
merged 1 commit into from
Mar 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/CodeAnalysis/CodeAnalysis.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,14 @@
<PackageReference Include="ThisAssembly.AssemblyInfo" Version="1.1.3" PrivateAssets="all" />
<PackageReference Include="ThisAssembly.Strings" Version="1.1.3" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.0.1" Pack="false" />
<PackageReference Include="Devlooped.SponsorLink" Version="42.42.221-main" PrivateAssets="all" />
<PackageReference Include="Devlooped.SponsorLink" Version="0.10.0" GeneratePathProperty="true" />
</ItemGroup>

<ItemGroup>
<None Update="NuGetizer.CodeAnalysis.targets" PackFolder="build" CopyToOutputDirectory="PreserveNewest" />
<None Update="NuGetizer.CodeAnalysis.targets" PackFolder="buildTransitive" CopyToOutputDirectory="PreserveNewest" />
<None Include="$(PkgDevlooped_SponsorLink)\buildTransitive\Devlooped.SponsorLink.targets"
PackFolder="buildTransitive"
CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>

</Project>
11 changes: 9 additions & 2 deletions src/CodeAnalysis/NuGetizer.CodeAnalysis.targets
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@

<CompilerVisibleProperty Include="Authors" />
<CompilerVisibleProperty Include="AssemblyName" />

<SponsorablePackageId Include="NuGetizer" />
</ItemGroup>

<Target Name="_AddDescription" BeforeTargets="GenerateMSBuildEditorConfigFileShouldRun">
Expand All @@ -29,4 +27,13 @@
</ItemGroup>
</Target>

<ItemGroup Label="SponsorLink">
<SponsorablePackageId Include="NuGetizer" />
</ItemGroup>

<!-- This ensures devlooped targets are imported transitively even if we are a dev dependency
and therefore don't propagate the SL dependency, which would otherwise cause a build error
due to analyzers being forcedly transitive even if the reference is private assets/dev dep.
-->
<Import Project="Devlooped.SponsorLink.targets" Condition="$(SponsorLinkImported) != true"/>
</Project>
2 changes: 1 addition & 1 deletion src/NuGetizer.Tasks/NuGetizer.Tasks.targets
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<Description>Simple, flexible and powerful NuGet packaging</Description>

<DevelopmentDependency>true</DevelopmentDependency>
<PackFolder>build</PackFolder>
<PackFolder>buildTransitive</PackFolder>

<PackOnBuild Condition="'$(PackOnBuild)' == '' And '$(Configuration)' == 'Release'">true</PackOnBuild>
<PackageOutputPath Condition="'$(PackageOutputPath)' == ''">..\..\bin</PackageOutputPath>
Expand Down