From 35021aa18fe57c0ec8fd258674830af88ce20f42 Mon Sep 17 00:00:00 2001 From: Jeff Ashton Date: Thu, 10 Dec 2020 15:38:30 -0500 Subject: [PATCH] Roughing out a project skeleton (#1) --- .config/dotnet-tools.json | 12 +++ .editorconfig | 101 ++++++++++++++++++ .github/workflows/build.yml | 33 ++++++ .gitignore | 6 ++ D2L.DynamoDBv2.NUnitHelpers.sln | 37 +++++++ Directory.Build.props | 23 ++++ README.md | 3 +- VersionInfo.props | 5 + .../D2L.DynamoDBv2.NUnitHelpers.csproj | 11 ++ .../D2L.DynamoDBv2.NUnitHelpers.Tests.csproj | 13 +++ 10 files changed, 243 insertions(+), 1 deletion(-) create mode 100644 .config/dotnet-tools.json create mode 100644 .editorconfig create mode 100644 .github/workflows/build.yml create mode 100644 .gitignore create mode 100644 D2L.DynamoDBv2.NUnitHelpers.sln create mode 100644 Directory.Build.props create mode 100644 VersionInfo.props create mode 100644 src/D2L.DynamoDBv2.NUnitHelpers/D2L.DynamoDBv2.NUnitHelpers.csproj create mode 100644 test/D2L.DynamoDBv2.NUnitHelpers.Tests/D2L.DynamoDBv2.NUnitHelpers.Tests.csproj diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json new file mode 100644 index 0000000..18d8b5d --- /dev/null +++ b/.config/dotnet-tools.json @@ -0,0 +1,12 @@ +{ + "version": 1, + "isRoot": true, + "tools": { + "dotnet-ci-version-properties": { + "version": "0.3.1", + "commands": [ + "dotnet-ci-version-properties" + ] + } + } +} \ No newline at end of file diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..46d09f0 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,101 @@ +[*.cs] +indent_style = tab +tab_width = 4 +max_line_length = off +guidelines = 80 + +# C# specific settings: +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference +# +# Any Roslyn-implemented rules that emit diagnostics only run in the IDE, not +# during command line builds. Be careful adding error rules here because CI +# will not enforce them currently. +# +# In a future update to the compiler they will be enforced. +# https://github.com/dotnet/roslyn/projects/18 + +# Language conventions (https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference?view=vs-2017#language-conventions) +dotnet_style_qualification_for_field = false:none # default +dotnet_style_qualification_for_property = false:none # default +dotnet_style_qualification_for_method = false:none # default +dotnet_style_qualification_for_event = false:none # default + +dotnet_style_predefined_type_for_locals_parameters_members = true:warning +dotnet_style_predefined_type_for_member_access = true:warning + +dotnet_style_require_accessibility_modifiers = for_non_interface_members:warning +csharp_preferred_modifier_order = public, private, protected, internal, static, extern, new, virtual, abstract, sealed, override, readonly, unsafe, volatile, async:none # default +dotnet_style_readonly_field = true:error + +dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:error +dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:error +dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:error +dotnet_style_parentheses_in_other_operators = never_if_unnecessary:none # default + +dotnet_style_object_initializer = true:suggestion # default +dotnet_style_collection_initializer = true:suggestion # default +dotnet_style_explicit_tuple_names = true:error # don't use Item1 when there's a meaningful name +dotnet_style_prefer_inferred_tuple_names = true:suggestion # default +dotnet_style_prefer_inferred_anonymous_type_member_names = false:warning # inferred name changes can lead to serialization errors and unintended API changes +dotnet_style_prefer_auto_properties = true:none # default +dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion # default +dotnet_style_prefer_conditional_expression_over_assignment = true:none # default +dotnet_style_prefer_conditional_expression_over_return = true:none # default + +dotnet_style_coalesce_expression = true:suggestion # default +dotnet_style_null_propagation = true:suggestion # default + +csharp_style_var_for_built_in_types = false:suggestion +csharp_style_var_when_type_is_apparent = false:none +csharp_style_var_elsewhere = false:suggestion + +csharp_style_expression_bodied_methods = false:none # default +csharp_style_expression_bodied_constructors = false:none # default +csharp_style_expression_bodied_operators = false:none # default +csharp_style_expression_bodied_properties = true:none # default +csharp_style_expression_bodied_indexers = true:none # default +csharp_style_expression_bodied_accessors = true:none # default + +csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion # default +csharp_style_pattern_matching_over_as_with_null_check = true:suggestion # default + +csharp_style_inlined_variable_declaration = true:suggestion # default + +csharp_prefer_simple_default_expression = true:suggestion # default +csharp_style_deconstructed_variable_declaration = true:suggestion # default +csharp_style_pattern_local_over_anonymous_function = true:suggestion # default + +csharp_style_throw_expression = true:suggestion # default +csharp_style_conditional_delegate_call = true:suggestion # default + +csharp_prefer_braces = true:error + +# Formatting conventions (https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference?view=vs-2017#formatting-conventions) +dotnet_sort_system_directives_first = true # default + +csharp_new_line_before_open_brace = none +csharp_new_line_before_else = false +csharp_new_line_before_catch = false +csharp_new_line_before_finally = false +csharp_new_line_before_members_in_object_initializers = true # default +csharp_new_line_before_members_in_anonymous_types = true # default +csharp_new_line_between_query_expression_clauses = false + +csharp_indent_case_contents = true # default +csharp_indent_switch_labels = true # default +csharp_indent_labels = no_change # default + +csharp_space_after_cast = false # default +csharp_space_after_keywords_in_control_flow_statements = false +csharp_space_between_method_declaration_parameter_list_parentheses = true +csharp_space_between_method_call_parameter_list_parentheses = true +csharp_space_between_parentheses = control_flow_statements, expressions +csharp_space_before_colon_in_inheritance_clause = true # default +csharp_space_after_colon_in_inheritance_clause = true # default +csharp_space_around_binary_operators = before_and_after # default +csharp_space_between_method_declaration_empty_parameter_list_parentheses = false # default +csharp_space_between_method_call_name_and_opening_parenthesis = false # default +csharp_space_between_method_call_empty_parameter_list_parentheses = false # default + +csharp_preserve_single_line_statements = true # default +csharp_preserve_single_line_blocks = true # default diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..b2f96ee --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,33 @@ +name: build +on: [push] + +env: + VERSION_PREFIX: "0.0.1" + +jobs: + build: + runs-on: windows-latest + + steps: + + - uses: Brightspace/third-party-actions@actions/checkout + + - name: Setup .NET Core + uses: Brightspace/third-party-actions@actions/setup-dotnet + with: + dotnet-version: 3.1.x + + - name: dotnet tool restore + run: dotnet tool restore + + - name: Generate version properties + run: dotnet ci-version-properties --output VersionInfo.props && cat VersionInfo.props + + - name: dotnet restore + run: dotnet restore + + - name: dotnet build + run: dotnet build --configuration Release + + - name: dotnet test + run: dotnet test --configuration Release --no-build diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e12b566 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +.vs/ +bin/ +obj/ +packages/ +*.user +launchSettings.json \ No newline at end of file diff --git a/D2L.DynamoDBv2.NUnitHelpers.sln b/D2L.DynamoDBv2.NUnitHelpers.sln new file mode 100644 index 0000000..327f6e8 --- /dev/null +++ b/D2L.DynamoDBv2.NUnitHelpers.sln @@ -0,0 +1,37 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30804.86 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "D2L.DynamoDBv2.NUnitHelpers", "src\D2L.DynamoDBv2.NUnitHelpers\D2L.DynamoDBv2.NUnitHelpers.csproj", "{919AEE16-523B-48FB-82B9-4B3E7D3E5047}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{356A87B5-A285-4018-8923-D8409A373B54}" + ProjectSection(SolutionItems) = preProject + .editorconfig = .editorconfig + Directory.Build.props = Directory.Build.props + EndProjectSection +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "D2L.DynamoDBv2.NUnitHelpers.Tests", "test\D2L.DynamoDBv2.NUnitHelpers.Tests\D2L.DynamoDBv2.NUnitHelpers.Tests.csproj", "{0DC5FD65-466B-495E-9439-281A08B5D150}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {919AEE16-523B-48FB-82B9-4B3E7D3E5047}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {919AEE16-523B-48FB-82B9-4B3E7D3E5047}.Debug|Any CPU.Build.0 = Debug|Any CPU + {919AEE16-523B-48FB-82B9-4B3E7D3E5047}.Release|Any CPU.ActiveCfg = Release|Any CPU + {919AEE16-523B-48FB-82B9-4B3E7D3E5047}.Release|Any CPU.Build.0 = Release|Any CPU + {0DC5FD65-466B-495E-9439-281A08B5D150}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0DC5FD65-466B-495E-9439-281A08B5D150}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0DC5FD65-466B-495E-9439-281A08B5D150}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0DC5FD65-466B-495E-9439-281A08B5D150}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {501D297A-7621-47AB-8305-24B9A967D880} + EndGlobalSection +EndGlobal diff --git a/Directory.Build.props b/Directory.Build.props new file mode 100644 index 0000000..a0308b9 --- /dev/null +++ b/Directory.Build.props @@ -0,0 +1,23 @@ + + + + + true + false + false + 8.0 + enable + true + + + + Jeff Ashton + D2L Corporation + Copyright © 2020 + MIT + https://github.com/Brightspace/D2L.DynamoDBv2.NUnitHelpers + git + https://github.com/Brightspace/D2L.DynamoDBv2.NUnitHelpers + + + diff --git a/README.md b/README.md index 660dbb3..30d66cd 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ -# D2L.DynamoDBv2.TestHelpers +# D2L.DynamoDBv2.NUnitHelpers + Helper library for testing .NET DynamoDB operations. diff --git a/VersionInfo.props b/VersionInfo.props new file mode 100644 index 0000000..8a13ced --- /dev/null +++ b/VersionInfo.props @@ -0,0 +1,5 @@ + + + 0.0.0-dev + + \ No newline at end of file diff --git a/src/D2L.DynamoDBv2.NUnitHelpers/D2L.DynamoDBv2.NUnitHelpers.csproj b/src/D2L.DynamoDBv2.NUnitHelpers/D2L.DynamoDBv2.NUnitHelpers.csproj new file mode 100644 index 0000000..389c39d --- /dev/null +++ b/src/D2L.DynamoDBv2.NUnitHelpers/D2L.DynamoDBv2.NUnitHelpers.csproj @@ -0,0 +1,11 @@ + + + true + Library + net45;netcoreapp3.1;netstandard2.0 + + + + + + \ No newline at end of file diff --git a/test/D2L.DynamoDBv2.NUnitHelpers.Tests/D2L.DynamoDBv2.NUnitHelpers.Tests.csproj b/test/D2L.DynamoDBv2.NUnitHelpers.Tests/D2L.DynamoDBv2.NUnitHelpers.Tests.csproj new file mode 100644 index 0000000..1afe24c --- /dev/null +++ b/test/D2L.DynamoDBv2.NUnitHelpers.Tests/D2L.DynamoDBv2.NUnitHelpers.Tests.csproj @@ -0,0 +1,13 @@ + + + Library + net45;netcoreapp3.1 + + + + + + + + + \ No newline at end of file