Skip to content

Commit 9ecd7aa

Browse files
authored
Merge pull request #1617 from nunit/issue-1589
Move common settings to Directory.Build.props
2 parents fe96ba5 + a0b3dc0 commit 9ecd7aa

File tree

29 files changed

+81
-208
lines changed

29 files changed

+81
-208
lines changed

NUnitConsole.sln

+3
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,9 @@ EndProject
146146
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "nunit.common.tests", "src\NUnitEngine\nunit.common.tests\nunit.common.tests.csproj", "{F546CFE1-74B0-45D3-A06A-8972D73F4419}"
147147
EndProject
148148
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Extensibility", "Extensibility", "{3B30D2E5-1587-4D68-B848-1BDDB3C24BFC}"
149+
ProjectSection(SolutionItems) = preProject
150+
src\Extensibility\Directory.Build.props = src\Extensibility\Directory.Build.props
151+
EndProjectSection
149152
EndProject
150153
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "nunit.extensibility.api", "src\Extensibility\nunit.extensibility.api\nunit.extensibility.api.csproj", "{71DE0F2C-C72B-4CBF-99BE-F2DC0FBEDA24}"
151154
EndProject

NuGet.config

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
33
<packageSources>
4-
<add key="NUnit AppVeyor CI" value="https://ci.appveyor.com/nuget/nunit" />
5-
<add key="NUnit MyGet Feed" value="https://www.myget.org/F/nunit/api/v3/index.json" />
6-
<add key="NUnit Analyzers MyGet Feed" value="https://www.myget.org/F/nunit-analyzers/api/v3/index.json" protocolVersion="3" />
7-
<add key="nuget.org" value="https://www.nuget.org/api/v2/" />
8-
<add key="api.nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
4+
<clear/>
5+
<add key="nuget" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
96
</packageSources>
107
</configuration>

src/Directory.Build.props

+22-8
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,33 @@
1+
<!-- Top level Directory.Build.props -->
12
<Project>
23

34
<PropertyGroup>
4-
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
5+
<!-- Compile and Build Settings -->
56
<LangVersion>12</LangVersion>
7+
<Features>strict</Features>
8+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
9+
<Version Condition="'$(Version)'==''">4.0.0.0</Version>
10+
<OutputPath>$(MSBuildThisFileDirectory)\..\bin\$(Configuration)\</OutputPath>
11+
<CheckEolTargetFramework>false</CheckEolTargetFramework>
12+
<RollForward>Major</RollForward>
613
<DisableImplicitNuGetFallbackFolder>true</DisableImplicitNuGetFallbackFolder>
714
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
15+
<!-- Signing Assemblies -->
16+
<SignAssembly>true</SignAssembly>
17+
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)/nunit.snk</AssemblyOriginatorKeyFile>
18+
<!-- Debugging -->
19+
<DebugType>portable</DebugType>
20+
<DebugSymbols>true</DebugSymbols>
21+
<!-- Commonly Used Package Versions -->
22+
<AnnotatedReferenceAssemblyVersion>8.0.0</AnnotatedReferenceAssemblyVersion>
23+
<!-- Informatinal Settings -->
824
<Company>NUnit Software</Company>
25+
<Product>NUnit 4 Runner and Engine</Product>
926
<Copyright>Copyright (c) 2022 Charlie Poole, Rob Prouse</Copyright>
10-
<CheckEolTargetFramework>false</CheckEolTargetFramework>
11-
</PropertyGroup>
12-
13-
<PropertyGroup Condition="'$(Version)'==''">
14-
<AssemblyVersion>3.99.0.0</AssemblyVersion>
15-
<FileVersion>3.99.0.0</FileVersion>
16-
<InformationalVersion>3.99.0.0-VSIDE</InformationalVersion>
27+
<Trademark>NUnit is a trademark of NUnit Software</Trademark>
28+
<!-- Keys for Friend Assemblies -->
29+
<NUnitPublicKey>002400000480000094000000060200000024000052534131000400000100010031eea370b1984bfa6d1ea760e1ca6065cee41a1a279ca234933fe977a096222c0e14f9e5a17d5689305c6d7f1206a85a53c48ca010080799d6eeef61c98abd18767827dc05daea6b6fbd2e868410d9bee5e972a004ddd692dec8fa404ba4591e847a8cf35de21c2d3723bc8d775a66b594adeb967537729fe2a446b548cd57a6</NUnitPublicKey>
30+
<NSubstitutePublicKey>0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7</NSubstitutePublicKey>
1731
</PropertyGroup>
1832

