Skip to content

Commit

Permalink
Merge pull request #1617 from nunit/issue-1589
Browse files Browse the repository at this point in the history
Move common settings to Directory.Build.props
  • Loading branch information
CharliePoole authored Jan 31, 2025
2 parents fe96ba5 + a0b3dc0 commit 9ecd7aa
Show file tree
Hide file tree
Showing 29 changed files with 81 additions and 208 deletions.
3 changes: 3 additions & 0 deletions NUnitConsole.sln
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "nunit.common.tests", "src\NUnitEngine\nunit.common.tests\nunit.common.tests.csproj", "{F546CFE1-74B0-45D3-A06A-8972D73F4419}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Extensibility", "Extensibility", "{3B30D2E5-1587-4D68-B848-1BDDB3C24BFC}"
ProjectSection(SolutionItems) = preProject
src\Extensibility\Directory.Build.props = src\Extensibility\Directory.Build.props
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "nunit.extensibility.api", "src\Extensibility\nunit.extensibility.api\nunit.extensibility.api.csproj", "{71DE0F2C-C72B-4CBF-99BE-F2DC0FBEDA24}"
EndProject
Expand Down
7 changes: 2 additions & 5 deletions NuGet.config
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="NUnit AppVeyor CI" value="https://ci.appveyor.com/nuget/nunit" />
<add key="NUnit MyGet Feed" value="https://www.myget.org/F/nunit/api/v3/index.json" />
<add key="NUnit Analyzers MyGet Feed" value="https://www.myget.org/F/nunit-analyzers/api/v3/index.json" protocolVersion="3" />
<add key="nuget.org" value="https://www.nuget.org/api/v2/" />
<add key="api.nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<clear/>
<add key="nuget" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
</packageSources>
</configuration>
30 changes: 22 additions & 8 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,19 +1,33 @@
<!-- Top level Directory.Build.props -->
<Project>

<PropertyGroup>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<!-- Compile and Build Settings -->
<LangVersion>12</LangVersion>
<Features>strict</Features>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<Version Condition="'$(Version)'==''">4.0.0.0</Version>
<OutputPath>$(MSBuildThisFileDirectory)\..\bin\$(Configuration)\</OutputPath>
<CheckEolTargetFramework>false</CheckEolTargetFramework>
<RollForward>Major</RollForward>
<DisableImplicitNuGetFallbackFolder>true</DisableImplicitNuGetFallbackFolder>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<!-- Signing Assemblies -->
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)/nunit.snk</AssemblyOriginatorKeyFile>
<!-- Debugging -->
<DebugType>portable</DebugType>
<DebugSymbols>true</DebugSymbols>
<!-- Commonly Used Package Versions -->
<AnnotatedReferenceAssemblyVersion>8.0.0</AnnotatedReferenceAssemblyVersion>
<!-- Informatinal Settings -->
<Company>NUnit Software</Company>
<Product>NUnit 4 Runner and Engine</Product>
<Copyright>Copyright (c) 2022 Charlie Poole, Rob Prouse</Copyright>
<CheckEolTargetFramework>false</CheckEolTargetFramework>
</PropertyGroup>

<PropertyGroup Condition="'$(Version)'==''">
<AssemblyVersion>3.99.0.0</AssemblyVersion>
<FileVersion>3.99.0.0</FileVersion>
<InformationalVersion>3.99.0.0-VSIDE</InformationalVersion>
<Trademark>NUnit is a trademark of NUnit Software</Trademark>
<!-- Keys for Friend Assemblies -->
<NUnitPublicKey>002400000480000094000000060200000024000052534131000400000100010031eea370b1984bfa6d1ea760e1ca6065cee41a1a279ca234933fe977a096222c0e14f9e5a17d5689305c6d7f1206a85a53c48ca010080799d6eeef61c98abd18767827dc05daea6b6fbd2e868410d9bee5e972a004ddd692dec8fa404ba4591e847a8cf35de21c2d3723bc8d775a66b594adeb967537729fe2a446b548cd57a6</NUnitPublicKey>
<NSubstitutePublicKey>0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7</NSubstitutePublicKey>
</PropertyGroup>

</Project>
7 changes: 7 additions & 0 deletions src/Extensibility/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<!-- Directory.Build.props for Extensibility -->
<Project>

<Import Project="$(MSBuildThisFileDirectory)../Directory.Build.props" />
<Import Project="$(MSBuildThisFileDirectory)../Nullable.props" />

