Skip to content

Commit 3b53e6e

Browse files
authored
Migrate to .NET 6 (#68)
Co-authored-by: Igor Velikorossov <[email protected]> Fixes #67
1 parent 4e3ba18 commit 3b53e6e

21 files changed

+342
-94
lines changed

.editorconfig

Lines changed: 188 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
# editorconfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
# Default settings:
7+
# A newline ending every file
8+
# Use 4 spaces as indentation
9+
[*]
10+
guidelines = 120 1px dotted 504CFF00, 150 1px dotted 50FF6A00
11+
indent_style = space
12+
indent_size = 4
13+
14+
[*.json]
15+
indent_size = 2
16+
17+
# C# and VB files
18+
[*.{cs,vb}]
19+
charset = utf-8-bom
20+
insert_final_newline = true
21+
trim_trailing_whitespace = true
22+
23+
# avoid this. unless absolutely necessary
24+
dotnet_style_qualification_for_field = false:suggestion
25+
dotnet_style_qualification_for_property = false:suggestion
26+
dotnet_style_qualification_for_method = false:suggestion
27+
dotnet_style_qualification_for_event = false:suggestion
28+
# use language keywords instead of BCL types
29+
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
30+
dotnet_style_predefined_type_for_member_access = true:suggestion
31+
32+
# name all constant fields using PascalCase
33+
dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion
34+
dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields
35+
dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style
36+
37+
dotnet_naming_symbols.constant_fields.applicable_kinds = field
38+
dotnet_naming_symbols.constant_fields.required_modifiers = const
39+
40+
dotnet_naming_style.pascal_case_style.capitalization = pascal_case
41+
42+
# static fields should have s_ prefix
43+
dotnet_naming_rule.static_fields_should_have_prefix.severity = suggestion
44+
dotnet_naming_rule.static_fields_should_have_prefix.symbols = static_fields
45+
dotnet_naming_rule.static_fields_should_have_prefix.style = static_prefix_style
46+
47+
dotnet_naming_symbols.static_fields.applicable_kinds = field
48+
dotnet_naming_symbols.static_fields.required_modifiers = static
49+
50+
dotnet_naming_style.static_prefix_style.required_prefix = s_
51+
dotnet_naming_style.static_prefix_style.capitalization = camel_case
52+
53+
# internal and private fields should be _camelCase
54+
dotnet_naming_rule.camel_case_for_private_internal_fields.severity = suggestion
55+
dotnet_naming_rule.camel_case_for_private_internal_fields.symbols = private_internal_fields
56+
dotnet_naming_rule.camel_case_for_private_internal_fields.style = camel_case_underscore_style
57+
58+
dotnet_naming_symbols.private_internal_fields.applicable_kinds = field
59+
dotnet_naming_symbols.private_internal_fields.applicable_accessibilities = private, internal
60+
61+
dotnet_naming_style.camel_case_underscore_style.required_prefix = _
62+
dotnet_naming_style.camel_case_underscore_style.capitalization = camel_case
63+
64+
# Code style defaults
65+
dotnet_sort_system_directives_first = true
66+
67+
# Expression-level preferences
68+
dotnet_style_object_initializer = true:suggestion
69+
dotnet_style_collection_initializer = true:suggestion
70+
dotnet_style_explicit_tuple_names = true:suggestion
71+
dotnet_style_coalesce_expression = true:suggestion
72+
dotnet_style_null_propagation = true:suggestion
73+
74+
# C# files
75+
[*.cs]
76+
77+
# .NET diagnostic
78+
dotnet_diagnostic.RS0041.severity = none
79+
dotnet_diagnostic.IDE0005.severity = warning
80+
81+
# New line preferences
82+
csharp_new_line_before_open_brace = all
83+
csharp_new_line_before_else = true
84+
csharp_new_line_before_catch = true
85+
csharp_new_line_before_finally = true
86+
csharp_new_line_before_members_in_object_initializers = true
87+
csharp_new_line_before_members_in_anonymous_types = true
88+
csharp_new_line_between_query_expression_clauses = true
89+
90+
# Indentation preferences
91+
csharp_indent_block_contents = true
92+
csharp_indent_braces = false
93+
csharp_indent_case_contents = true
94+
csharp_indent_switch_labels = true
95+
csharp_indent_labels = one_less_than_current
96+
97+
# only use var when it's obvious what the variable type is
98+
csharp_style_var_for_built_in_types = false:silent
99+
csharp_style_var_when_type_is_apparent = true:silent
100+
csharp_style_var_elsewhere = false:silent
101+
102+
# Code style defaults
103+
csharp_preserve_single_line_blocks = true
104+
csharp_preserve_single_line_statements = false
105+
106+
# Expression-bodied members
107+
csharp_style_expression_bodied_methods = false:none
108+
csharp_style_expression_bodied_constructors = false:none
109+
csharp_style_expression_bodied_operators = false:none
110+
csharp_style_expression_bodied_properties = true:none
111+
csharp_style_expression_bodied_indexers = true:none
112+
csharp_style_expression_bodied_accessors = true:none
113+
114+
# Pattern matching
115+
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
116+
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
117+
csharp_style_inlined_variable_declaration = true:suggestion
118+
119+
# Null checking preferences
120+
csharp_style_throw_expression = true:suggestion
121+
csharp_style_conditional_delegate_call = true:suggestion
122+
123+
# Space preferences
124+
csharp_space_after_cast = false
125+
csharp_space_after_colon_in_inheritance_clause = true
126+
csharp_space_after_comma = true
127+
csharp_space_after_dot = false
128+
csharp_space_after_keywords_in_control_flow_statements = true
129+
csharp_space_after_semicolon_in_for_statement = true
130+
csharp_space_around_binary_operators = before_and_after
131+
csharp_space_around_declaration_statements = do_not_ignore
132+
csharp_space_before_colon_in_inheritance_clause = true
133+
csharp_space_before_comma = false
134+
csharp_space_before_dot = false
135+
csharp_space_before_open_square_brackets = false
136+
csharp_space_before_semicolon_in_for_statement = false
137+
csharp_space_between_empty_square_brackets = false
138+
csharp_space_between_method_call_empty_parameter_list_parentheses = false
139+
csharp_space_between_method_call_name_and_opening_parenthesis = false
140+
csharp_space_between_method_call_parameter_list_parentheses = false
141+
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
142+
csharp_space_between_method_declaration_name_and_open_parenthesis = false
143+
csharp_space_between_method_declaration_parameter_list_parentheses = false
144+
csharp_space_between_parentheses = false
145+
csharp_space_between_square_brackets = false
146+
147+
# IDE0008: Use explicit type
148+
dotnet_diagnostic.IDE0008.severity = silent
149+
150+
# Visual Basic files
151+
152+
[*.vb]
153+
# Modifier preferences
154+
visual_basic_preferred_modifier_order = Partial,Default,Private,Protected,Public,Friend,NotOverridable,Overridable,MustOverride,Overloads,Overrides,MustInherit,NotInheritable,Static,Shared,Shadows,ReadOnly,WriteOnly,Dim,Const,WithEvents,Widening,Narrowing,Custom,Async:suggestion
155+
156+
# C++ Files
157+
[*.{cpp,h,in}]
158+
curly_bracket_next_line = true
159+
indent_brace_style = Allman
160+
161+
# Xml project files
162+
[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,nativeproj,locproj}]
163+
indent_size = 2
164+
165+
# Xml build files
166+
[*.builds]
167+
indent_size = 2
168+
169+
# Xml files
170+
[*.{xml,stylecop,ruleset}]
171+
indent_size = 2
172+
173+
# Xml config files
174+
[*.{props,targets,config,nuspec}]
175+
indent_size = 2
176+
177+
# resx Files
178+
[*.{resx,xlf}]
179+
indent_size = 2
180+
charset = utf-8-bom
181+
insert_final_newline = true
182+
183+
# Shell scripts
184+
[*.sh]
185+
end_of_line = lf
186+
187+
[*.{cmd,bat}]
188+
end_of_line = crlf
Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,22 @@
1-
<!-- Do not use XML namespaces here (<Project xmlns="...">), because it would break patching of version numbers during builds on AppVeyor (https://github.com/appveyor/website/pull/409) -->
2-
<Project>
3-
<PropertyGroup>
4-
<Authors>Git Extensions</Authors>
5-
<Company>Git Extensions</Company>
6-
<RepositoryUrl>https://github.com/gitextensions/gitextensions.pluginmanager</RepositoryUrl>
7-
<LangVersion>latest</LangVersion>
8-
<Version>0.0.0</Version>
9-
<AssemblyVersion>0.0.0.1</AssemblyVersion>
10-
<FileVersion>0.0.0.1</FileVersion>
11-
<InformationalVersion>0.0.0.1</InformationalVersion>
12-
<PackageVersion>0.0.0.1</PackageVersion>
13-
</PropertyGroup>
14-
</Project>
1+
<Project>
2+
3+
<PropertyGroup>
4+
<TargetFramework>net6.0-windows</TargetFramework>
5+
<LangVersion>latest</LangVersion>
6+
<NoWarn>$(NoWarn);1573;1591;1712</NoWarn>
7+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
8+
</PropertyGroup>
9+
10+
<PropertyGroup>
11+
<Authors>Git Extensions</Authors>
12+
<Company>Git Extensions</Company>
13+
<RepositoryUrl>https://github.com/gitextensions/gitextensions.pluginmanager</RepositoryUrl>
14+
<LangVersion>latest</LangVersion>
15+
<Version>0.0.0</Version>
16+
<AssemblyVersion>0.0.0.1</AssemblyVersion>
17+
<FileVersion>0.0.0.1</FileVersion>
18+
<InformationalVersion>0.0.0.1</InformationalVersion>
19+
<PackageVersion>0.0.0.1</PackageVersion>
20+
</PropertyGroup>
21+
22+
</Project>

Directory.Build.targets

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<Project>
2+
3+
<Sdk Name="Microsoft.Build.CentralPackageVersions" Version="2.1.3" />
4+
5+
</Project>

GitExtensions.PluginManager.sln

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 15
4-
VisualStudioVersion = 15.0.27703.2000
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.5.33130.490
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GitExtensions.PluginManager", "src\GitExtensions.PluginManager\GitExtensions.PluginManager.csproj", "{4EB0566E-6D4F-43AF-AA97-2A15ABB66787}"
77
EndProject
8-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PackageManager.UI", "src\PackageManager.UI\PackageManager.UI.csproj", "{6F4FA02A-B061-4607-925E-27B122DE60BC}"
8+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PackageManager.UI", "src\PackageManager.UI\PackageManager.UI.csproj", "{6F4FA02A-B061-4607-925E-27B122DE60BC}"
99
EndProject
1010
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PackageManager", "src\PackageManager\PackageManager.csproj", "{3B5E3720-B3CB-4A12-B2D4-6BCB6BE78FF1}"
1111
EndProject
@@ -18,13 +18,35 @@ EndProject
1818
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PackageManager.NuGet.Tests", "test\PackageManager.NuGet.Tests\PackageManager.NuGet.Tests.csproj", "{7EE3B4B1-0BAA-4EB3-BBCB-30BEA09019A3}"
1919
EndProject
2020
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{7184D694-3B8B-4C4D-BD6E-7EBF73AB9CCA}"
21+
ProjectSection(SolutionItems) = preProject
22+
test\Directory.Build.props = test\Directory.Build.props
23+
test\Directory.Build.targets = test\Directory.Build.targets
24+
EndProjectSection
25+
EndProject
26+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{FA57D002-774F-432E-AE8E-09B7690EF0CC}"
27+
ProjectSection(SolutionItems) = preProject
28+
.editorconfig = .editorconfig
29+
.gitignore = .gitignore
30+
appveyor.yml = appveyor.yml
31+
Directory.Build.props = Directory.Build.props
32+
Directory.Build.targets = Directory.Build.targets
33+
GitExtensions.settings = GitExtensions.settings
34+
Packages.props = Packages.props
35+
README.md = README.md
36+
EndProjectSection
37+
EndProject
38+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{B13A9C49-3262-4F06-B929-FB46D10A4820}"
2139
EndProject
2240
Global
2341
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2442
Debug|Any CPU = Debug|Any CPU
2543
Release|Any CPU = Release|Any CPU
2644
EndGlobalSection
2745
GlobalSection(ProjectConfigurationPlatforms) = postSolution
46+
{4EB0566E-6D4F-43AF-AA97-2A15ABB66787}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
47+
{4EB0566E-6D4F-43AF-AA97-2A15ABB66787}.Debug|Any CPU.Build.0 = Debug|Any CPU
48+
{4EB0566E-6D4F-43AF-AA97-2A15ABB66787}.Release|Any CPU.ActiveCfg = Release|Any CPU
49+
{4EB0566E-6D4F-43AF-AA97-2A15ABB66787}.Release|Any CPU.Build.0 = Release|Any CPU
2850
{6F4FA02A-B061-4607-925E-27B122DE60BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
2951
{6F4FA02A-B061-4607-925E-27B122DE60BC}.Debug|Any CPU.Build.0 = Debug|Any CPU
3052
{6F4FA02A-B061-4607-925E-27B122DE60BC}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -37,10 +59,6 @@ Global
3759
{B302D166-37CE-439D-8AE1-0CCB80BAD332}.Debug|Any CPU.Build.0 = Debug|Any CPU
3860
{B302D166-37CE-439D-8AE1-0CCB80BAD332}.Release|Any CPU.ActiveCfg = Release|Any CPU
3961
{B302D166-37CE-439D-8AE1-0CCB80BAD332}.Release|Any CPU.Build.0 = Release|Any CPU
40-
{4EB0566E-6D4F-43AF-AA97-2A15ABB66787}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
41-
{4EB0566E-6D4F-43AF-AA97-2A15ABB66787}.Debug|Any CPU.Build.0 = Debug|Any CPU
42-
{4EB0566E-6D4F-43AF-AA97-2A15ABB66787}.Release|Any CPU.ActiveCfg = Release|Any CPU
43-
{4EB0566E-6D4F-43AF-AA97-2A15ABB66787}.Release|Any CPU.Build.0 = Release|Any CPU
4462
{72134702-9CC0-408F-9E07-B4D59C9D7E43}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
4563
{72134702-9CC0-408F-9E07-B4D59C9D7E43}.Debug|Any CPU.Build.0 = Debug|Any CPU
4664
{72134702-9CC0-408F-9E07-B4D59C9D7E43}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -58,7 +76,12 @@ Global
5876
HideSolutionNode = FALSE
5977
EndGlobalSection
6078
GlobalSection(NestedProjects) = preSolution
79+
{4EB0566E-6D4F-43AF-AA97-2A15ABB66787} = {B13A9C49-3262-4F06-B929-FB46D10A4820}
80+
{6F4FA02A-B061-4607-925E-27B122DE60BC} = {B13A9C49-3262-4F06-B929-FB46D10A4820}
81+
{3B5E3720-B3CB-4A12-B2D4-6BCB6BE78FF1} = {B13A9C49-3262-4F06-B929-FB46D10A4820}
82+
{B302D166-37CE-439D-8AE1-0CCB80BAD332} = {B13A9C49-3262-4F06-B929-FB46D10A4820}
6183
{72134702-9CC0-408F-9E07-B4D59C9D7E43} = {7184D694-3B8B-4C4D-BD6E-7EBF73AB9CCA}
84+
{E7AD4376-D8B1-469D-A2E3-38059A5EB152} = {B13A9C49-3262-4F06-B929-FB46D10A4820}
6285
{7EE3B4B1-0BAA-4EB3-BBCB-30BEA09019A3} = {7184D694-3B8B-4C4D-BD6E-7EBF73AB9CCA}
6386
EndGlobalSection
6487
GlobalSection(ExtensibilityGlobals) = postSolution

Packages.props

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<Project>
2+
3+
<ItemGroup>
4+
<PackageReference Update="GitExtensions.Extensibility" Version="0.3.*" />
5+
<PackageReference Update="Neptuo" Version="6.0.2" />
6+
<PackageReference Update="Neptuo.Exceptions" Version="1.2.2" />
7+
<PackageReference Update="Neptuo.Observables" Version="2.1.1" />
8+
<PackageReference Update="NuGet.PackageManagement" Version="6.3.1" />
9+
<PackageReference Update="System.ComponentModel.Composition" Version="6.0.0" />
10+
<PackageReference Update="System.Resources.Extensions" Version="6.0.0" />
11+
</ItemGroup>
12+
13+
<!-- Test-related -->
14+
<ItemGroup>
15+
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="17.4.0" />
16+
<PackageReference Update="Moq" Version="4.18.2" />
17+
<PackageReference Update="MSTest.TestAdapter" Version="2.2.10" />
18+
<PackageReference Update="MSTest.TestFramework" Version="2.2.10" />
19+
<PackageReference Update="Appveyor.TestLogger" Version="2.0.0" />
20+
</ItemGroup>
21+
22+
</Project>

appveyor.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#---------------------------------#
44

55
# version format
6-
version: 2.0.0.{build}
6+
version: 3.0.0.{build}
77

88
# version suffix, if any (e.g. '-RC1', '-beta' otherwise '')
99
environment:
@@ -18,7 +18,7 @@ skip_tags: true
1818

1919
# Build worker image (VM template)
2020
image:
21-
- Visual Studio 2019
21+
- Visual Studio 2022
2222

2323
# enable patching of Directory.Build.props
2424
dotnet_csproj:

src/GitExtensions.PluginManager/GitExtensions.PluginManager.csproj

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,25 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net5.0-windows</TargetFramework>
54
<UseWindowsForms>true</UseWindowsForms>
65
<Description>NuGet-based Plugin Manager for Git Extensions</Description>
76
<PackageTags>GitExtensions</PackageTags>
87
<PackageProjectUrl>https://github.com/gitextensions/gitextensions.pluginmanager</PackageProjectUrl>
98
<RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent>
109
<NuspecFile>$(MSBuildThisFileDirectory)$(MSBuildProjectName).nuspec</NuspecFile>
11-
<NoWarn>1701;1702;NU5100</NoWarn>
10+
<NoWarn>1701;1702;NU5100;NU5101;NU5103;NU5128</NoWarn>
1211
</PropertyGroup>
1312

1413
<PropertyGroup>
1514
<PackageManagerTargetPath>PackageManager\PackageManager.UI.exe</PackageManagerTargetPath>
16-
<PackageManagerSourcePath>..\PackageManager.UI\bin\Release\$(TargetFramework)\publish\PackageManager.UI.exe</PackageManagerSourcePath>
1715
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
16+
<PackageManagerSourcePath>..\PackageManager.UI\bin\$(Configuration)\$(TargetFramework)\publish\PackageManager.UI.exe</PackageManagerSourcePath>
1817
</PropertyGroup>
1918

2019
<ItemGroup>
21-
<PackageReference Include="GitExtensions.Extensibility" Version="0.2.*" />
22-
<PackageReference Include="System.ComponentModel.Composition" Version="5.0.0" />
23-
<PackageReference Include="System.Resources.Extensions" Version="4.6.0" />
20+
<PackageReference Include="GitExtensions.Extensibility" />
21+
<PackageReference Include="System.ComponentModel.Composition" />
22+
<PackageReference Include="System.Resources.Extensions" />
2423
</ItemGroup>
2524

2625
<ItemGroup>
@@ -42,7 +41,7 @@
4241
<ItemGroup>
4342
<ProjectReference Include="..\PackageManager.UI\PackageManager.UI.csproj" ReferenceOutputAssembly="false" />
4443
</ItemGroup>
45-
44+
4645
<ItemGroup>
4746
<Compile Update="Properties\Resources.Designer.cs">
4847
<DesignTime>True</DesignTime>
@@ -59,6 +58,7 @@
5958
<Copy SourceFiles="$(PackageManagerSourcePath)" DestinationFiles="$(TargetDir)$(PackageManagerTargetPath)" />
6059
<Copy SourceFiles="$(PackageManagerSourcePath)" DestinationFiles="$(GitExtensionsPluginsPath)\$(ProjectName)\$(PackageManagerTargetPath)" />
6160
</Target>
61+
6262
<Target Name="PreClean" BeforeTargets="Clean">
6363
<Message Text="Deleting PackageManager" Importance="high" />
6464
<Delete Files="$(TargetDir)$(PackageManagerTargetPath)" ContinueOnError="true" />

0 commit comments

Comments
 (0)