Skip to content

Commit

Permalink
split Directory.Build file into two dedicated files, one for src (pac…
Browse files Browse the repository at this point in the history
…kages) and one for test projects
  • Loading branch information
adamsitnik committed Apr 2, 2024
1 parent 14256f3 commit ee70752
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 69 deletions.
69 changes: 0 additions & 69 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,87 +2,18 @@
<Import Project="build/versions.props" />

<PropertyGroup>
<PackageId>AspNetCore.$(MSBuildProjectName)</PackageId>
<PackageIcon>icon.png</PackageIcon>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks</PackageProjectUrl>
<RepositoryUrl>https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks</RepositoryUrl>
<Authors>Xabaril Contributors</Authors>
<Company>Xabaril</Company>
<LangVersion>latest</LangVersion>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<ImplicitUsings>enable</ImplicitUsings>
<RepositoryType>git</RepositoryType>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<Deterministic>true</Deterministic>
<ContinuousIntegrationBuild Condition="'$(GITHUB_ACTIONS)' == 'true'">True</ContinuousIntegrationBuild>
<DebugType>embedded</DebugType>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<Nullable>enable</Nullable>
<PackageTags>HealthCheck;HealthChecks;Health</PackageTags>
<NoWarn>$(NoWarn);1591;IDISP013;AD0001;</NoWarn> <!--TODO: temporary solution, remove AD0001 after https://github.com/dotnet/aspnetcore/issues/50836 fixed-->
<CheckEolTargetFramework>false</CheckEolTargetFramework>
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
<PackageReadmeFile Condition="Exists('README.md')">README.md</PackageReadmeFile>
<NuGetAuditLevel>critical</NuGetAuditLevel> <!-- TODO: remove-->
</PropertyGroup>

<ItemGroup>
<None Condition="Exists('README.md')" Include="README.md" Pack="true" PackagePath="\" />
</ItemGroup>

<PropertyGroup Condition="$(MSBuildProjectName.EndsWith('.Tests'))">
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<NoWarn>$(NoWarn);IDE1006;RCS1090</NoWarn>
<WarningsNotAsErrors>$(WarningsNotAsErrors);IDE0053;IDE0060</WarningsNotAsErrors>
</PropertyGroup>

<PropertyGroup Condition="!$(MSBuildProjectName.EndsWith('.Tests')) AND '$(Configuration)' == 'Release' AND !$(MSBuildProjectName.StartsWith('HealthChecks.UI')) AND !$(MSBuildProjectName.Contains('Sample'))">
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)build/strongNameKey.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
</PropertyGroup>

<ItemGroup Condition="!$(MSBuildProjectName.EndsWith('.Tests')) AND '$(SignAssembly)' != 'true' ">
<InternalsVisibleTo Include="$(MSBuildProjectName).Tests" />
</ItemGroup>

<ItemGroup Condition="$(MSBuildProjectName.EndsWith('.Tests'))">
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="6.0.21" Condition="'$(TargetFramework)' == 'net6.0'" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="7.0.10" Condition="'$(TargetFramework)' == 'net7.0'" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="8.0.0" Condition="'$(TargetFramework)' == 'net8.0'" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
<PackageReference Include="Shouldly" Version="4.2.1" />
<PackageReference Include="NSubstitute" Version="5.1.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit" Version="2.6.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.4" />
<PackageReference Include="PublicApiGenerator" Version="11.0.0" />
<PackageReference Include="coverlet.collector" Version="6.0.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>

<ProjectReference Include="..\..\src\HealthChecks.UI.Client\HealthChecks.UI.Client.csproj" />

<Compile Include="../_SHARED/ApiApprovalTests.cs" Link="ApiApprovalTests.cs" Visible="false" Condition="'$(TargetFramework)' == 'net8.0'" />
<Compile Include="../_SHARED/TestLogger.cs" Link="TestLogger.cs" Visible="false" />
<Compile Include="../_SHARED/TestLoggerProvider.cs" Link="TestLoggerProvider.cs" Visible="false" />
<Compile Include="../_SHARED/ConformanceTests.cs" Link="ConformanceTests.cs" Visible="false" />

