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

Suppress code style warnings and use central package management #513

Merged
merged 3 commits into from
Mar 7, 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
606 changes: 243 additions & 363 deletions .editorconfig

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.x.x'
global-json-file: ./global.json

- name: Build ${{matrix.Game}}
run: ./BuildScripts/Build-${{matrix.Game}}.ps1
Expand Down
15 changes: 4 additions & 11 deletions ClientCore/ClientCore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,9 @@
<EmbeddedResource Include="Resources\yricon.png" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="GitVersion.MsBuild" Version="5.11.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Rampastring.Tools" Version="2.0.6" />
<PackageReference Include="Rampastring.XNAUI.$(Engine)" Version="2.3.20" Condition="'!$(Configuration.Contains(Debug))'" />
<PackageReference Include="Rampastring.XNAUI.$(Engine).Debug" Version="2.3.20" Condition="'$(Configuration.Contains(Debug))'" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="8.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\TranslationNotifierGenerator\TranslationNotifierGenerator.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
<PackageReference Include="Rampastring.Tools" />
<PackageReference Include="Rampastring.XNAUI.$(Engine)" Condition="'!$(Configuration.Contains(Debug))'" />
<PackageReference Include="Rampastring.XNAUI.$(Engine).Debug" Condition="'$(Configuration.Contains(Debug))'" />
<PackageReference Include="System.Text.Encoding.CodePages" />
</ItemGroup>
</Project>
9 changes: 0 additions & 9 deletions ClientGUI/ClientGUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,4 @@
<ItemGroup>
<ProjectReference Include="..\ClientCore\ClientCore.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="GitVersion.MsBuild" Version="5.11.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\TranslationNotifierGenerator\TranslationNotifierGenerator.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
</ItemGroup>
</Project>
9 changes: 1 addition & 8 deletions DTAConfig/DTAConfig.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,9 @@
</PropertyGroup>
<Import Project="$(MSBuildThisFileDirectory)..\build\WinForms.props" />
<ItemGroup>
<PackageReference Include="CnCNet.ClientUpdater" Version="1.0.16" />
<PackageReference Include="GitVersion.MsBuild" Version="5.11.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="CnCNet.ClientUpdater" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\ClientGUI\ClientGUI.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\TranslationNotifierGenerator\TranslationNotifierGenerator.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion DXClient.sln
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.2.32408.312
Expand All @@ -18,6 +17,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
build\CopyResources.targets = build\CopyResources.targets
Directory.Build.props = Directory.Build.props
Directory.Build.targets = Directory.Build.targets
Directory.Packages.props = Directory.Packages.props
build\Framework.props = build\Framework.props
build\VSCompatibleLayer.props = build\VSCompatibleLayer.props
build\WinForms.props = build\WinForms.props
Expand Down
27 changes: 10 additions & 17 deletions DXMainClient/DXMainClient.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,34 +34,27 @@
<Content Include="clienticon.ico" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="SixLabors.ImageSharp" Version="2.1.6" />
<PackageReference Include="DiscordRichPresence" Version="1.1.3.18" />
<PackageReference Include="lzo.net" Version="0.0.6" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageReference Include="OpenMcdf" Version="2.2.1.12" />
<PackageReference Include="System.IO.Compression" Version="4.3.0" />
<PackageReference Include="System.Management" Version="8.0.0" />
<PackageReference Include="System.DirectoryServices" Version="8.0.0" />
<PackageReference Include="GitVersion.MsBuild" Version="5.11.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="SixLabors.ImageSharp" />
<PackageReference Include="DiscordRichPresence" />
<PackageReference Include="lzo.net" />
<PackageReference Include="Microsoft.Extensions.Hosting" />
<PackageReference Include="OpenMcdf" />
<PackageReference Include="System.IO.Compression" />
<PackageReference Include="System.Management" />
<PackageReference Include="System.DirectoryServices" />
</ItemGroup>
<ItemGroup>
<!-- These two packages are explicitly imported to get rid of Error NU1605 Detected package downgrade. -->
<!-- This error is only raised when both .NET 4 and .NET 8 exists in TargetFrameworks: -->
<!-- <TargetFrameworks>net48;net8.0-windows</TargetFrameworks> -->
<!-- and -p:Engine=WindowsDX -f net48 -->
<PackageReference Include="NETStandard.Library" Version="2.0.3" />
<PackageReference Include="System.IO.FileSystem" Version="4.3.0" />
<PackageReference Include="NETStandard.Library" />
<PackageReference Include="System.IO.FileSystem" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\DTAConfig\DTAConfig.csproj" />
</ItemGroup>
<Import Project="$(MSBuildThisFileDirectory)..\build\WinForms.props" />
<Import Project="$(MSBuildThisFileDirectory)..\build\AfterPublish.targets" />
<Import Project="$(MSBuildThisFileDirectory)..\build\CopyResources.targets" />
<ItemGroup>
<ProjectReference Include="..\TranslationNotifierGenerator\TranslationNotifierGenerator.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
</ItemGroup>
</Project>
42 changes: 12 additions & 30 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,13 @@
<ComVisible>false</ComVisible>
<CLSCompliant>false</CLSCompliant>
<Platforms>AnyCPU;x64;ARM64;x86</Platforms>
<AnalysisMode Condition="$(Configuration.Contains(Debug))">All</AnalysisMode>
<EnforceCodeStyleInBuild Condition="$(Configuration.Contains(Debug))">true</EnforceCodeStyleInBuild>
<AnalysisMode Condition="!$(Configuration.Contains(Debug))">Recommended</AnalysisMode>
<AnalysisModeDocumentation Condition="!$(Configuration.Contains(Debug))">None</AnalysisModeDocumentation>
<AnalysisModeNaming Condition="!$(Configuration.Contains(Debug))">None</AnalysisModeNaming>
<AnalysisModeStyle Condition="!$(Configuration.Contains(Debug))">None</AnalysisModeStyle>
</PropertyGroup>