</Project>
4 changes: 0 additions & 4 deletions src/Extensibility/FakeExtensions/FakeExtensions.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,9 @@
<PropertyGroup>
<TargetFrameworks>net462;netstandard2.0</TargetFrameworks>
<RootNamespace>TestCentric.Extensibility</RootNamespace>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\nunit.snk</AssemblyOriginatorKeyFile>
<OutputPath>..\..\..\bin\$(Configuration)\fakes</OutputPath>
</PropertyGroup>

<Import Project="$(MSBuildThisFileDirectory)/../../Nullable.props" />

<ItemGroup>
<ProjectReference Include="..\..\NUnitEngine\nunit.engine.api\nunit.engine.api.csproj" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,8 @@
<PropertyGroup>
<RootNamespace>NUnit.Extensibility</RootNamespace>
<TargetFrameworks>net462;netstandard2.0</TargetFrameworks>
<OutputPath>../../../bin/$(Configuration)</OutputPath>
<!-- TODO: Get rid of obsolete BinaryFormatter -->
<NoWarn>$(NoWarn);SYSLIB0011</NoWarn>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\nunit.snk</AssemblyOriginatorKeyFile>
<DebugType>portable</DebugType>
<DebugSymbols>true</DebugSymbols>
</PropertyGroup>

<Import Project="$(MSBuildThisFileDirectory)/../../Nullable.props" />

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,8 @@
<RootNamespace>NUnit.Extensibility</RootNamespace>
<TargetFrameworks>net462;net8.0</TargetFrameworks>
<OutputType>Exe</OutputType>
<OutputPath>../../../bin/$(Configuration)</OutputPath>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\nunit.snk</AssemblyOriginatorKeyFile>
<DebugType>Full</DebugType>
<CheckEolTargetFramework>false</CheckEolTargetFramework>
<NoWarn>1505</NoWarn>
</PropertyGroup>

<Import Project="$(MSBuildThisFileDirectory)/../../Nullable.props" />

<ItemGroup>
<PackageReference Include="NSubstitute" Version="4.3.0" />
<PackageReference Include="NUnit" Version="4.2.2" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,10 @@
<PropertyGroup>
<RootNamespace>NUnit.Extensibility</RootNamespace>
<TargetFrameworks>net462;netstandard2.0</TargetFrameworks>
<OutputPath>../../../bin/$(Configuration)</OutputPath>
<!-- TODO: Get rid of obsolete BinaryFormatter -->
<NoWarn>$(NoWarn);SYSLIB0011</NoWarn>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\nunit.snk</AssemblyOriginatorKeyFile>
<DebugType>portable</DebugType>
<DebugSymbols>true</DebugSymbols>
</PropertyGroup>

<Import Project="$(MSBuildThisFileDirectory)/../../Nullable.props" />

<ItemGroup>
<PackageReference Include="TestCentric.Metadata" Version="3.0.3" />
</ItemGroup>
Expand Down
7 changes: 7 additions & 0 deletions src/NUnitConsole/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<!-- Directory.Build.props for NUnitConsole -->
<Project>

<Import Project="$(MSBuildThisFileDirectory)../Directory.Build.props" />
<Import Project="$(MSBuildThisFileDirectory)../Nullable.props" />

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
<TargetFrameworks>net462;net8.0</TargetFrameworks>
<OutputType>Exe</OutputType>
<StartupObject>NUnit.Engine.Tests.Program</StartupObject>
<OutputPath>../../../bin/$(Configuration)</OutputPath>
<NoWarn>1685</NoWarn>
<DebugType>Full</DebugType>
</PropertyGroup>

<PropertyGroup>
Expand All @@ -16,18 +13,13 @@
<Description>Tests of the NUnit Console Runner</Description>
</PropertyGroup>

<Import Project="$(MSBuildThisFileDirectory)/../../Nullable.props" />

<ItemGroup>
<PackageReference Include="NUnit" Version="4.2.2" />
<PackageReference Include="NUnitLite" Version="4.2.2" />
<PackageReference Include="System.ComponentModel.TypeConverter" Version="4.3.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.15.1" />
<PackageReference Include="NSubstitute" Version="4.3.0" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="NUnit.Analyzers" Version="4.5.0" />
</ItemGroup>

Expand Down
6 changes: 0 additions & 6 deletions src/NUnitConsole/nunit4-console/Properties/AssemblyInfo.cs