1933
</Project>
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<!-- Directory.Build.props for Extensibility -->
2+
<Project>
3+
4+
<Import Project="$(MSBuildThisFileDirectory)../Directory.Build.props" />
5+
<Import Project="$(MSBuildThisFileDirectory)../Nullable.props" />
6+
7+
</Project>

src/Extensibility/FakeExtensions/FakeExtensions.csproj

-4
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,9 @@
33
<PropertyGroup>
44
<TargetFrameworks>net462;netstandard2.0</TargetFrameworks>
55
<RootNamespace>TestCentric.Extensibility</RootNamespace>
6-
<SignAssembly>true</SignAssembly>
7-
<AssemblyOriginatorKeyFile>..\..\nunit.snk</AssemblyOriginatorKeyFile>
86
<OutputPath>..\..\..\bin\$(Configuration)\fakes</OutputPath>
97
</PropertyGroup>
108

11-
<Import Project="$(MSBuildThisFileDirectory)/../../Nullable.props" />
12-
139
<ItemGroup>
1410
<ProjectReference Include="..\..\NUnitEngine\nunit.engine.api\nunit.engine.api.csproj" />
1511
</ItemGroup>

src/Extensibility/nunit.extensibility.api/nunit.extensibility.api.csproj

+1-7
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,8 @@
33
<PropertyGroup>
44
<RootNamespace>NUnit.Extensibility</RootNamespace>
55
<TargetFrameworks>net462;netstandard2.0</TargetFrameworks>
6-
<OutputPath>../../../bin/$(Configuration)</OutputPath>
6+
<!-- TODO: Get rid of obsolete BinaryFormatter -->
77
<NoWarn>$(NoWarn);SYSLIB0011</NoWarn>
8-
<SignAssembly>true</SignAssembly>
9-
<AssemblyOriginatorKeyFile>..\..\nunit.snk</AssemblyOriginatorKeyFile>
10-
<DebugType>portable</DebugType>
11-
<DebugSymbols>true</DebugSymbols>
128
</PropertyGroup>
139

14-
<Import Project="$(MSBuildThisFileDirectory)/../../Nullable.props" />
15-
1610
</Project>

src/Extensibility/nunit.extensibility.tests/nunit.extensibility.tests.csproj

-8
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,8 @@
44
<RootNamespace>NUnit.Extensibility</RootNamespace>
55
<TargetFrameworks>net462;net8.0</TargetFrameworks>
66
<OutputType>Exe</OutputType>
7-
<OutputPath>../../../bin/$(Configuration)</OutputPath>
8-
<SignAssembly>true</SignAssembly>
9-
<AssemblyOriginatorKeyFile>..\..\nunit.snk</AssemblyOriginatorKeyFile>
10-
<DebugType>Full</DebugType>
11-
<CheckEolTargetFramework>false</CheckEolTargetFramework>
12-
<NoWarn>1505</NoWarn>
137
</PropertyGroup>
148

15-
<Import Project="$(MSBuildThisFileDirectory)/../../Nullable.props" />
16-
179
<ItemGroup>
1810
<PackageReference Include="NSubstitute" Version="4.3.0" />
1911
<PackageReference Include="NUnit" Version="4.2.2" />

src/Extensibility/nunit.extensibility/nunit.extensibility.csproj

+1-7
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,10 @@
33
<PropertyGroup>
44
<RootNamespace>NUnit.Extensibility</RootNamespace>
55
<TargetFrameworks>net462;netstandard2.0</TargetFrameworks>
6-
<OutputPath>../../../bin/$(Configuration)</OutputPath>
6+
<!-- TODO: Get rid of obsolete BinaryFormatter -->
77
<NoWarn>$(NoWarn);SYSLIB0011</NoWarn>
8-
<SignAssembly>true</SignAssembly>
9-
<AssemblyOriginatorKeyFile>..\..\nunit.snk</AssemblyOriginatorKeyFile>
10-
<DebugType>portable</DebugType>
11-
<DebugSymbols>true</DebugSymbols>
128
</PropertyGroup>
139