<Import Project="$(MSBuildThisFileDirectory)build\VSCompatibleLayer.props" Condition="'$(BuildingInsideVisualStudio)' == 'True'" />
<Import Project="$(MSBuildThisFileDirectory)build\Framework.props" />

<!-- Allow a game specific build prop file to be imported, if available -->
<Import Project="$(MSBuildThisFileDirectory)Directory.Build.Game.$(Game).props" Condition="Exists('$(MSBuildThisFileDirectory)Directory.Build.Game.$(Game).props')"/>
<Import Project="$(MSBuildThisFileDirectory)Directory.Build.Game.$(Game).props" Condition="Exists('$(MSBuildThisFileDirectory)Directory.Build.Game.$(Game).props')" />

<!-- Visual Studio -->
<PropertyGroup Condition="'$(BuildingInsideVisualStudio)' == 'True'">
Expand All @@ -28,35 +22,23 @@
<Message Importance="high" Text="Engine: $(Engine); Game: $(Game); Platform: $(Platform); TargetFramework: $(TargetFramework); Configuration: $(Configuration)" />
</Target>

<ItemGroup>
<PackageReference Condition="$(Configuration.Contains(Debug))" Include="StyleCop.Analyzers" Version="1.2.0-beta.435">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup Condition="$(TargetFrameworkIdentifier) == '.NETFramework'">
<PackageReference Include="Polyfill" Version="2.2.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="System.ValueTuple"
Version="4.5.0"
<PackageReference
Include="System.ValueTuple"
Condition="$(TargetFramework.StartsWith('net46'))" />
<PackageReference Include="System.Memory"
Version="4.5.5"
<PackageReference
Include="System.Memory"
Condition="$(TargetFrameworkIdentifier) == '.NETStandard' or
$(TargetFrameworkIdentifier) == '.NETFramework' or
$(TargetFramework.StartsWith('netcoreapp2'))" />
<PackageReference Include="System.Threading.Tasks.Extensions"
Version="4.5.4"
$(TargetFrameworkIdentifier) == '.NETFramework' or
$(TargetFramework.StartsWith('netcoreapp2'))" />
<PackageReference
Include="System.Threading.Tasks.Extensions"
Condition="$(TargetFramework) == 'netstandard2.0' or
$(TargetFramework) == 'netcoreapp2.0' or
$(TargetFrameworkIdentifier) == '.NETFramework'" />