This file was deleted.

11 changes: 5 additions & 6 deletions src/NUnitConsole/nunit4-console/nunit4-console.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,18 @@
<RootNamespace>NUnit.ConsoleRunner</RootNamespace>
<AssemblyName>nunit-console</AssemblyName>
<TargetFrameworks>net462</TargetFrameworks>
<OutputPath>../../../bin/$(Configuration)</OutputPath>
<RollForward>Major</RollForward>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>

<ItemGroup>
<InternalsVisibleTo Include="nunit4-console.tests, PublicKey=$(NUnitPublicKey)" />
<InternalsVisibleTo Include="DynamicProxyGenAssembly2, PublicKey=$(NSubstitutePublicKey)" />
</ItemGroup>

<PropertyGroup>
<Product>NUnit Console Runner</Product>
<AssemblyTitle>NUnit Console Runner ($(TargetFramework))</AssemblyTitle>
<Description>The standard command-line runner for NUnit</Description>
</PropertyGroup>

<Import Project="$(MSBuildThisFileDirectory)/../../Nullable.props" />

<PropertyGroup>
<ApplicationIcon>..\..\..\nunit.ico</ApplicationIcon>
<ApplicationManifest>app.manifest</ApplicationManifest>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
<RootNamespace>NUnit.ConsoleRunner</RootNamespace>
<AssemblyName>nunit-netcore-console</AssemblyName>
<TargetFrameworks>net8.0</TargetFrameworks>
<OutputPath>../../../bin/$(Configuration)</OutputPath>
<RollForward>Major</RollForward>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>

<ItemGroup>
<InternalsVisibleTo Include="nunit4-console.tests, PublicKey=$(NUnitPublicKey)" />
<InternalsVisibleTo Include="DynamicProxyGenAssembly2, PublicKey=$(NSubstitutePublicKey)" />
</ItemGroup>

<PropertyGroup>
<Product>NUnit NetCore Console Runner</Product>
<AssemblyTitle>NUnit NetCore Console Runner ($(TargetFramework))</AssemblyTitle>
<Description>The dotnet command-line runner for NUnit</Description>
</PropertyGroup>
Expand All @@ -34,8 +35,6 @@
<Copyright>Copyright (c) 2022 Charlie Poole, Rob Prouse</Copyright>
</PropertyGroup>

<Import Project="$(MSBuildThisFileDirectory)/../../Nullable.props" />

<PropertyGroup>
<ApplicationIcon>..\..\..\nunit.ico</ApplicationIcon>
<ApplicationManifest>app.manifest</ApplicationManifest>
Expand Down
7 changes: 7 additions & 0 deletions src/NUnitEngine/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<!-- Directory.Build.props for NUnitEngine -->
<Project>

<Import Project="$(MSBuildThisFileDirectory)../Directory.Build.props" />
<Import Project="$(MSBuildThisFileDirectory)../Nullable.props" />

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@
<GenerateSupportedRuntime>False</GenerateSupportedRuntime>
</PropertyGroup>

<Import Project="$(MSBuildThisFileDirectory)/../../../Nullable.props" />

<PropertyGroup>
<Product>NUnit Engine</Product>
<AssemblyTitle>NUnit X86 Agent ($(TargetFramework))</AssemblyTitle>
<Description>Agent used to run X86 tests out of process under .NET framework</Description>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@
<GenerateSupportedRuntime>false</GenerateSupportedRuntime>
</PropertyGroup>

<Import Project="$(MSBuildThisFileDirectory)/../../../Nullable.props" />

<PropertyGroup>
<Product>NUnit Engine</Product>
<AssemblyTitle>NUnit Agent ($(TargetFramework))</AssemblyTitle>
<Description>Agent used to run tests out of process</Description>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,10 @@
<ApplicationManifest>app.manifest</ApplicationManifest>
<ApplicationIcon>..\..\..\..\nunit.ico</ApplicationIcon>
<GenerateSupportedRuntime>false</GenerateSupportedRuntime>
<NoWarn>1505</NoWarn>
<EnableUnsafeBinaryFormatterSerialization>true</EnableUnsafeBinaryFormatterSerialization>
</PropertyGroup>

<Import Project="$(MSBuildThisFileDirectory)/../../../Nullable.props" />

