Skip to content

Commit

Permalink
Merge pull request #695 from polyadic/cpm
Browse files Browse the repository at this point in the history
Use Central Package Management
  • Loading branch information
bash authored Nov 9, 2022
2 parents 2b2508e + 1ef7acd commit 766fc4d
Show file tree
Hide file tree
Showing 25 changed files with 86 additions and 80 deletions.
40 changes: 40 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<ItemGroup Label="Runtime Dependencies">
<PackageVersion Include="Microsoft.Bcl.HashCode" Version="1.1.1" />
<PackageVersion Include="System.Collections.Immutable" Version="1.7.1" />
<PackageVersion Include="System.Text.Json" Version="5.0.0" />
<PackageVersion Include="xunit.assert" Version="[2.4.0, 3)" />
<PackageVersion Include="xunit.extensibility.core" Version="[2.4.0, 3)" />
<PackageVersion Include="System.Linq.Async" Version="[5.0.0, 7)" />
</ItemGroup>
<ItemGroup Label="Build Dependencies">
<PackageVersion Include="IsExternalInit" Version="1.0.2" />
<PackageVersion Include="Messerli.CodeStyle" Version="2.2.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="3.3.3" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="1.1.1" />
<PackageVersion Include="Nullable" Version="1.3.0" />
</ItemGroup>
<ItemGroup Label="Test Dependencies">
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.2.0" />
<PackageVersion Include="xunit" Version="2.4.2" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.4.5" />
<PackageVersion Include="FsCheck.Xunit" Version="2.16.4" />
<PackageVersion Include="coverlet.collector" Version="3.1.2" />
<PackageVersion Include="Verify.XUnit" Version="16.8.1" />
<PackageVersion Include="Verify.SourceGenerators" Version="1.4.0" />
</ItemGroup>
<ItemGroup Label="Analyzer">
<PackageVersion Include="Microsoft.CodeAnalysis" Version="4.0.1" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.0.1" />
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.3" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Analyzer.Testing.XUnit" Version="1.1.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.CodeFix.Testing.XUnit" Version="1.1.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.CodeRefactoring.Testing.XUnit" Version="1.1.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.0.1" />
<PackageVersion Include="Microsoft.VSSDK.BuildTools" Version="17.0.1597"/>
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk; Microsoft.Build.CentralPackageVersions">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk; Microsoft.Build.CentralPackageVersions">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<LangVersion>preview</LangVersion>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk; Microsoft.Build.CentralPackageVersions">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<Import Sdk="Microsoft.NET.Sdk" Project="Sdk.props" />
<Import Sdk="Microsoft.Build.CentralPackageVersions" Project="Sdk.props" />

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
Expand Down Expand Up @@ -47,6 +46,4 @@
<!-- https://github.com/Microsoft/extendvs/issues/57 -->
<ProjectReference Update="@(ProjectReference)" Name="%(Filename)" />
</ItemGroup>

<Import Sdk="Microsoft.Build.CentralPackageVersions" Project="Sdk.targets" />
</Project>
</Project>
2 changes: 1 addition & 1 deletion Funcky.Analyzers/Funcky.Analyzers/Funcky.Analyzers.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk; Microsoft.Build.CentralPackageVersions">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk; Microsoft.Build.CentralPackageVersions">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<IsPackable>false</IsPackable>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,20 +75,21 @@ public async Task GivenAnEnumerableNotAMultipleOfSizeWeHaveASmallerLastSlice()

const int chunkSize = 4;
var chunked = numbers.Chunk(chunkSize);
var count = await numbers.CountAsync();

await AsyncAssert.Collection(
chunked,
a =>
{
Assert.Equal(a.Count, chunkSize);
Assert.Equal(chunkSize, a.Count);
},
b =>
{
Assert.Equal(b.Count, chunkSize);
Assert.Equal(chunkSize, b.Count);
},
async c =>
c =>
{
Assert.Equal(c.Count, await numbers.CountAsync() % chunkSize);
Assert.Equal(count % chunkSize, c.Count);
});
}