14-
<Import Project="$(MSBuildThisFileDirectory)/../../Nullable.props" />
15-
1610
<ItemGroup>
1711
<PackageReference Include="TestCentric.Metadata" Version="3.0.3" />
1812
</ItemGroup>
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<!-- Directory.Build.props for NUnitConsole -->
2+
<Project>
3+
4+
<Import Project="$(MSBuildThisFileDirectory)../Directory.Build.props" />
5+
<Import Project="$(MSBuildThisFileDirectory)../Nullable.props" />
6+
7+
</Project>

src/NUnitConsole/nunit4-console.tests/nunit4-console.tests.csproj

-8
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
<TargetFrameworks>net462;net8.0</TargetFrameworks>
66
<OutputType>Exe</OutputType>
77
<StartupObject>NUnit.Engine.Tests.Program</StartupObject>
8-
<OutputPath>../../../bin/$(Configuration)</OutputPath>
9-
<NoWarn>1685</NoWarn>
10-
<DebugType>Full</DebugType>
118
</PropertyGroup>
129

1310
<PropertyGroup>
@@ -16,18 +13,13 @@
1613
<Description>Tests of the NUnit Console Runner</Description>
1714
</PropertyGroup>
1815

19-
<Import Project="$(MSBuildThisFileDirectory)/../../Nullable.props" />
20-
2116
<ItemGroup>
2217
<PackageReference Include="NUnit" Version="4.2.2" />
2318
<PackageReference Include="NUnitLite" Version="4.2.2" />
2419
<PackageReference Include="System.ComponentModel.TypeConverter" Version="4.3.0" />
2520
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
2621
<PackageReference Include="NUnit3TestAdapter" Version="3.15.1" />
2722
<PackageReference Include="NSubstitute" Version="4.3.0" />
28-
</ItemGroup>
29-
30-
<ItemGroup>
3123
<PackageReference Include="NUnit.Analyzers" Version="4.5.0" />
3224
</ItemGroup>
3325

src/NUnitConsole/nunit4-console/Properties/AssemblyInfo.cs

-6
This file was deleted.

src/NUnitConsole/nunit4-console/nunit4-console.csproj

+5-6
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,18 @@
55
<RootNamespace>NUnit.ConsoleRunner</RootNamespace>
66
<AssemblyName>nunit-console</AssemblyName>
77
<TargetFrameworks>net462</TargetFrameworks>
8-
<OutputPath>../../../bin/$(Configuration)</OutputPath>
9-
<RollForward>Major</RollForward>
10-
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
118
</PropertyGroup>
129

10+
<ItemGroup>
11+
<InternalsVisibleTo Include="nunit4-console.tests, PublicKey=$(NUnitPublicKey)" />
12+
<InternalsVisibleTo Include="DynamicProxyGenAssembly2, PublicKey=$(NSubstitutePublicKey)" />
13+
</ItemGroup>
14+
1315
<PropertyGroup>
14-
<Product>NUnit Console Runner</Product>
1516
<AssemblyTitle>NUnit Console Runner ($(TargetFramework))</AssemblyTitle>
1617
<Description>The standard command-line runner for NUnit</Description>
1718
</PropertyGroup>
1819

19-
<Import Project="$(MSBuildThisFileDirectory)/../../Nullable.props" />
20-
2120
<PropertyGroup>
2221
<ApplicationIcon>..\..\..\nunit.ico</ApplicationIcon>
2322
<ApplicationManifest>app.manifest</ApplicationManifest>

src/NUnitConsole/nunit4-netcore-console/Properties/AssemblyInfo.cs

-6
This file was deleted.

src/NUnitConsole/nunit4-netcore-console/nunit4-netcore-console.csproj

+5-6
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@
55
<RootNamespace>NUnit.ConsoleRunner</RootNamespace>
66
<AssemblyName>nunit-netcore-console</AssemblyName>
77
<TargetFrameworks>net8.0</TargetFrameworks>
8-
<OutputPath>../../../bin/$(Configuration)</OutputPath>
9-
<RollForward>Major</RollForward>
10-
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
118
</PropertyGroup>
129

