Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nuget Centralized Package Management #16

Merged
merged 3 commits into from
Feb 2, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
# The remote certificate is invalid because of errors in the certificate chain: UntrustedRoot
apt install --yes --no-install-recommends ca-certificates

apt install --yes --no-install-recommends dotnet6
apt install --yes --no-install-recommends dotnet7

- name: Compile the main solution
run: dotnet build
Expand Down
16 changes: 16 additions & 0 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!-- 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

TODO: when upgrading to .NET8.0, we can simply use <PackageReference Include="FSharp.Core" VersionOverride="7.0.0" /> for example, and it
just works (example of a project that works today this way: fantomas)
-->
<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="6.0.1" />
</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="6.0.1" />
<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>
13 changes: 6 additions & 7 deletions src/FX.Tests/FX.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="NUnit" Version="3.9.0" />
<PackageReference Include="FSharp.Core" Version="6.0.1" />
<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.*" />
<PackageReference Include="Giraffe" Version="3.1.0" />
<PackageReference Include="Giraffe.Razor" Version="1.3.*" />
<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>
Loading