Skip to content

Commit 5ecc8ec

Browse files
worldbeaterdependabot-preview[bot]glennawatson
authored
feature: Add .NET 5 (#170)
* feature: Add .NET 5 * Use NetAnalyzers * build(deps): bump Microsoft.NET.Test.Sdk from 16.8.0 to 16.8.3 Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 16.8.0 to 16.8.3. - [Release notes](https://github.com/microsoft/vstest/releases) - [Commits](microsoft/vstest@v16.8.0...v16.8.3) Signed-off-by: dependabot-preview[bot] <[email protected]> * build(deps): bump DiffEngine from 6.1.4 to 6.4.6 Bumps [DiffEngine](https://github.com/VerifyTests/DiffEngine) from 6.1.4 to 6.4.6. - [Release notes](https://github.com/VerifyTests/DiffEngine/releases) - [Commits](https://github.com/VerifyTests/DiffEngine/commits) Signed-off-by: dependabot-preview[bot] <[email protected]> * build(deps): bump Microsoft.Reactive.Testing from 4.4.1 to 5.0.0 Bumps [Microsoft.Reactive.Testing](https://github.com/dotnet/reactive) from 4.4.1 to 5.0.0. - [Release notes](https://github.com/dotnet/reactive/releases) - [Commits](dotnet/reactive@rxnet-v4.4.1...ixnet-v5.0.0) Signed-off-by: dependabot-preview[bot] <[email protected]> * Use net5.0, add Windows targets * Fix nullability errors * Approve the new API * Remove obsolete APIs from the library code * Approve the changed public APIs * Update .NET 472 approved APIs * Use the new API in the template file * Add .NET Framework 4.6.1 target * Add net461 target into the unit tests project * add netcoreapp3.1 installer Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> Co-authored-by: Glenn <[email protected]>
1 parent be76c7e commit 5ecc8ec

27 files changed

+703
-1401
lines changed

.editorconfig

+48-18
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,13 @@ csharp_new_line_between_query_expression_clauses = true
2929
csharp_indent_block_contents = true
3030
csharp_indent_braces = false
3131
csharp_indent_case_contents = true
32+
csharp_indent_case_contents_when_block = true
3233
csharp_indent_switch_labels = true
3334
csharp_indent_labels = one_less_than_current
3435

36+
# Modifier preferences
37+
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion
38+
3539
# avoid this. unless absolutely necessary
3640
dotnet_style_qualification_for_field = false:suggestion
3741
dotnet_style_qualification_for_property = false:suggestion
@@ -40,59 +44,80 @@ dotnet_style_qualification_for_event = false:suggestion
4044

4145
# only use var when it's obvious what the variable type is
4246
csharp_style_var_for_built_in_types = false:none
43-
csharp_style_var_when_type_is_apparent = false:suggestion
44-
csharp_style_var_elsewhere = false:suggestion
47+
csharp_style_var_when_type_is_apparent = true:suggestion
48+
csharp_style_var_elsewhere = true:suggestion
4549

46-
# use language keywords instead of BCL types
50+
# Types: use keywords instead of BCL types, and permit var only when the type is clear
51+
csharp_style_var_for_built_in_types = false:suggestion
52+
csharp_style_var_when_type_is_apparent = false:none
53+
csharp_style_var_elsewhere = false:suggestion
4754
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
4855
dotnet_style_predefined_type_for_member_access = true:suggestion
4956

5057
# name all constant fields using PascalCase
5158
dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion
5259
dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields
5360
dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style
54-
5561
dotnet_naming_symbols.constant_fields.applicable_kinds = field
5662
dotnet_naming_symbols.constant_fields.required_modifiers = const
57-
5863
dotnet_naming_style.pascal_case_style.capitalization = pascal_case
5964

6065
# static fields should have s_ prefix
66+
dotnet_naming_rule.static_fields_should_have_prefix.severity = suggestion
67+
dotnet_naming_rule.static_fields_should_have_prefix.symbols = static_fields
68+
dotnet_naming_rule.static_fields_should_have_prefix.style = static_prefix_style
6169
dotnet_naming_symbols.static_fields.applicable_kinds = field
6270
dotnet_naming_symbols.static_fields.required_modifiers = static
63-
64-
dotnet_naming_style.static_prefix_style.capitalization = camel_case
71+
dotnet_naming_symbols.static_fields.applicable_accessibilities = private, internal, private_protected
72+
dotnet_naming_style.static_prefix_style.required_prefix = s_
73+
dotnet_naming_style.static_prefix_style.capitalization = camel_case
6574

6675
# internal and private fields should be _camelCase
6776
dotnet_naming_rule.camel_case_for_private_internal_fields.severity = suggestion
6877
dotnet_naming_rule.camel_case_for_private_internal_fields.symbols = private_internal_fields
6978
dotnet_naming_rule.camel_case_for_private_internal_fields.style = camel_case_underscore_style
70-
7179
dotnet_naming_symbols.private_internal_fields.applicable_kinds = field
7280
dotnet_naming_symbols.private_internal_fields.applicable_accessibilities = private, internal
73-
7481
dotnet_naming_style.camel_case_underscore_style.required_prefix = _
75-
dotnet_naming_style.camel_case_underscore_style.capitalization = camel_case
82+
dotnet_naming_style.camel_case_underscore_style.capitalization = camel_case
7683

7784
# Code style defaults
85+
csharp_using_directive_placement = outside_namespace:suggestion
7886
dotnet_sort_system_directives_first = true
79-
csharp_preserve_single_line_blocks = true
80-
csharp_preserve_single_line_statements = false
87+
csharp_prefer_braces = true:silent
88+
csharp_preserve_single_line_blocks = true:none
89+
csharp_preserve_single_line_statements = false:none
90+
csharp_prefer_static_local_function = true:suggestion
91+
csharp_prefer_simple_using_statement = false:none
92+
csharp_style_prefer_switch_expression = true:suggestion
93+
94+
# Code quality
95+
dotnet_style_readonly_field = true:suggestion
96+
dotnet_code_quality_unused_parameters = non_public:suggestion
8197

8298
# Expression-level preferences
8399
dotnet_style_object_initializer = true:suggestion
84100
dotnet_style_collection_initializer = true:suggestion
85101
dotnet_style_explicit_tuple_names = true:suggestion
86102
dotnet_style_coalesce_expression = true:suggestion
87103
dotnet_style_null_propagation = true:suggestion
104+
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
105+
dotnet_style_prefer_inferred_tuple_names = true:suggestion
106+
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
107+
dotnet_style_prefer_auto_properties = true:suggestion
108+
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
109+
dotnet_style_prefer_conditional_expression_over_return = true:silent
110+
csharp_prefer_simple_default_expression = true:suggestion
88111

89112
# Expression-bodied members
90-
csharp_style_expression_bodied_methods = false:none
91-
csharp_style_expression_bodied_constructors = false:none
92-
csharp_style_expression_bodied_operators = false:none
113+
csharp_style_expression_bodied_methods = true:suggestion
114+
csharp_style_expression_bodied_constructors = true:suggestion
115+
csharp_style_expression_bodied_operators = true:suggestion
93116
csharp_style_expression_bodied_properties = true:suggestion
94-
csharp_style_expression_bodied_indexers = true:none
95-
csharp_style_expression_bodied_accessors = true:none
117+
csharp_style_expression_bodied_indexers = true:suggestion
118+
csharp_style_expression_bodied_accessors = true:suggestion
119+
csharp_style_expression_bodied_lambdas = true:suggestion
120+
csharp_style_expression_bodied_local_functions = true:suggestion
96121

97122
# Pattern matching
98123
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
@@ -103,6 +128,11 @@ csharp_style_inlined_variable_declaration = true:suggestion
103128
csharp_style_throw_expression = true:suggestion
104129
csharp_style_conditional_delegate_call = true:suggestion
105130

131+
# Other features
132+
csharp_style_prefer_index_operator = false:none
133+
csharp_style_prefer_range_operator = false:none
134+
csharp_style_pattern_local_over_anonymous_function = false:none
135+
106136
# Space preferences
107137
csharp_space_after_cast = false
108138
csharp_space_after_colon_in_inheritance_clause = true
@@ -152,4 +182,4 @@ indent_size = 2
152182
[*.sh]
153183
end_of_line = lf
154184
[*.{cmd, bat}]
155-
end_of_line = crlf
185+
end_of_line = crlf

.github/workflows/ci-build.yml

+13-4
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,23 @@ jobs:
2222
with:
2323
fetch-depth: 0
2424

25-
- name: Install .NET Core
25+
- name: Install .NET Core 3.1.x
2626
uses: actions/setup-dotnet@v1
2727
with:
2828
dotnet-version: 3.1.x
2929

30+
- name: Install .NET 5.0.x
31+
uses: actions/setup-dotnet@v1
32+
with:
33+
dotnet-version: 5.0.x
34+
35+
- name: Add MSBuild to PATH
36+
uses: glennawatson/[email protected]
37+
38+
- name: Update VS2019
39+
shell: powershell
40+
run: Start-Process -Wait -PassThru -FilePath "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe" -ArgumentList "update --passive --norestart --installpath ""C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise"""
41+
3042
- name: NBGV
3143
id: nbgv
3244
uses: dotnet/nbgv@master
@@ -36,9 +48,6 @@ jobs:
3648
- name: NuGet Restore
3749
run: dotnet restore
3850
working-directory: src
39-
40-
- name: Add MSBuild to PATH
41-
uses: microsoft/setup-msbuild@v1
4251

4352
- name: Build
4453
run: msbuild /t:build,pack /maxcpucount /p:NoPackageAnalysis=true /verbosity:minimal /p:Configuration=${{ env.configuration }}

src/Directory.build.props

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
<ItemGroup>
4040
<PackageReference Include="stylecop.analyzers" Version="1.2.0-beta.205" PrivateAssets="all" />
4141
<PackageReference Include="Roslynator.Analyzers" Version="3.0.0" PrivateAssets="All" />
42-
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.3.1" PrivateAssets="all" />
42+
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="5.0.1" PrivateAssets="all" />
4343
</ItemGroup>
4444
<ItemGroup>
4545
<AdditionalFiles Include="$(MSBuildThisFileDirectory)stylecop.json" Link="stylecop.json" />

src/ReactiveUI.Validation.AndroidSupport/ReactiveUI.Validation.AndroidSupport.csproj

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="MSBuild.Sdk.Extras">
22

33
<PropertyGroup>
4-
<TargetFramework>MonoAndroid90</TargetFramework>
4+
<TargetFramework>MonoAndroid10.0</TargetFramework>
55
<PackageDescription>Provides ReactiveUI.Validation extensions for the Android Support Library</PackageDescription>
66
<PackageId>ReactiveUI.Validation.AndroidSupport</PackageId>
77
<NoWarn>$(NoWarn);CS1591</NoWarn>
@@ -11,8 +11,8 @@
1111

1212
<ItemGroup>
1313
<PackageReference Include="Xamarin.Android.Support.Design" Version="27.*" />
14-
<PackageReference Include="ReactiveUI.AndroidSupport" Version="12.*" />
15-
<PackageReference Include="ReactiveUI" Version="12.*" />
14+
<PackageReference Include="ReactiveUI.AndroidSupport" Version="13.*" />
15+
<PackageReference Include="ReactiveUI" Version="13.*" />
1616
</ItemGroup>
1717

1818
<ItemGroup>

src/ReactiveUI.Validation.AndroidX/ReactiveUI.Validation.AndroidX.csproj

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="MSBuild.Sdk.Extras">
22

33
<PropertyGroup>
4-
<TargetFramework>MonoAndroid90</TargetFramework>
4+
<TargetFramework>MonoAndroid10.0</TargetFramework>
55
<PackageDescription>Provides ReactiveUI.Validation extensions for the AndroidX Library</PackageDescription>
66
<PackageId>ReactiveUI.Validation.AndroidX</PackageId>
77
<NoWarn>$(NoWarn);CS1591</NoWarn>
@@ -11,8 +11,8 @@
1111

1212
<ItemGroup>
1313
<PackageReference Include="Xamarin.Google.Android.Material" Version="1.*" />
14-
<PackageReference Include="ReactiveUI.AndroidX" Version="12.*" />
15-
<PackageReference Include="ReactiveUI" Version="12.*" />
14+
<PackageReference Include="ReactiveUI.AndroidX" Version="13.*" />
15+
<PackageReference Include="ReactiveUI" Version="13.*" />
1616
</ItemGroup>
1717

1818
<ItemGroup>

0 commit comments

Comments
 (0)