Use centralized package management

Refactor project files to use Directory.Packages.props for centralized NuGet package management, making dependency updates easier and more consistent across projects. Removed explicit version specifications from individual project files.

Signed-off-by: Ivandro Jao <Ivandrofly@gmail.com>
This commit is contained in:
Ivandro Jao 2024-09-03 14:49:11 +01:00
parent d882c7a0b3
commit f5392b2394
4 changed files with 36 additions and 13 deletions

20
Directory.Packages.props Normal file
View File

@ -0,0 +1,20 @@
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="Microsoft.Net.Http" Version="2.2.29"/>
<PackageVersion Include="Microsoft.Win32.Registry" Version="5.0.0"/>
<PackageVersion Include="NAudio.Core" Version="2.2.1"/>
<PackageVersion Include="NAudio.WinMM" Version="2.2.1"/>
<PackageVersion Include="ncalc" Version="1.3.8"/>
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3"/>
<PackageVersion Include="NHunspell" Version="1.2.5554.16953"/>
<PackageVersion Include="System.Security.AccessControl" Version="6.0.1"/>
<PackageVersion Include="System.Security.Principal.Windows" Version="5.0.0"/>
<PackageVersion Include="Vosk" Version="0.3.38"/>
<PackageVersion Include="NHunspell" Version="1.2.5554.16953"/>
<PackageVersion Include="System.Runtime.CompilerServices.Unsafe" Version="6.0.0"/>
<PackageVersion Include="System.Threading.Tasks.Extensions" Version="4.5.4"/>
</ItemGroup>
</Project>

View File

@ -24,6 +24,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
LanguageBaseEnglish.xml = LanguageBaseEnglish.xml LanguageBaseEnglish.xml = LanguageBaseEnglish.xml
LICENSE.txt = LICENSE.txt LICENSE.txt = LICENSE.txt
README.md = README.md README.md = README.md
Directory.Packages.props = Directory.Packages.props
EndProjectSection EndProjectSection
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LibSE", "src\libse\LibSE.csproj", "{D6F64CD3-C3EA-4B36-B575-9B3B8A3CA13F}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LibSE", "src\libse\LibSE.csproj", "{D6F64CD3-C3EA-4B36-B575-9B3B8A3CA13F}"

View File

@ -201,18 +201,20 @@
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="NHunspell" Version="1.2.5554.16953"/> <PackageReference Include="NHunspell"/>
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.0.0"/> <PackageReference Include="System.Runtime.CompilerServices.Unsafe"/>
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.5.4"/> <PackageReference Include="System.Threading.Tasks.Extensions"/>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets"/> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets"/>
<Import Project="..\..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets" Condition="Exists('..\..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets')"/> <Import Project="..\..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets" Condition="Exists('..\..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets')"/>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup> <PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup> </PropertyGroup>
<Error Condition="!Exists('..\..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets'))"/> <Error Condition="!Exists('..\..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets'))"/>
</Target> </Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild"> <Target Name="BeforeBuild">

View File

@ -291,16 +291,16 @@
</HunspellAssemblies> </HunspellAssemblies>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.Net.Http" Version="2.2.29" /> <PackageReference Include="Microsoft.Net.Http"/>
<PackageReference Include="Microsoft.Win32.Registry" Version="5.0.0" /> <PackageReference Include="Microsoft.Win32.Registry"/>
<PackageReference Include="NAudio.Core" Version="2.2.1" /> <PackageReference Include="NAudio.Core"/>
<PackageReference Include="NAudio.WinMM" Version="2.2.1" /> <PackageReference Include="NAudio.WinMM"/>
<PackageReference Include="ncalc" Version="1.3.8" /> <PackageReference Include="ncalc"/>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" /> <PackageReference Include="Newtonsoft.Json"/>
<PackageReference Include="NHunspell" Version="1.2.5554.16953" /> <PackageReference Include="NHunspell"/>
<PackageReference Include="System.Security.AccessControl" Version="6.0.1" /> <PackageReference Include="System.Security.AccessControl"/>
<PackageReference Include="System.Security.Principal.Windows" Version="5.0.0" /> <PackageReference Include="System.Security.Principal.Windows"/>
<PackageReference Include="Vosk" Version="0.3.38" /> <PackageReference Include="Vosk"/>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Remove="Logic\VideoPlayers\DirectShowLib2005.cs" /> <Compile Remove="Logic\VideoPlayers\DirectShowLib2005.cs" />