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
5 changes: 3 additions & 2 deletions Funcky.Async/Funcky.Async.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net9.0;net8.0;net5.0;netstandard2.1;netstandard2.0</TargetFrameworks>
<FunckyNewestTargetFramework>net9.0</FunckyNewestTargetFramework>
<TargetFrameworks>$(FunckyNewestTargetFramework);net8.0;net5.0;netstandard2.1;netstandard2.0</TargetFrameworks>
<LangVersion>preview</LangVersion>
<Nullable>enable</Nullable>
<Description>Extends Funcky with support for IAsyncEnumerable and Tasks.</Description>
Expand Down Expand Up @@ -43,7 +44,6 @@
<Compile Include="..\Funcky\Internal\PartitionBuilder.cs" Link="Internal\PartitionBuilder.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" PrivateAssets="all" Condition="'$(TargetFramework)' == 'net5.0'" />
<PackageReference Include="PolySharp" PrivateAssets="all" />
<PackageReference Include="Polyadic.Build.SemanticVersioning" PrivateAssets="all" />
<PackageReference Include="System.Linq.Async" />
Expand All @@ -58,4 +58,5 @@
<Import Project="..\Analyzers.props" />
<Import Project="..\GlobalUsings.props" />
<Import Project="..\FrameworkFeatureConstants.props" />
<Import Project="..\PublicApiAnalyzers.targets" />
</Project>
5 changes: 3 additions & 2 deletions Funcky.Xunit.v3/Funcky.Xunit.v3.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;net6.0</TargetFrameworks>
<FunckyNewestTargetFramework>net6.0</FunckyNewestTargetFramework>
<TargetFrameworks>$(FunckyNewestTargetFramework);netstandard2.0</TargetFrameworks>
<LangVersion>preview</LangVersion>
<Nullable>enable</Nullable>
<Description>Package to use Funcky with xUnit v3</Description>
Expand Down Expand Up @@ -36,7 +37,6 @@
<PackageReference Include="Polyadic.Build.SemanticVersioning" PrivateAssets="all" />
<PackageReference Include="xunit.v3.assert" />
<PackageReference Include="xunit.v3.extensibility.core" />
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" PrivateAssets="all" Condition="'$(TargetFramework)' == 'net6.0'" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="../Funcky/Funcky.csproj" />
Expand All @@ -46,4 +46,5 @@
</ItemGroup>
<Import Project="..\Analyzers.props" />
<Import Project="..\GlobalUsings.props" />
<Import Project="..\PublicApiAnalyzers.targets" />
</Project>
5 changes: 3 additions & 2 deletions Funcky.Xunit/Funcky.Xunit.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;net6.0</TargetFrameworks>
<FunckyNewestTargetFramework>net6.0</FunckyNewestTargetFramework>
<TargetFrameworks>$(FunckyNewestTargetFramework);netstandard2.0</TargetFrameworks>
<LangVersion>preview</LangVersion>
<Nullable>enable</Nullable>
<Description>Package to use Funcky with xUnit</Description>
Expand All @@ -24,7 +25,6 @@
<PackageReference Include="Polyadic.Build.SemanticVersioning" PrivateAssets="all" />
<PackageReference Include="xunit.assert" />
<PackageReference Include="xunit.extensibility.core" />
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" PrivateAssets="all" Condition="'$(TargetFramework)' == 'net6.0'" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="../Funcky/Funcky.csproj" />
Expand All @@ -35,4 +35,5 @@
</ItemGroup>
<Import Project="..\Analyzers.props" />
<Import Project="..\GlobalUsings.props" />
<Import Project="..\PublicApiAnalyzers.targets" />
</Project>
1 change: 1 addition & 0 deletions Funcky.sln
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build Config", "Build Confi
GlobalUsings.Test.props = GlobalUsings.Test.props
NuGet.config = NuGet.config
typos.toml = typos.toml
PublicApiAnalyzers.targets = PublicApiAnalyzers.targets
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Funcky.Xunit", "Funcky.Xunit\Funcky.Xunit.csproj", "{F2E98B0D-CC17-4576-89DE-065FF475BE6E}"
Expand Down
11 changes: 3 additions & 8 deletions Funcky/Funcky.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net9.0;net8.0;net7.0;net6.0;net5.0;netcoreapp3.1;netstandard2.0;netstandard2.1</TargetFrameworks>
<FunckyNewestTargetFramework>net9.0</FunckyNewestTargetFramework>
<TargetFrameworks>$(FunckyNewestTargetFramework);net8.0;net7.0;net6.0;net5.0;netcoreapp3.1;netstandard2.0;netstandard2.1</TargetFrameworks>
<LangVersion>preview</LangVersion>
<Nullable>enable</Nullable>
<Product>Funcky</Product>
Expand All @@ -20,10 +21,8 @@
</PropertyGroup>
<PropertyGroup>
<DefineConstants>$(DefineConstants);CONTRACTS_FULL</DefineConstants>
<TargetFrameworkForPublicApiAnalyzers>net9.0</TargetFrameworkForPublicApiAnalyzers>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" PrivateAssets="all" Condition="'$(TargetFramework)' == '$(TargetFrameworkForPublicApiAnalyzers)'" />
<PackageReference Include="Microsoft.Bcl.HashCode" Condition="'$(TargetFramework)' == 'netstandard2.0'" />
<PackageReference Include="PolySharp" PrivateAssets="all" />
<PackageReference Include="System.Collections.Immutable" Condition="'$(TargetFramework)' == 'netstandard2.0' Or '$(TargetFramework)' == 'netstandard2.1'" />
Expand All @@ -34,11 +33,6 @@
<ItemGroup>
<ProjectReference Include="..\Funcky.SourceGenerator\Funcky.SourceGenerator.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" PrivateAssets="all" />
</ItemGroup>
<!-- These files are included by Microsoft.CodeAnalysis.PublicApiAnalyzers is included. -->
<ItemGroup Condition="'$(TargetFramework)' != '$(TargetFrameworkForPublicApiAnalyzers)'">
<AdditionalFiles Include="PublicAPI.Shipped.txt" />
<AdditionalFiles Include="PublicAPI.Unshipped.txt" />
</ItemGroup>
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">
<IsTrimmable>true</IsTrimmable>
<EnableTrimAnalyzer>true</EnableTrimAnalyzer>
Expand All @@ -63,4 +57,5 @@
<Import Project="..\Analyzers.props" />
<Import Project="..\GlobalUsings.props" />
<Import Project="..\FrameworkFeatureConstants.props" />
<Import Project="..\PublicApiAnalyzers.targets" />
</Project>
24 changes: 24 additions & 0 deletions PublicApiAnalyzers.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- We intentionally only include the public API analyzers for the newest target
framework because we often add APIs in newer target frameworks
that we don't add for older target frameworks. -->
<ItemGroup Condition="'$(TargetFramework)' == '$(FunckyNewestTargetFramework)'">
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" PrivateAssets="all" />
</ItemGroup>
<!-- These files are included by Microsoft.CodeAnalysis.PublicApiAnalyzers if it is enabled. -->
<ItemGroup Condition="'$(TargetFramework)' != '$(FunckyNewestTargetFramework)'">
<AdditionalFiles Include="PublicAPI.Shipped.txt" />
<AdditionalFiles Include="PublicAPI.Unshipped.txt" />
</ItemGroup>
<PropertyGroup>
<CoreCompileDependsOn>$(CoreCompileDependsOn);_ValidateFunckyNewestTargetFrameworkIsSet</CoreCompileDependsOn>
</PropertyGroup>
<Target Name="_ValidateFunckyNewestTargetFrameworkIsSet" Condition="'$(FunckyNewestTargetFramework)' == ''">
<PropertyGroup>
<_Text>The 'FunckyNewestTargetFramework' property is not set; public API analyzers will not run</_Text>
</PropertyGroup>
<Warning Text="$(_Text)" File="$(MSBuildProjectFullPath)" Condition="'$(TreatWarningsAsErrors)' != 'true'" />
<Error Text="$(_Text)" File="$(MSBuildProjectFullPath)" Condition="'$(TreatWarningsAsErrors)' == 'true'" />
</Target>
</Project>