Expand Down
2 changes: 1 addition & 1 deletion Funcky.Async.Test/Funcky.Async.Test.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk; Microsoft.Build.CentralPackageVersions">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<LangVersion>preview</LangVersion>
Expand Down
2 changes: 1 addition & 1 deletion Funcky.Async/Funcky.Async.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk; Microsoft.Build.CentralPackageVersions">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net5.0;netstandard2.1;netstandard2.0</TargetFrameworks>
<LangVersion>preview</LangVersion>
Expand Down
6 changes: 5 additions & 1 deletion Funcky.FsCheck/Funcky.FsCheck.fsproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk; Microsoft.Build.CentralPackageVersions">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;net6.0</TargetFrameworks>
<IsPackable>false</IsPackable>
Expand All @@ -13,5 +13,9 @@
<ItemGroup>
<Compile Include="FunckyGenerators.fs" />
</ItemGroup>
<ItemGroup>
<PackageReference Update="FSharp.Core" IsImplicitlyDefined="true" Condition="'$(MSBuildProjectExtension)' == '.fsproj'" />
<PackageReference Update="System.ValueTuple" IsImplicitlyDefined="true" Condition="'$(MSBuildProjectExtension)' == '.fsproj'" />
</ItemGroup>
<Import Project="..\FrameworkFeatureConstants.props" />
</Project>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk; Microsoft.Build.CentralPackageVersions">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<AssemblyName>Funcky.SourceGenerator.Test</AssemblyName>
Expand Down
2 changes: 1 addition & 1 deletion Funcky.SourceGenerator/Funcky.SourceGenerator.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk; Microsoft.Build.CentralPackageVersions">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AssemblyName>Funcky.SourceGenerator</AssemblyName>
<RootNamespace>Funcky.SourceGenerator</RootNamespace>
Expand Down
2 changes: 1 addition & 1 deletion Funcky.Test.Internal/Funcky.Test.Internal.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk; Microsoft.Build.CentralPackageVersions">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<LangVersion>preview</LangVersion>
Expand Down
6 changes: 3 additions & 3 deletions Funcky.Test/Extensions/EnumerableExtensions/ChunkTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,15 @@ public void GivenAnEnumerableNotAMultipleOfSizeWeHaveASmallerLastSlice()
chunked,
a =>
{
Assert.Equal(a.Count, chunkSize);
Assert.Equal(chunkSize, a.Count);
},
b =>
{
Assert.Equal(b.Count, chunkSize);
Assert.Equal(chunkSize, b.Count);
},
c =>
{
Assert.Equal(c.Count, numbers.Count() % chunkSize);
Assert.Equal(numbers.Count % chunkSize, c.Count);
});
}

Expand Down
22 changes: 11 additions & 11 deletions Funcky.Test/Extensions/ParseExtensionsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public void GivenAStringParseEnumOrNoneReturnsTheCorrectValue(Option<MyEnum> exp
Assert.Equal(expected, input.ParseEnumOrNone<MyEnum>());
}

private static TheoryData<Option<bool>, string> BooleanStrings()
public static TheoryData<Option<bool>, string> BooleanStrings()
=> new()
{
{ Option<bool>.None, string.Empty },
Expand All @@ -105,7 +105,7 @@ private static TheoryData<Option<bool>, string> BooleanStrings()
{ Option<bool>.None, "none" },
};

private static TheoryData<Option<byte>, string> ByteStrings()
public static TheoryData<Option<byte>, string> ByteStrings()
=> new()
{
{ Option<byte>.None, string.Empty },
Expand All @@ -119,7 +119,7 @@ private static TheoryData<Option<byte>, string> ByteStrings()
{ Option<byte>.None, "1337E+02" },
};

private static TheoryData<Option<short>, string> ShortStrings()
public static TheoryData<Option<short>, string> ShortStrings()
=> new()
{
{ Option<short>.None, string.Empty },
Expand All @@ -134,7 +134,7 @@ private static TheoryData<Option<short>, string> ShortStrings()
{ Option<short>.None, "1337E+02" },
};

private static TheoryData<Option<int>, string> IntStrings()
public static TheoryData<Option<int>, string> IntStrings()
=> new()
{
{ Option<int>.None, string.Empty },
Expand All @@ -149,7 +149,7 @@ private static TheoryData<Option<int>, string> IntStrings()
{ Option<int>.None, "1337E+02" },
};

private static TheoryData<Option<long>, string> LongStrings()
public static TheoryData<Option<long>, string> LongStrings()
=> new()
{
{ Option<long>.None, string.Empty },
Expand All @@ -164,7 +164,7 @@ private static TheoryData<Option<long>, string> LongStrings()
{ Option<long>.None, "1337E+02" },
};