10+
<ItemGroup>
11+
<InternalsVisibleTo Include="nunit4-console.tests, PublicKey=$(NUnitPublicKey)" />
12+
<InternalsVisibleTo Include="DynamicProxyGenAssembly2, PublicKey=$(NSubstitutePublicKey)" />
13+
</ItemGroup>
14+
1315
<PropertyGroup>
14-
<Product>NUnit NetCore Console Runner</Product>
1516
<AssemblyTitle>NUnit NetCore Console Runner ($(TargetFramework))</AssemblyTitle>
1617
<Description>The dotnet command-line runner for NUnit</Description>
1718
</PropertyGroup>
@@ -34,8 +35,6 @@
3435
<Copyright>Copyright (c) 2022 Charlie Poole, Rob Prouse</Copyright>
3536
</PropertyGroup>
3637

37-
<Import Project="$(MSBuildThisFileDirectory)/../../Nullable.props" />
38-
3938
<PropertyGroup>
4039
<ApplicationIcon>..\..\..\nunit.ico</ApplicationIcon>
4140
<ApplicationManifest>app.manifest</ApplicationManifest>

src/NUnitEngine/Directory.Build.props

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<!-- Directory.Build.props for NUnitEngine -->
2+
<Project>
3+
4+
<Import Project="$(MSBuildThisFileDirectory)../Directory.Build.props" />
5+
<Import Project="$(MSBuildThisFileDirectory)../Nullable.props" />
6+
7+
</Project>

src/NUnitEngine/agents/nunit-agent-net462-x86/nunit-agent-net462-x86.csproj

-3
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@
1111
<GenerateSupportedRuntime>False</GenerateSupportedRuntime>
1212
</PropertyGroup>
1313

14-
<Import Project="$(MSBuildThisFileDirectory)/../../../Nullable.props" />
15-
1614
<PropertyGroup>
17-
<Product>NUnit Engine</Product>
1815
<AssemblyTitle>NUnit X86 Agent ($(TargetFramework))</AssemblyTitle>
1916
<Description>Agent used to run X86 tests out of process under .NET framework</Description>
2017
</PropertyGroup>

src/NUnitEngine/agents/nunit-agent-net462/nunit-agent-net462.csproj

-3
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@
1010
<GenerateSupportedRuntime>false</GenerateSupportedRuntime>
1111
</PropertyGroup>
1212

13-
<Import Project="$(MSBuildThisFileDirectory)/../../../Nullable.props" />
14-
1513
<PropertyGroup>
16-
<Product>NUnit Engine</Product>
1714
<AssemblyTitle>NUnit Agent ($(TargetFramework))</AssemblyTitle>
1815
<Description>Agent used to run tests out of process</Description>
1916
</PropertyGroup>

src/NUnitEngine/agents/nunit-agent-net80/nunit-agent-net80.csproj

-4
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,10 @@
88
<ApplicationManifest>app.manifest</ApplicationManifest>
99
<ApplicationIcon>..\..\..\..\nunit.ico</ApplicationIcon>
1010
<GenerateSupportedRuntime>false</GenerateSupportedRuntime>
11-
<NoWarn>1505</NoWarn>
1211
<EnableUnsafeBinaryFormatterSerialization>true</EnableUnsafeBinaryFormatterSerialization>
1312
</PropertyGroup>
1413

15-
<Import Project="$(MSBuildThisFileDirectory)/../../../Nullable.props" />
16-
1714
<PropertyGroup>
18-
<Product>NUnit Engine</Product>
1915
<AssemblyTitle>NUnit Agent ($(TargetFramework))</AssemblyTitle>
2016
<Description>Agent used to run tests out of process</Description>
2117
</PropertyGroup>

src/NUnitEngine/nunit.common.tests/nunit.common.tests.csproj

-8
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,8 @@
44
<RootNamespace>NUnit</RootNamespace>
55
<TargetFrameworks>net462;net8.0</TargetFrameworks>
66
<OutputType>Exe</OutputType>
7-
<NoWarn>$(NoWarn);618</NoWarn>
8-
<SignAssembly>true</SignAssembly>
9-
<AssemblyOriginatorKeyFile>..\..\nunit.snk</AssemblyOriginatorKeyFile>
10-
<OutputPath>..\..\..\bin\$(Configuration)\</OutputPath>
11-
<DebugType>portable</DebugType>
12-
<DebugSymbols>true</DebugSymbols>
137
</PropertyGroup>
148