$(TargetFramework) == 'netcoreapp2.0' or
$(TargetFrameworkIdentifier) == '.NETFramework'" />
</ItemGroup>

<ItemGroup>
<CompilerVisibleProperty Include="RootNamespace"/>
<CompilerVisibleProperty Include="RootNamespace" />
</ItemGroup>
</Project>
52 changes: 52 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<Project>

<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<Rampastring_XNAUI_Version>2.3.20</Rampastring_XNAUI_Version>
</PropertyGroup>

<ItemGroup>
<GlobalPackageReference Include="GitVersion.MsBuild" Version="5.11.1" />
</ItemGroup>

<ItemGroup Condition="$(TargetFrameworkIdentifier) == '.NETFramework'">
<GlobalPackageReference Include="Polyfill" Version="2.2.0" />
</ItemGroup>

<ItemGroup Condition="'$(MSBuildProjectName)' != 'TranslationNotifierGenerator'">
<ProjectReference Include="$(MSBuildThisFileDirectory)TranslationNotifierGenerator\TranslationNotifierGenerator.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
</ItemGroup>

<ItemGroup Condition="'$(MSBuildProjectName)' == 'DXMainClient'">
<PackageVersion Include="NETStandard.Library" Version="2.0.3" />
<PackageVersion Include="System.IO.FileSystem" Version="4.3.0" />
</ItemGroup>

<ItemGroup>
<PackageVersion Include="CnCNet.ClientUpdater" Version="1.0.16" />
<PackageVersion Include="DiscordRichPresence" Version="1.1.3.18" />
<PackageVersion Include="lzo.net" Version="0.0.6" />
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.3" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.4.0" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageVersion Include="OpenMcdf" Version="2.2.1.12" />
<PackageVersion Include="Rampastring.Tools" Version="2.0.6" />
<PackageVersion Include="Rampastring.XNAUI.WindowsDX" Version="$(Rampastring_XNAUI_Version)" />
<PackageVersion Include="Rampastring.XNAUI.WindowsGL" Version="$(Rampastring_XNAUI_Version)" />
<PackageVersion Include="Rampastring.XNAUI.UniversalGL" Version="$(Rampastring_XNAUI_Version)" />
<PackageVersion Include="Rampastring.XNAUI.WindowsXNA" Version="$(Rampastring_XNAUI_Version)" />
<PackageVersion Include="Rampastring.XNAUI.WindowsDX.Debug" Version="$(Rampastring_XNAUI_Version)" />
<PackageVersion Include="Rampastring.XNAUI.WindowsGL.Debug" Version="$(Rampastring_XNAUI_Version)" />
<PackageVersion Include="Rampastring.XNAUI.UniversalGL.Debug" Version="$(Rampastring_XNAUI_Version)" />
<PackageVersion Include="Rampastring.XNAUI.WindowsXNA.Debug" Version="$(Rampastring_XNAUI_Version)" />
<PackageVersion Include="SixLabors.ImageSharp" Version="2.1.7" />
<PackageVersion Include="System.DirectoryServices" Version="8.0.0" />
<PackageVersion Include="System.IO.Compression" Version="4.3.0" />
<PackageVersion Include="System.Management" Version="8.0.0" />
<PackageVersion Include="System.Memory" Version="4.5.5" />
<PackageVersion Include="System.Text.Encoding.CodePages" Version="8.0.0" />
<PackageVersion Include="System.Threading.Tasks.Extensions" Version="4.5.4" />
<PackageVersion Include="System.ValueTuple" Version="4.5.0" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.3">
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.4.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" />
</ItemGroup>

</Project>
</Project>
6 changes: 6 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"sdk": {
"rollForward": "major",
"version": "8.0.200"
}
}
Loading