Skip to content

Commit 0547648

Browse files
committed
chore: add common.targets file and modify settings
1 parent 7cad308 commit 0547648

File tree

32 files changed

+57
-29
lines changed

32 files changed

+57
-29
lines changed

BenchmarkDotNet.slnx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
<Solution>
2+
<Folder Name="/build/">
3+
<File Path="build/common.props" />
4+
<File Path="build/common.targets" />
5+
</Folder>
26
<Folder Name="/samples/">
7+
<File Path="samples/Directory.build.props" />
38
<Project Path="samples/BenchmarkDotNet.Samples.FSharp/BenchmarkDotNet.Samples.FSharp.fsproj" />
49
<Project Path="samples/BenchmarkDotNet.Samples/BenchmarkDotNet.Samples.csproj" DefaultStartup="true" />
510
</Folder>
@@ -19,6 +24,7 @@
1924
<Project Path="templates/BenchmarkDotNet.Templates.csproj" />
2025
</Folder>
2126
<Folder Name="/tests/">
27+
<File Path="tests/Directory.build.props" />
2228
<Project Path="tests/BenchmarkDotNet.Analyzers.Tests/BenchmarkDotNet.Analyzers.Tests.csproj" />
2329
<Project Path="tests/BenchmarkDotNet.Exporters.Plotting.Tests/BenchmarkDotNet.Exporters.Plotting.Tests.csproj" />
2430
<Project Path="tests/BenchmarkDotNet.IntegrationTests.ConfigPerAssembly/BenchmarkDotNet.IntegrationTests.ConfigPerAssembly.csproj" />

build/common.props

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,16 @@
2828
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
2929
</PropertyGroup>
3030

31-
<ItemGroup>
32-
<None Include="$(MSBuildThisFileDirectory)package-icon.png" Pack="True" PackagePath=""/>
33-
</ItemGroup>
34-
3531
<PropertyGroup>
3632
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)strongNameKey.snk</AssemblyOriginatorKeyFile>
3733
<SignAssembly>true</SignAssembly>
3834
</PropertyGroup>
3935

40-
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
36+
<PropertyGroup Condition="'$(GenerateDocumentationFile)' == '' AND '$(Configuration)' == 'Release' ">
4137
<GenerateDocumentationFile>true</GenerateDocumentationFile>
4238
</PropertyGroup>
4339

44-
<PropertyGroup Condition=" '$(IsVisualBasic)' != 'true' AND '$(IsFsharp)' != 'true' ">
40+
<PropertyGroup Condition="'$(MSBuildProjectExtension)' != '.fsproj' ">
4541
<LangVersion>14.0</LangVersion>
4642
</PropertyGroup>
4743

@@ -68,14 +64,8 @@
6864
</PropertyGroup>
6965

7066
<ItemGroup>
71-
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3">
72-
<PrivateAssets>all</PrivateAssets>
73-
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
74-
</PackageReference>
75-
<PackageReference Include="StyleCop.Analyzers.Unstable" Version="1.2.0.556">
76-
<PrivateAssets>all</PrivateAssets>
77-
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
78-
</PackageReference>
67+
<GlobalPackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" />
68+
<GlobalPackageReference Include="StyleCop.Analyzers.Unstable" Version="1.2.0.556" />
7969
</ItemGroup>
8070

8171
<UsingTask TaskName="ReplaceFileText"

build/common.targets

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<Project>
2+
3+
<ItemGroup Condition="'$(IsPackable)' == 'true'">
4+
<None Include="$(MSBuildThisFileDirectory)package-icon.png" Pack="True" PackagePath=""/>
5+
</ItemGroup>
6+
7+
</Project>

samples/BenchmarkDotNet.Samples.FSharp/BenchmarkDotNet.Samples.FSharp.fsproj

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2-
<PropertyGroup>
3-
<!-- MSBuild was complaing about InformationalVersion from common.props file, so I excluded them in conditional way -->
4-
<IsFsharp>true</IsFsharp>
5-
</PropertyGroup>
62
<Import Project="..\..\build\common.props" />
73
<PropertyGroup>
84
<OutputType>Exe</OutputType>
@@ -28,4 +24,6 @@
2824
<PackageReference Update="System.ValueTuple" Version="4.6.1" />
2925
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
3026
</ItemGroup>
27+
28+
<Import Project="..\..\build\common.targets" />
3129
</Project>

samples/BenchmarkDotNet.Samples.Maui/BenchmarkDotNet.Samples.Maui.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,5 @@
6868
<ProjectReference Include="..\..\src\BenchmarkDotNet\BenchmarkDotNet.csproj" />
6969
</ItemGroup>
7070

71+
<Import Project="..\..\build\common.targets" />
7172
</Project>

samples/BenchmarkDotNet.Samples/BenchmarkDotNet.Samples.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
<AssemblyName>BenchmarkDotNet.Samples</AssemblyName>
88
<OutputType>Exe</OutputType>
99
<PackageId>BenchmarkDotNet.Samples</PackageId>
10-
<GenerateDocumentationFile>false</GenerateDocumentationFile>
1110
<PlatformTarget>AnyCPU</PlatformTarget>
1211
<DebugSymbols>true</DebugSymbols>
1312
<NoWarn>$(NoWarn);CA1018;CA5351;CA1825</NoWarn>
@@ -44,4 +43,5 @@
4443
<!-- Enables analyzers for this project (this is required since ProjectReference is not transitive). -->
4544
<ProjectReference Include="..\..\src\BenchmarkDotNet.Analyzers\BenchmarkDotNet.Analyzers.csproj" ReferenceOutputAssembly="false" OutputItemType="Analyzer"/>
4645
</ItemGroup>
46+
<Import Project="..\..\build\common.targets" />
4747
</Project>

samples/Directory.build.props

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<Project>
2+
<PropertyGroup>
3+
<GenerateDocumentationFile>false</GenerateDocumentationFile>
4+
<IsPackable>false</IsPackable>
5+
</PropertyGroup>
6+
</Project>

src/BenchmarkDotNet.Analyzers/BenchmarkDotNet.Analyzers.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,5 @@
4848
<_Parameter1>BenchmarkDotNet.Analyzers.Tests,PublicKey=00240000048000009400000006020000002400005253413100040000010001002970bbdfca4d129fc74b4845b239973f1b183684f0d7db5e1de7e085917e3656cf94884803cb800d85d5aae5838fb3f8fd1f2829e8208c4f087afcfe970bce44037ba30a66749cd5514b410ca8a35e9c7d6eb86975853c834c9ad25051537f9a05a0c540c5d84f2c7b32ab01619d84367fd424797ba3242f08b0e6ae75f66dad</_Parameter1>
4949
</AssemblyAttribute>
5050
</ItemGroup>
51+
<Import Project="..\..\build\common.targets" />
5152
</Project>

src/BenchmarkDotNet.Annotations/BenchmarkDotNet.Annotations.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,5 @@
4747
</ItemGroup>
4848
</Otherwise>
4949
</Choose>
50+
<Import Project="..\..\build\common.targets" />
5051
</Project>

src/BenchmarkDotNet.Diagnostics.Windows/BenchmarkDotNet.Diagnostics.Windows.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@
1414
<ItemGroup>
1515
<PackageReference Include="Microsoft.Diagnostics.Tracing.TraceEvent" Version="3.1.21" PrivateAssets="contentfiles;analyzers" />
1616
</ItemGroup>
17+
<Import Project="..\..\build\common.targets" />
1718
</Project>

0 commit comments

Comments
 (0)