Centralize packing source generators in .targets file

このコミットが含まれているのは:
Sergio Pedri committed 2023-04-22 12:15:58 +02:00
1 親 129268ffb6
コミット cf478e4421
4ファイル変更
+17 -30

検索条件に一致するファイルはありません

-10
ファイルの表示
@@ -31,14 +31,4 @@
<PropertyGroup Label="Package">
<Description>A library containing basic primitives to support ComputeSharp (this package is not supposed to be referenced directly by developers)</Description>
</PropertyGroup>
<!-- NuGet package setup -->
<ItemGroup Label="Package">
<!-- Source generator reference -->
<ProjectReference Condition="'$(TargetFramework)' == 'netstandard2.0'" Include="..\ComputeSharp.Core.SourceGenerators\ComputeSharp.Core.SourceGenerators.csproj" ReferenceOutputAssembly="false" />
<!-- Pack the source generator in the NuGet package for the project -->
<None Include="..\ComputeSharp.Core.SourceGenerators\bin\$(Configuration)\netstandard2.0\ComputeSharp.Core.SourceGenerators.dll" PackagePath="analyzers\dotnet\cs" Pack="true" Visible="false" />
</ItemGroup>
</Project>
-10
ファイルの表示
@@ -31,14 +31,4 @@
<PropertyGroup Label="Package">
<Description>A library to write D2D1 pixel shaders entirely with C# code, and to easily register and create ID2D1Effect-s from them</Description>
</PropertyGroup>
<!-- NuGet package setup -->
<ItemGroup Label="Package">
<!-- Source generator reference -->
<ProjectReference Condition="'$(TargetFramework)' == 'netstandard2.0'" Include="..\ComputeSharp.D2D1.SourceGenerators\ComputeSharp.D2D1.SourceGenerators.csproj" ReferenceOutputAssembly="false" />
<!-- Pack the source generator in the NuGet package for the project -->
<None Include="..\ComputeSharp.D2D1.SourceGenerators\bin\$(Configuration)\netstandard2.0\ComputeSharp.D2D1.SourceGenerators.dll" PackagePath="analyzers\dotnet\cs" Pack="true" Visible="false" />
</ItemGroup>
</Project>
-10
ファイルの表示
@@ -40,14 +40,4 @@
<PropertyGroup Label="Package">
<Description>A library to run C# code in parallel on the GPU through DX12 and dynamically generated HLSL compute shaders</Description>
</PropertyGroup>
<!-- NuGet package setup -->
<ItemGroup Label="Package">
<!-- Source generator reference -->
<ProjectReference Condition="'$(TargetFramework)' == 'netstandard2.0'" Include="..\ComputeSharp.SourceGenerators\ComputeSharp.SourceGenerators.csproj" ReferenceOutputAssembly="false" />
<!-- Pack the source generator in the NuGet package for the project -->
<None Include="..\ComputeSharp.SourceGenerators\bin\$(Configuration)\netstandard2.0\ComputeSharp.SourceGenerators.dll" PackagePath="analyzers\dotnet\cs" Pack="true" Visible="false" />
</ItemGroup>
</Project>
+17
ファイルの表示
@@ -2,6 +2,23 @@
<Project>
<Import Project="..\build\Directory.Build.targets" />
<!-- Check whether there is a source generator that should be packed with the project -->
<PropertyGroup Condition="$(IsPackagedProject)">
<IsSourceGeneratorAvailableForPacking>false</IsSourceGeneratorAvailableForPacking>
<IsSourceGeneratorAvailableForPacking Condition="Exists('..\$(MSBuildProjectName).SourceGenerators')">true</IsSourceGeneratorAvailableForPacking>
<SourceGeneratorReferenceTargetFramework Condition="$(IsSourceGeneratorAvailableForPacking)">$(TargetFrameworks.Split(';')[0].Trim())</SourceGeneratorReferenceTargetFramework>
</PropertyGroup>
<!-- Pack the source generator, if present -->
<ItemGroup Condition="'$(IsSourceGeneratorAvailableForPacking)' == 'true'" Label="Package">
<!-- Source generator reference (to trigger building the generator) -->
<ProjectReference Condition="'$(TargetFramework)' == '$(SourceGeneratorReferenceTargetFramework)'" Include="..\$(MSBuildProjectName).SourceGenerators\$(MSBuildProjectName).SourceGenerators.csproj" ReferenceOutputAssembly="false" />
<!-- Pack the source generator from its output directory -->
<None Include="..\$(MSBuildProjectName).SourceGenerators\bin\$(Configuration)\$(SourceGeneratorReferenceTargetFramework)\$(MSBuildProjectName).SourceGenerators.dll" PackagePath="analyzers\dotnet\cs" Pack="true" Visible="false" />
</ItemGroup>
<!--
Enable trimming support on .NET 6 (we need to use StartsWith since it
could be a Windows TFM too). This can't be in a target unlike the other