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
2 changes: 2 additions & 0 deletions BenchmarkDotNet.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
</Folder>
<Folder Name="/samples/">
<File Path="samples/Directory.Build.props" />
<File Path="samples/Directory.Build.targets" />
<Project Path="samples/BenchmarkDotNet.Samples.FSharp/BenchmarkDotNet.Samples.FSharp.fsproj" />
<Project Path="samples/BenchmarkDotNet.Samples/BenchmarkDotNet.Samples.csproj" DefaultStartup="true" />
</Folder>
Expand All @@ -28,6 +29,7 @@
</Folder>
<Folder Name="/tests/">
<File Path="tests/Directory.Build.props" />
<File Path="tests/Directory.Build.targets" />
<Project Path="tests/BenchmarkDotNet.Analyzers.Tests/BenchmarkDotNet.Analyzers.Tests.csproj" />
<Project Path="tests/BenchmarkDotNet.Exporters.Plotting.Tests/BenchmarkDotNet.Exporters.Plotting.Tests.csproj" />
<Project Path="tests/BenchmarkDotNet.IntegrationTests.ConfigPerAssembly/BenchmarkDotNet.IntegrationTests.ConfigPerAssembly.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,6 @@
<!-- Enables analyzers for this project (this is required since ProjectReference is not transitive). -->
<ProjectReference Include="..\..\src\BenchmarkDotNet.Analyzers\BenchmarkDotNet.Analyzers.csproj" ReferenceOutputAssembly="false" OutputItemType="Analyzer" />
</ItemGroup>

<Import Project="..\..\build\common.targets" />
</Project>
4 changes: 4 additions & 0 deletions samples/Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<Project>
<!-- Manually import `BenchmarkDotNet.targets` for build that using ProjectReference -->
<Import Project="$(MSBuildThisFileDirectory)..\src\BenchmarkDotNet\BenchmarkDotNet.targets" />
</Project>
23 changes: 18 additions & 5 deletions src/BenchmarkDotNet/BenchmarkDotNet.targets
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<Project>
<Project>

<PropertyGroup>
<!-- If the RuntimeIdentifier is explicitly specified. Use the specified target platform. -->
<BenchmarkDotNetTargetPlatform>$(RuntimeIdentifier)</BenchmarkDotNetTargetPlatform>
</PropertyGroup>

<PropertyGroup Condition="'$(BenchmarkDotNetTargetPlatform)' == ''">
<!-- If RuntimeIdentifier is not specified Use current build platform -->
<!-- List of runtimes supported by Gee.External.Capstone: https://github.com/9ee1/Capstone.NET/tree/master/Gee.External.Capstone/runtimes -->
Expand All @@ -18,7 +18,7 @@
<BenchmarkDotNetTargetPlatform Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture)' == 'Arm64'">$(BenchmarkDotNetTargetPlatform)-arm64</BenchmarkDotNetTargetPlatform>
</PropertyGroup>

<Target Name="FilterBenchmarkDotNetPackageAssets" AfterTargets="ResolvePackageAssets">
<Target Name="BdnFilterPackageAssets" AfterTargets="ResolvePackageAssets">
<!-- Remove `runtimes/{RuntimeIdentifier}` files that is not matched to target platform. -->
<ItemGroup Condition="'$(BenchmarkDotNetTargetPlatform)' != '' AND $(BenchmarkDotNetTargetPlatform) != 'all'">
<RuntimeTargetsCopyLocalItems Remove="@(RuntimeTargetsCopyLocalItems)"
Expand All @@ -27,8 +27,21 @@

<!-- Remove unnecessary satellite assemblies. -->
<ItemGroup>
<ResourceCopyLocalItems Remove="@(ResourceCopyLocalItems)"
Condition="'%(ResourceCopyLocalItems.NuGetPackageId)' == 'Microsoft.CodeAnalysis.Common' OR '%(ResourceCopyLocalItems.NuGetPackageId)' == 'Microsoft.CodeAnalysis.CSharp'"/>
<ResourceCopyLocalItems
Remove="@(ResourceCopyLocalItems)"
Condition="'%(ResourceCopyLocalItems.NuGetPackageId)' == 'Microsoft.CodeAnalysis.Common'
OR
'%(ResourceCopyLocalItems.NuGetPackageId)' == 'Microsoft.CodeAnalysis.CSharp'
OR
'%(ResourceCopyLocalItems.NuGetPackageId)' == 'Microsoft.TestPlatform.AdapterUtilities'
OR
'%(ResourceCopyLocalItems.NuGetPackageId)' == 'Microsoft.TestPlatform.ObjectModel'
OR
'%(ResourceCopyLocalItems.NuGetPackageId)' == 'Microsoft.TestPlatform.TestHost'
OR
'%(ResourceCopyLocalItems.NuGetPackageId)' == 'Microsoft.TestPlatform.TranslationLayer'
"/>
</ItemGroup>
</Target>

</Project>
4 changes: 4 additions & 0 deletions tests/Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<Project>
<!-- Manually import `BenchmarkDotNet.targets` for build that using ProjectReference -->
<Import Project="$(MSBuildThisFileDirectory)..\src\BenchmarkDotNet\BenchmarkDotNet.targets" />
</Project>
Loading