Skip to content

Commit

Permalink
Nuget Centralized Package Management
Browse files Browse the repository at this point in the history
In order to have version numbers for all projects
in a single file (and this way avoiding the problem
of depending on more than one version for the same
package).
  • Loading branch information
knocte committed Feb 2, 2024
1 parent ee69be3 commit a49b020
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 15 deletions.
10 changes: 10 additions & 0 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!-- Workaround for Central Package Management taken from
https://github.com/NuGet/Home/issues/11949 and
https://github.com/microsoft/MSBuildSdks/blob/22cee25ad037827b54b75b6ee1c59a5bc75a744f/src/CentralPackageVersions/Sdk/Sdk.targets#L70-L76 -->
<Project>
<ItemGroup Condition=" '$(EnableCentralPackageVersions)' != 'false' ">
<PackageReference Update="FSharp.Core"
Condition="'$(MSBuildProjectExtension)' == '.fsproj' And '$(DisableImplicitFSharpCoreReference)' != 'true' And '$(UpdateImplicitFSharpCoreReference)' != 'false'"
IsImplicitlyDefined="true" />
</ItemGroup>
</Project>
17 changes: 17 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="StackExchange.Redis" Version="2.0.513" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
<PackageVersion Include="NUnit" Version="3.9.0" />
<PackageVersion Include="NUnit3TestAdapter" Version="3.9.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="15.8.0" />
<PackageVersion Include="Microsoft.AspNetCore.App" Version="2.1.34" />
<PackageVersion Include="Giraffe" Version="3.1.0" />
<PackageVersion Include="Giraffe.Razor" Version="1.3.0" />
<PackageVersion Include="Microsoft.AspNetCore.WebSockets" Version="2.1.1" />
<PackageVersion Include="TaskBuilder.fs" Version="2.1.0" />
</ItemGroup>
</Project>
1 change: 0 additions & 1 deletion src/FX.Console/FX.Console.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,5 @@

<ItemGroup>
<ProjectReference Include="..\FX.Core\FX.Core.fsproj" />
<PackageReference Include="FSharp.Core" Version="7.0.0" />
</ItemGroup>
</Project>
5 changes: 2 additions & 3 deletions src/FX.Core/FX.Core.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
<Compile Include="Exchange.fs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="FSharp.Core" Version="7.0.0" />
<PackageReference Include="StackExchange.Redis" Version="2.0.513" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="StackExchange.Redis" />
<PackageReference Include="Newtonsoft.Json" />
</ItemGroup>
</Project>
11 changes: 5 additions & 6 deletions src/FX.Tests/FX.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="NUnit" Version="3.9.0" />
<PackageReference Include="FSharp.Core" Version="7.0.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.9.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.8.0" />
<PackageReference Include="StackExchange.Redis" Version="2.0.513" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="NUnit" />
<PackageReference Include="NUnit3TestAdapter" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="StackExchange.Redis" />
<PackageReference Include="Newtonsoft.Json" />
</ItemGroup>
<ItemGroup>
<Compile Remove="Class1.cs" />
Expand Down
10 changes: 5 additions & 5 deletions src/WebSocketApp/WebSocketApp.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
<Compile Include="Middleware\WebSocketMiddleware.fs" />
<Compile Include="Program.fs" />
<None Include="web.config" CopyToOutputDirectory="PreserveNewest" />
<PackageReference Include="Microsoft.AspNetCore.App" Version="2.1.34" />
<PackageReference Include="Giraffe" Version="3.1.0" />
<PackageReference Include="Giraffe.Razor" Version="1.3.0" />
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Giraffe" />
<PackageReference Include="Giraffe.Razor" />
<Watch Include="**\*.cshtml" Exclude="bin\**\*" />
<PackageReference Include="Microsoft.AspNetCore.WebSockets" Version="2.1.1" />
<PackageReference Include="TaskBuilder.fs" Version="2.1.0" />
<PackageReference Include="Microsoft.AspNetCore.WebSockets" />
<PackageReference Include="TaskBuilder.fs" />
<ProjectReference Include="..\FX.Core\FX.Core.fsproj" />
</ItemGroup>
</Project>

0 comments on commit a49b020

Please sign in to comment.