15-
<Import Project="$(MSBuildThisFileDirectory)/../../Nullable.props" />
16-
179
<ItemGroup>
1810
<ProjectReference Include="..\nunit.common\nunit.common.csproj" />
1911
<ProjectReference Include="..\nunit.engine.api\nunit.engine.api.csproj" />

src/NUnitEngine/nunit.common/nunit.common.csproj

-8
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,8 @@
33
<PropertyGroup>
44
<RootNamespace>NUnit</RootNamespace>
55
<TargetFrameworks>net462;netstandard2.0</TargetFrameworks>
6-
<NoWarn>$(NoWarn);618</NoWarn>
7-
<SignAssembly>true</SignAssembly>
8-
<AssemblyOriginatorKeyFile>..\..\nunit.snk</AssemblyOriginatorKeyFile>
9-
<OutputPath>..\..\bin\$(Configuration)\</OutputPath>
10-
<DebugType>portable</DebugType>
11-
<DebugSymbols>true</DebugSymbols>
126
</PropertyGroup>
137

14-
<Import Project="$(MSBuildThisFileDirectory)/../../Nullable.props" />
15-
168
<ItemGroup>
179
<ProjectReference Include="..\nunit.engine.api\nunit.engine.api.csproj" />
1810
</ItemGroup>

src/NUnitEngine/nunit.engine.api/nunit.engine.api.csproj

-10
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,12 @@
33
<PropertyGroup>
44
<RootNamespace>NUnit.Engine</RootNamespace>
55
<TargetFrameworks>net462;netstandard2.0</TargetFrameworks>
6-
<OutputPath>$(MSBuildThisFileDirectory)/../../../bin/$(Configuration)</OutputPath>
7-
<SignAssembly>true</SignAssembly>
8-
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)/../../nunit.snk</AssemblyOriginatorKeyFile>
96
<GenerateDocumentationFile>true</GenerateDocumentationFile>
10-
<DebugType>portable</DebugType>
11-
<DebugSymbols>true</DebugSymbols>
127
</PropertyGroup>
138

14-
<Import Project="$(MSBuildThisFileDirectory)/../../Nullable.props" />
15-
169
<PropertyGroup>
17-
<Product>NUnit Engine</Product>
1810
<AssemblyTitle>NUnit Engine API ($(TargetFramework))</AssemblyTitle>
1911
<Description>Defines the interfaces used to access the NUnit Engine</Description>
20-
<AssemblyVersion>3.0.0.0</AssemblyVersion>
21-
<FileVersion>3.99.0.0</FileVersion>
2212
</PropertyGroup>
2313

2414
<ItemGroup>

src/NUnitEngine/nunit.engine.core.tests/nunit.engine.core.tests.csproj

-9
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,9 @@
44
<RootNamespace>NUnit.Engine</RootNamespace>
55
<TargetFrameworks>net462;netcoreapp3.1;net6.0;net8.0</TargetFrameworks>
66
<OutputType>Exe</OutputType>
7-
<OutputPath>../../../bin/$(Configuration)</OutputPath>
8-
<SignAssembly>true</SignAssembly>
9-
<AssemblyOriginatorKeyFile>..\..\nunit.snk</AssemblyOriginatorKeyFile>
10-
<DebugType>Full</DebugType>
11-
<CheckEolTargetFramework>false</CheckEolTargetFramework>
12-
<NoWarn>1505</NoWarn>
137
</PropertyGroup>
148

159
<PropertyGroup>
16-
<Product>NUnit Engine</Product>
1710
<AssemblyTitle>NUnit Engine Core Tests ($(TargetFramework))</AssemblyTitle>
1811
<Description>Tests of nunit.engine.core assembly</Description>
1912
</PropertyGroup>
@@ -22,8 +15,6 @@
2215
<ExposedInternals>true</ExposedInternals>
2316
</PropertyGroup>
2417

25-
<Import Project="$(MSBuildThisFileDirectory)/../../Nullable.props" />
26-
2718
<ItemGroup Condition="'$(TargetFramework)'=='net462' OR '$(TargetFramework)'=='net6.0' OR '$(TargetFramework)'=='net8.0'">
2819
<PackageReference Include="NUnit" Version="4.2.2" />
2920
<PackageReference Include="NUnitLite" Version="4.2.2" />

src/NUnitEngine/nunit.engine.core/Properties/AssemblyInfo.cs

-19
This file was deleted.

0 commit comments

Comments
 (0)