<Using Include="Microsoft.AspNetCore.Diagnostics.HealthChecks" />
<Using Include="Microsoft.AspNetCore.Hosting" />
<Using Include="Microsoft.AspNetCore.Builder" />
<Using Include="Microsoft.AspNetCore.TestHost" />
<Using Include="Microsoft.Extensions.DependencyInjection" />
<Using Include="Microsoft.Extensions.Diagnostics.HealthChecks" />
<Using Include="Microsoft.Extensions.Options" />
<Using Include="Shouldly" />
<Using Include="Xunit" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Roslynator.Analyzers" Version="4.7.0">
<PrivateAssets>all</PrivateAssets>
Expand Down
29 changes: 29 additions & 0 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,10 +1,39 @@
<Project>

<Import Project="..\Directory.Build.props" />

<PropertyGroup>
<PackageId>AspNetCore.$(MSBuildProjectName)</PackageId>
<PackageIcon>icon.png</PackageIcon>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks</PackageProjectUrl>
<RepositoryUrl>https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks</RepositoryUrl>
<Authors>Xabaril Contributors</Authors>
<Company>Xabaril</Company>
<RepositoryType>git</RepositoryType>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<PackageTags>HealthCheck;HealthChecks;Health</PackageTags>
<NoWarn>$(NoWarn);1591;IDISP013;AD0001;</NoWarn> <!--TODO: temporary solution, remove AD0001 after https://github.com/dotnet/aspnetcore/issues/50836 fixed-->
<CheckEolTargetFramework>false</CheckEolTargetFramework>
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
<PackageReadmeFile Condition="Exists('README.md')">README.md</PackageReadmeFile>
<NuGetAuditLevel>critical</NuGetAuditLevel> <!-- TODO: remove-->
</PropertyGroup>

<PropertyGroup>
<DefaultNetCoreApp>net6.0</DefaultNetCoreApp>
<DefaultLibraryTargetFrameworks>$(DefaultNetCoreApp);netstandard2.0</DefaultLibraryTargetFrameworks>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)' == 'Release' AND !$(MSBuildProjectName.StartsWith('HealthChecks.UI'))">
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)../build/strongNameKey.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
</PropertyGroup>

<ItemGroup>
<None Condition="Exists('README.md')" Include="README.md" Pack="true" PackagePath="\" />
<InternalsVisibleTo Include="$(MSBuildProjectName).Tests" Condition="'$(SignAssembly)' != 'true'"/>
</ItemGroup>

</Project>
46 changes: 46 additions & 0 deletions test/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<Project>

<Import Project="..\Directory.Build.props" />

<PropertyGroup>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<NoWarn>$(NoWarn);IDE1006;RCS1090</NoWarn>
<WarningsNotAsErrors>$(WarningsNotAsErrors);IDE0053;IDE0060</WarningsNotAsErrors>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="6.0.21" Condition="'$(TargetFramework)' == 'net6.0'" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="7.0.10" Condition="'$(TargetFramework)' == 'net7.0'" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="8.0.0" Condition="'$(TargetFramework)' == 'net8.0'" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
<PackageReference Include="Shouldly" Version="4.2.1" />
<PackageReference Include="NSubstitute" Version="5.1.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit" Version="2.6.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.4" />
<PackageReference Include="PublicApiGenerator" Version="11.0.0" />
<PackageReference Include="coverlet.collector" Version="6.0.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>

<ProjectReference Include="..\..\src\HealthChecks.UI.Client\HealthChecks.UI.Client.csproj" />

<Compile Include="../_SHARED/ApiApprovalTests.cs" Link="ApiApprovalTests.cs" Visible="false" Condition="'$(TargetFramework)' == 'net8.0'" />
<Compile Include="../_SHARED/TestLogger.cs" Link="TestLogger.cs" Visible="false" />
<Compile Include="../_SHARED/TestLoggerProvider.cs" Link="TestLoggerProvider.cs" Visible="false" />
<Compile Include="../_SHARED/ConformanceTests.cs" Link="ConformanceTests.cs" Visible="false" />

<Using Include="Microsoft.AspNetCore.Diagnostics.HealthChecks" />
<Using Include="Microsoft.AspNetCore.Hosting" />
<Using Include="Microsoft.AspNetCore.Builder" />
<Using Include="Microsoft.AspNetCore.TestHost" />
<Using Include="Microsoft.Extensions.DependencyInjection" />
<Using Include="Microsoft.Extensions.Diagnostics.HealthChecks" />
<Using Include="Microsoft.Extensions.Options" />
<Using Include="Shouldly" />
<Using Include="Xunit" />
</ItemGroup>

</Project>

0 comments on commit ee70752

Please sign in to comment.