private static TheoryData<Option<float>, string> FloatStrings()
public static TheoryData<Option<float>, string> FloatStrings()
=> new()
{
{ Option<float>.None, string.Empty },
Expand All @@ -180,7 +180,7 @@ private static TheoryData<Option<float>, string> FloatStrings()
{ Option<float>.None, "1337F" },
};

private static TheoryData<Option<double>, string> DoubleStrings()
public static TheoryData<Option<double>, string> DoubleStrings()
=> new()
{
{ Option<double>.None, string.Empty },
Expand All @@ -196,8 +196,8 @@ private static TheoryData<Option<double>, string> DoubleStrings()
{ Option<double>.None, "1337D" },
};

private static TheoryData<Option<decimal>, string> DecimalStrings()
=> new()
public static TheoryData<Option<decimal>, string> DecimalStrings()
=> new()
{
{ Option<decimal>.None, string.Empty },
{ Option<decimal>.None, "no number" },
Expand All @@ -212,7 +212,7 @@ private static TheoryData<Option<decimal>, string> DecimalStrings()
{ Option<decimal>.None, "1337M" },
};

private static TheoryData<Option<DateTime>, string> DateTimeStrings()
public static TheoryData<Option<DateTime>, string> DateTimeStrings()
=> new()
{
{ Option<DateTime>.None, string.Empty },
Expand All @@ -224,7 +224,7 @@ private static TheoryData<Option<DateTime>, string> DateTimeStrings()
{ Option<DateTime>.None, "MCMI" },
};

private static TheoryData<Option<MyEnum>, string> EnumStrings()
public static TheoryData<Option<MyEnum>, string> EnumStrings()
=> new()
{
{ Option<MyEnum>.None, string.Empty },
Expand Down
2 changes: 1 addition & 1 deletion Funcky.Test/Funcky.Test.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk; Microsoft.Build.CentralPackageVersions">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net7.0;net6.0;net5.0;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' == 'Windows_NT'">$(TargetFrameworks);net4.8</TargetFrameworks>
Expand Down
2 changes: 1 addition & 1 deletion Funcky.TrimmingTest/Funcky.TrimmingTest.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk; Microsoft.Build.CentralPackageVersions">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
Expand Down
2 changes: 1 addition & 1 deletion Funcky.Xunit.Test/Funcky.Xunit.Test.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk; Microsoft.Build.CentralPackageVersions">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<LangVersion>preview</LangVersion>
Expand Down
2 changes: 1 addition & 1 deletion Funcky.Xunit/Funcky.Xunit.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk; Microsoft.Build.CentralPackageVersions">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;net6.0</TargetFrameworks>
<LangVersion>preview</LangVersion>
Expand Down
2 changes: 1 addition & 1 deletion Funcky.sln
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build Config", "Build Confi
GlobalUsings.props = GlobalUsings.props
GlobalUsings.Test.props = GlobalUsings.Test.props
NuGet.config = NuGet.config
Packages.props = Packages.props
Directory.Packages.props = Directory.Packages.props
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Funcky.Xunit", "Funcky.Xunit\Funcky.Xunit.csproj", "{F2E98B0D-CC17-4576-89DE-065FF475BE6E}"
Expand Down
2 changes: 1 addition & 1 deletion Funcky/Funcky.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk; Microsoft.Build.CentralPackageVersions">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net7.0;net6.0;net5.0;netcoreapp3.1;netstandard2.0;netstandard2.1</TargetFrameworks>
<LangVersion>preview</LangVersion>
Expand Down
6 changes: 5 additions & 1 deletion NuGet.config
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
<clear />

<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
<add key="myget.org/xunit" value="https://www.myget.org/F/xunit/api/v3/index.json" />
</packageSources>
<packageSourceMapping>
<packageSource key="nuget.org">
<package pattern="*" />
</packageSource>
</packageSourceMapping>
</configuration>
37 changes: 0 additions & 37 deletions Packages.props

This file was deleted.

3 changes: 0 additions & 3 deletions global.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,5 @@
"sdk": {
"version": "7.0.100-rc.2.22477.23",
"rollForward": "feature"
},
"msbuild-sdks": {
"Microsoft.Build.CentralPackageVersions" : "2.0.79"
}
}

0 comments on commit 766fc4d

Please sign in to comment.