Skip to content
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
12 changes: 12 additions & 0 deletions benchmarks/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<Project>
<PropertyGroup>
<!--
Keep intermediates in obj/ even when a global ArtifactsPath is supplied
(e.g. BenchmarkDotNet's autogenerated host build passes ArtifactsPath/OutDir
as global properties). Otherwise the artifacts layout relocates obj/ outside
DefaultItemExcludes and emitted generator files get globbed into <Compile>,
causing duplicate-symbol errors during host builds.
-->
<UseArtifactsOutput>false</UseArtifactsOutput>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,32 @@
</PropertyGroup>

<ItemGroup>
<!--
BenchmarkDotNet's autogenerated host build passes ArtifactsPath/OutDir/OutputPath
as global properties. Without stripping them here they propagate to the generator
project, relocating its build output (relative to the project) into stray folders;
the analyzer then cannot load its Purview.SourceGeneratorFramework runtime
dependencies from that location. Keep the generator at its normal output path.
-->
<ProjectReference
Include="..\..\src\src\SourceGenerator\SourceGenerator.csproj"
OutputItemType="Analyzer"
ReferenceOutputAssembly="false"
GlobalPropertiesToRemove="ArtifactsPath;OutDir;OutputPath"
/>
</ItemGroup>

<ItemGroup>
<!--
The host build runs with UseSharedCompilation=false, where Roslyn's in-process
analyzer loader does not probe the generator's output directory for its runtime
dependencies. Load the Purview.SourceGeneratorFramework assemblies as analyzers
so they are present in the analyzer load context for every build mode.
-->
<Analyzer Include="..\..\src\src\SourceGenerator\bin\$(Configuration)\netstandard2.0\Purview.SourceGeneratorFramework.dll" />
<Analyzer Include="..\..\src\src\SourceGenerator\bin\$(Configuration)\netstandard2.0\Purview.SourceGeneratorFramework.Shared.dll" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.15.8" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="10.0.4" />
Expand Down
8 changes: 8 additions & 0 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@
telemetry... obviously we don't want that here!
-->
<ExcludePurviewTelemetry>true</ExcludePurviewTelemetry>
<!--
Keep intermediates in obj/ even when a global ArtifactsPath is supplied
(e.g. BenchmarkDotNet's autogenerated host build passes ArtifactsPath/OutDir
as global properties). Otherwise the artifacts layout relocates obj/ outside
DefaultItemExcludes and emitted generator files get globbed into <Compile>,
causing duplicate-symbol errors during host builds.
-->
<UseArtifactsOutput>false</UseArtifactsOutput>
</PropertyGroup>

<Import Sdk="Purview.DotNetProjectSdk" Project="Sdk.props" />
Expand Down