Skip to content

Commit 86e07f3

Browse files
committed
fix: add project dependencies and prevent parallel builds for benchmarks and integration tests
1 parent c83a316 commit 86e07f3

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

CycloneDX.MSBuild.sln

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ EndProject
1414
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CycloneDX.MSBuild.Benchmarks", "tests\CycloneDX.MSBuild.Benchmarks\CycloneDX.MSBuild.Benchmarks.csproj", "{B8C9D0E1-F2A3-4B5C-4D5E-7F8A9B0C1D2E}"
1515
EndProject
1616
Global
17+
GlobalSection(ProjectDependencies) = postSolution
18+
{A7B8C9D0-E1F2-4A5B-3C4D-6E7F8A9B0C1D}.0 = {C3D4E5F6-A7B8-4C5D-0E1F-2A3B4C5D6E7F}
19+
{B8C9D0E1-F2A3-4B5C-4D5E-7F8A9B0C1D2E}.0 = {C3D4E5F6-A7B8-4C5D-0E1F-2A3B4C5D6E7F}
20+
EndGlobalSection
1721
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1822
Debug|Any CPU = Debug|Any CPU
1923
Release|Any CPU = Release|Any CPU

tests/CycloneDX.MSBuild.Benchmarks/CycloneDX.MSBuild.Benchmarks.csproj

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,14 @@
1414
<PackageReference Include="BenchmarkDotNet" Version="0.14.0" />
1515
</ItemGroup>
1616

17+
<ItemGroup>
18+
<!-- Reference CycloneDX.MSBuild first to ensure it's built before this project -->
19+
<!-- This prevents parallel builds of the shared dependency that cause file locking -->
20+
<ProjectReference Include="../../src/CycloneDX.MSBuild/CycloneDX.MSBuild.csproj">
21+
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
22+
<BuildInParallel>false</BuildInParallel>
23+
<Properties>GeneratePackageOnBuild=false</Properties>
24+
</ProjectReference>
25+
</ItemGroup>
26+
1727
</Project>

tests/Directory.Build.props

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,11 @@
1010
<!-- CA1062: Validate arguments of public methods - Tests don't need null checks -->
1111
<NoWarn>$(NoWarn);CA1707;CA1305;CA2201;CA1062</NoWarn>
1212
</PropertyGroup>
13+
14+
<PropertyGroup>
15+
<!-- Use project-specific intermediate output directories to prevent parallel build conflicts -->
16+
<!-- This ensures each project has its own obj/ directory even when building shared dependencies -->
17+
<BaseIntermediateOutputPath>$(MSBuildProjectDirectory)/obj/$(MSBuildProjectName)/</BaseIntermediateOutputPath>
18+
<IntermediateOutputPath>$(BaseIntermediateOutputPath)$(Configuration)/</IntermediateOutputPath>
19+
</PropertyGroup>
1320
</Project>

0 commit comments

Comments
 (0)