<PropertyGroup>
<Product>NUnit Engine</Product>
<AssemblyTitle>NUnit Agent ($(TargetFramework))</AssemblyTitle>
<Description>Agent used to run tests out of process</Description>
</PropertyGroup>
Expand Down
8 changes: 0 additions & 8 deletions src/NUnitEngine/nunit.common.tests/nunit.common.tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,8 @@
<RootNamespace>NUnit</RootNamespace>
<TargetFrameworks>net462;net8.0</TargetFrameworks>
<OutputType>Exe</OutputType>
<NoWarn>$(NoWarn);618</NoWarn>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\nunit.snk</AssemblyOriginatorKeyFile>
<OutputPath>..\..\..\bin\$(Configuration)\</OutputPath>
<DebugType>portable</DebugType>
<DebugSymbols>true</DebugSymbols>
</PropertyGroup>

<Import Project="$(MSBuildThisFileDirectory)/../../Nullable.props" />

<ItemGroup>
<ProjectReference Include="..\nunit.common\nunit.common.csproj" />
<ProjectReference Include="..\nunit.engine.api\nunit.engine.api.csproj" />
Expand Down
8 changes: 0 additions & 8 deletions src/NUnitEngine/nunit.common/nunit.common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,8 @@
<PropertyGroup>
<RootNamespace>NUnit</RootNamespace>
<TargetFrameworks>net462;netstandard2.0</TargetFrameworks>
<NoWarn>$(NoWarn);618</NoWarn>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\nunit.snk</AssemblyOriginatorKeyFile>
<OutputPath>..\..\bin\$(Configuration)\</OutputPath>
<DebugType>portable</DebugType>
<DebugSymbols>true</DebugSymbols>
</PropertyGroup>

<Import Project="$(MSBuildThisFileDirectory)/../../Nullable.props" />

<ItemGroup>
<ProjectReference Include="..\nunit.engine.api\nunit.engine.api.csproj" />
</ItemGroup>
Expand Down
10 changes: 0 additions & 10 deletions src/NUnitEngine/nunit.engine.api/nunit.engine.api.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,12 @@
<PropertyGroup>
<RootNamespace>NUnit.Engine</RootNamespace>
<TargetFrameworks>net462;netstandard2.0</TargetFrameworks>
<OutputPath>$(MSBuildThisFileDirectory)/../../../bin/$(Configuration)</OutputPath>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)/../../nunit.snk</AssemblyOriginatorKeyFile>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<DebugType>portable</DebugType>
<DebugSymbols>true</DebugSymbols>
</PropertyGroup>

<Import Project="$(MSBuildThisFileDirectory)/../../Nullable.props" />

<PropertyGroup>
<Product>NUnit Engine</Product>
<AssemblyTitle>NUnit Engine API ($(TargetFramework))</AssemblyTitle>
<Description>Defines the interfaces used to access the NUnit Engine</Description>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<FileVersion>3.99.0.0</FileVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,9 @@
<RootNamespace>NUnit.Engine</RootNamespace>
<TargetFrameworks>net462;netcoreapp3.1;net6.0;net8.0</TargetFrameworks>
<OutputType>Exe</OutputType>
<OutputPath>../../../bin/$(Configuration)</OutputPath>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\nunit.snk</AssemblyOriginatorKeyFile>
<DebugType>Full</DebugType>
<CheckEolTargetFramework>false</CheckEolTargetFramework>
<NoWarn>1505</NoWarn>
</PropertyGroup>

<PropertyGroup>
<Product>NUnit Engine</Product>
<AssemblyTitle>NUnit Engine Core Tests ($(TargetFramework))</AssemblyTitle>
<Description>Tests of nunit.engine.core assembly</Description>
</PropertyGroup>
Expand All @@ -22,8 +15,6 @@
<ExposedInternals>true</ExposedInternals>
</PropertyGroup>

<Import Project="$(MSBuildThisFileDirectory)/../../Nullable.props" />

<ItemGroup Condition="'$(TargetFramework)'=='net462' OR '$(TargetFramework)'=='net6.0' OR '$(TargetFramework)'=='net8.0'">
<PackageReference Include="NUnit" Version="4.2.2" />
<PackageReference Include="NUnitLite" Version="4.2.2" />
Expand Down
19 changes: 0 additions & 19 deletions src/NUnitEngine/nunit.engine.core/Properties/AssemblyInfo.cs

This file was deleted.

Loading

0 comments on commit 9ecd7aa

Please sign in to comment.