diff --git a/.appveyor.yml b/.appveyor.yml index 3a99359..6f44fde 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,7 +1,23 @@ #---------------------------------# # Build Image # #---------------------------------# -image: Visual Studio 2019 +image: Visual Studio 2022 + +#---------------------------------# +# Install .NET # +#---------------------------------# +install: + - ps: $env:DOTNET_INSTALL_DIR = "$pwd\.dotnetsdk" + - ps: mkdir $env:DOTNET_INSTALL_DIR -Force | Out-Null + - ps: Invoke-WebRequest -Uri "https://dotnet.microsoft.com/download/dotnet/scripts/v1/dotnet-install.ps1" -OutFile "$($env:DOTNET_INSTALL_DIR)/dotnet-install.ps1" + - ps: '& "$($env:DOTNET_INSTALL_DIR)/dotnet-install.ps1" -Channel 2.1 -InstallDir $env:DOTNET_INSTALL_DIR' + - ps: '& "$($env:DOTNET_INSTALL_DIR)/dotnet-install.ps1" -Channel 3.1 -InstallDir $env:DOTNET_INSTALL_DIR' + - ps: '& "$($env:DOTNET_INSTALL_DIR)/dotnet-install.ps1" -Channel 5.0 -InstallDir $env:DOTNET_INSTALL_DIR' + - ps: '& "$($env:DOTNET_INSTALL_DIR)/dotnet-install.ps1" -Channel 6.0 -InstallDir $env:DOTNET_INSTALL_DIR' + - ps: '& "$($env:DOTNET_INSTALL_DIR)/dotnet-install.ps1" -Channel 7.0 -InstallDir $env:DOTNET_INSTALL_DIR' + - ps: '& "$($env:DOTNET_INSTALL_DIR)/dotnet-install.ps1" -Channel 8.0 -InstallDir $env:DOTNET_INSTALL_DIR' + - ps: $env:Path = "$env:DOTNET_INSTALL_DIR;$env:Path" + - ps: dotnet --info #---------------------------------# # Build Script # diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 727dfd7..4903ba5 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,7 +3,7 @@ "isRoot": true, "tools": { "cake.tool": { - "version": "0.38.5", + "version": "1.3.0", "commands": [ "dotnet-cake" ] diff --git a/.editorconfig b/.editorconfig index 1172014..0aae7a9 100644 --- a/.editorconfig +++ b/.editorconfig @@ -5,12 +5,14 @@ root = true [*] end_of_line = CRLF +trim_trailing_whitespace = true -[*.ps1] -indent_style = space -indent_size = 4 +[*.md] +trim_trailing_whitespace = false -[*.cs] +[*.{bat,ps1}] +charset = utf-8-bom +end_of_line = crlf indent_style = space indent_size = 4 diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 5ceefc9..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,12 +0,0 @@ -version: 2 -updates: - - package-ecosystem: "nuget" - directory: "/" - schedule: - interval: "daily" - ignore: - - "Cake.Core" - - package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: "daily" \ No newline at end of file diff --git a/.github/renovate.json b/.github/renovate.json new file mode 100644 index 0000000..8ef1836 --- /dev/null +++ b/.github/renovate.json @@ -0,0 +1,14 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ + "github>cake-contrib/renovate-presets:cake-recipe", + "github>cake-contrib/renovate-presets:github-actions" ], + "packageRules": [ + { + "description": "Updates to Cake.Core references are breaking.", + "matchPackageNames": ["Cake.Core"], + "matchUpdateTypes": ["major"], + "labels": ["Breaking Change"] + } + ] +} \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..4dcbf9b --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,92 @@ +name: Build + +on: + push: + branches: + - master + - develop + - "feature/**" + - "release/**" + - "hotfix/**" + tags: + - "*" + paths-ignore: + - "README.md" + pull_request: + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [windows-2022, ubuntu-22.04, macos-12] + + env: + AZURE_PASSWORD: ${{ secrets.AZURE_PASSWORD }} + AZURE_SOURCE: ${{ secrets.AZURE_SOURCE }} + AZURE_USER: ${{ secrets.AZURE_USER }} + GITHUB_PAT: ${{ secrets.GH_TOKEN }} + GPR_PASSWORD: ${{ secrets.GPR_PASSWORD }} + GPR_SOURCE: ${{ secrets.GPR_SOURCE }} + GPR_USER: ${{ secrets.GPR_USER }} + NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} + NUGET_SOURCE: "https://api.nuget.org/v3/index.json" + TWITTER_ACCESS_TOKEN: ${{ secrets.TWITTER_ACCESS_TOKEN }} + TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }} + TWITTER_CONSUMER_KEY: ${{ secrets.TWITTER_CONSUMER_KEY }} + TWITTER_CONSUMER_SECRET: ${{ secrets.TWITTER_CONSUMER_SECRET }} + WYAM_ACCESS_TOKEN: ${{ secrets.WYAM_ACCESS_TOKEN }} + WYAM_DEPLOY_BRANCH: "gh-pages" + WYAM_DEPLOY_REMOTE: ${{ github.event.repository.html_url }} + + steps: + - name: Checkout the repository + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 + + - name: Fetch all tags and branches + run: git fetch --prune --unshallow + + - name: Cache Tools + uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4 + with: + path: tools + key: ${{ runner.os }}-tools-${{ hashFiles('recipe.cake', '.config/dotnet-tools.json') }} + + # install libgit2-dev on ubuntu, so libgit2sharp works + - name: Install libgit-dev + if: runner.os == 'Linux' + run: sudo apt-get install -y libgit2-dev + + - name: Setup required dotnet versions + uses: actions/setup-dotnet@6bd8b7f7774af54e05809fcc5431931b3eb1ddee # v4.0.1 + with: + dotnet-version: | + 2.1.818 + 3.1.x + 5.0.x + 6.0.x + 7.0.x + 8.0.x + + - name: Build project + uses: cake-build/cake-action@1223b6fa067ad192159f43b50cd4f953679b0934 # v2.0.0 + with: + script-path: recipe.cake + target: CI + verbosity: Normal + cake-version: tool-manifest + + - name: Upload Issues-Report + uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4 + with: + if-no-files-found: warn + name: ${{ matrix.os }} Issues + path: BuildArtifacts/report.html + + - name: Upload Packages + if: runner.os == 'Windows' + uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4 + with: + if-no-files-found: warn + name: package + path: BuildArtifacts/Packages/**/* diff --git a/.github/workflows/release-notes.yml b/.github/workflows/release-notes.yml index 8fa1ace..97ea408 100644 --- a/.github/workflows/release-notes.yml +++ b/.github/workflows/release-notes.yml @@ -11,34 +11,34 @@ jobs: steps: - name: Checkout the requested branch - uses: actions/checkout@v2.3.4 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - name: Fetch all tags and branches run: git fetch --prune --unshallow - name: Cache Tools - uses: actions/cache@v2.1.4 + uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 with: path: tools key: ${{ runner.os }}-tools-${{ hashFiles('recipe.cake') }} - name: Set up git version if: ${{ !contains(github.ref, '/hotfix/') && !contains(github.ref, '/release/') }} - uses: gittools/actions/gitversion/setup@v0.9.9 + uses: gittools/actions/gitversion/setup@dcb17efb49ec7f20efdebce79cc397a3952c63db # v1.2.0 with: versionSpec: "5.x" - name: Run git version if: ${{ !contains(github.ref, '/hotfix/') && !contains(github.ref, '/release/') }} id: gitversion - uses: gittools/actions/gitversion/execute@v0.9.9 + uses: gittools/actions/gitversion/execute@dcb17efb49ec7f20efdebce79cc397a3952c63db # v1.2.0 - name: Create release branch ${{ github.event.inputs.version }} if: ${{ steps.gitversion.outputs.majorMinorPatch }} run: git switch -c release/${{ steps.gitversion.outputs.majorMinorPatch }} - name: Push new branch if: ${{ steps.gitversion.outputs.majorMinorPatch }} - uses: ad-m/github-push-action@v0.6.0 + uses: ad-m/github-push-action@d91a481090679876dfc4178fef17f286781251df # v0.8.0 with: branch: "release/${{ steps.gitversion.outputs.majorMinorPatch }}" github_token: ${{ secrets.GH_TOKEN }} - name: Drafting Release Notes - uses: cake-build/cake-action@v1 + uses: cake-build/cake-action@a6eb054329257c9e70a6c6bf01747ad6e1d9d52b # v1 with: script-path: recipe.cake target: releasenotes diff --git a/.gitignore b/.gitignore index f919d56..477b4f8 100644 --- a/.gitignore +++ b/.gitignore @@ -345,4 +345,5 @@ BuildArtifacts/* .DS_Store # Wyam -docs/input/tasks \ No newline at end of file +docs/input/tasks +/config.wyam.* diff --git a/GitReleaseManager.yaml b/GitReleaseManager.yaml index 405c5a6..e70d24b 100644 --- a/GitReleaseManager.yaml +++ b/GitReleaseManager.yaml @@ -1,12 +1,14 @@ issue-labels-include: - Breaking change -- Feature - Bug +- Feature +- Enhancement - Improvement - Documentation - security issue-labels-exclude: - Build +- Internal / Refactoring issue-labels-alias: - name: Documentation header: Documentation @@ -15,9 +17,24 @@ issue-labels-alias: header: Security plural: Security create: - include-sha-section: true - sha-section-heading: "SHA256 Hashes of the release artifacts" - sha-section-line-format: "- `{1}\t{0}`" + include-footer: true + footer-heading: Where to get it + footer-content: > + You can download this release from + [nuget](https://nuget.org/packages/Cake.DotNetVersionDetector/{milestone}), + or you can just reference it in a cake build script + with `#addin nuget:?package=Cake.DotNetVersionDetector&version={milestone}`. + footer-includes-milestone: true + milestone-replace-text: "{milestone}" + include-sha-section: true + sha-section-heading: "SHA256 Hashes of the release artifacts" + sha-section-line-format: "- `{1}\t{0}`" +export: + include-created-date-in-title: true + created-date-string-format: yyyy-MM-dd + perform-regex-removal: true + regex-text: '[\r\n]*### Where to get it[\r\n]*You can .*`\.[\r\n]*' + multiline-regex: true close: use-issue-comments: true issue-comment: |- @@ -28,4 +45,4 @@ close: - [GitHub Release](https://github.com/{owner}/{repository}/releases/tag/{milestone}) - [NuGet Package](https://www.nuget.org/packages/{repository}/{milestone}) - Your **[GitReleaseManager](https://github.com/GitTools/GitReleaseManager)** bot :package::rocket: \ No newline at end of file + Your **[GitReleaseManager](https://github.com/GitTools/GitReleaseManager)** bot :package::rocket: diff --git a/README.md b/README.md new file mode 100644 index 0000000..e75ce86 --- /dev/null +++ b/README.md @@ -0,0 +1,36 @@ +# Cake.DotNetVersionDetector + +Cake.DotNetVersionDetector is set of aliases for [Cake][0] that help simplify using [ASoft .NET Version Detector][1]. + +[![License](http://img.shields.io/:license-mit-blue.svg)][2] + +## Information + +| |Stable|Pre-release| +|:--:|:--:|:--:| +|GitHub Release|-|[![GitHub release](https://img.shields.io/github/release/cake-contrib/Cake.DotNetVersionDetector.svg)][3]| +|NuGet|[![MyGet](https://img.shields.io/myget/cake-contrib/vpre/Cake.DotNetVersionDetector.svg)][4]|[![NuGet](https://img.shields.io/nuget/vpre/Cake.DotNetVersionDetector.svg)][5]| + +## Build Status + +|Develop|Master| +|:--:|:--:| +|[![Build status][6]][7]|[![Build status][8]][7]| + +## Quick Links + +- [API Documentation][9] +- [Usage Examples][10] + + +[0]: https://cakebuild.net/ +[1]: https://www.asoft.be/prod_netver.html +[2]: https://mit-license.org/ +[3]: https://github.com/cake-contrib/Cake.DotNetVersionDetector/releases/latest +[4]: https://www.myget.org/feed/cake-contrib/package/nuget/Cake.DotNetVersionDetector +[5]: https://www.nuget.org/packages/Cake.DotNetVersionDetector +[6]: https://github.com/cake-contrib/Cake.DotNetVersionDetector/actions/workflows/build.yml/badge.svg?branch=develop +[7]: https://github.com/cake-contrib/Cake.DotNetVersionDetector/actions/workflows/build.yml +[8]: https://github.com/cake-contrib/Cake.DotNetVersionDetector/actions/workflows/build.yml/badge.svg?branch=master +[9]: https://cakebuild.net/dsl/DotNetVersionDetector/ +[10]: https://cake-contrib.github.io/Cake.DotNetVersionDetector/docs/usage/examples diff --git a/Source/.editorconfig b/Source/.editorconfig new file mode 100644 index 0000000..be3351d --- /dev/null +++ b/Source/.editorconfig @@ -0,0 +1,241 @@ + +# This may not be needed, but kept for compatibility with VS +[*.{sln,csproj}] +end_of_line = crlf +indent_size = 2 + +# C# files +[*.cs] + +#### Core EditorConfig Options #### + +# Indentation and spacing +indent_size = 4 +indent_style = space +tab_width = 4 + +# New line preferences +end_of_line = crlf +insert_final_newline = true + +#### .NET Coding Conventions #### + +# Organize usings +dotnet_separate_import_directive_groups = true +dotnet_sort_system_directives_first = true +file_header_template = unset + +# this. and Me. preferences +dotnet_style_qualification_for_event = false:warning +dotnet_style_qualification_for_field = false:warning +dotnet_style_qualification_for_method = false:warning +dotnet_style_qualification_for_property = false:warning + +# Language keywords vs BCL types preferences +dotnet_style_predefined_type_for_locals_parameters_members = true:warning +dotnet_style_predefined_type_for_member_access = true:warning + +# Parentheses preferences +dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent +dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent +dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent +dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent + +# Modifier preferences +dotnet_style_require_accessibility_modifiers = for_non_interface_members:warning + +# Expression-level preferences +dotnet_style_coalesce_expression = true:suggestion +dotnet_style_collection_initializer = true:suggestion +dotnet_style_explicit_tuple_names = true:suggestion +dotnet_style_null_propagation = true:suggestion +dotnet_style_object_initializer = true:suggestion +dotnet_style_operator_placement_when_wrapping = beginning_of_line +dotnet_style_prefer_auto_properties = true:silent +dotnet_style_prefer_compound_assignment = true:suggestion +dotnet_style_prefer_conditional_expression_over_assignment = true:silent +dotnet_style_prefer_conditional_expression_over_return = true:silent +dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion +dotnet_style_prefer_inferred_tuple_names = true:suggestion +dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion +dotnet_style_prefer_simplified_boolean_expressions = true:suggestion +dotnet_style_prefer_simplified_interpolation = true:suggestion + +# Field preferences +dotnet_style_readonly_field = true:suggestion + +# Parameter preferences +dotnet_code_quality_unused_parameters = all:suggestion + +#### C# Coding Conventions #### + +# var preferences +csharp_style_var_elsewhere = false:silent +csharp_style_var_for_built_in_types = false:silent +csharp_style_var_when_type_is_apparent = false:silent + +# Expression-bodied members +csharp_style_expression_bodied_accessors = true:silent +csharp_style_expression_bodied_constructors = false:silent +csharp_style_expression_bodied_indexers = true:silent +csharp_style_expression_bodied_lambdas = true:silent +csharp_style_expression_bodied_local_functions = false:silent +csharp_style_expression_bodied_methods = false:silent +csharp_style_expression_bodied_operators = false:silent +csharp_style_expression_bodied_properties = true:silent + +# Pattern matching preferences +csharp_style_pattern_matching_over_as_with_null_check = true:suggestion +csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion +csharp_style_prefer_switch_expression = true:suggestion + +# Null-checking preferences +csharp_style_conditional_delegate_call = true:suggestion + +# Modifier preferences +csharp_prefer_static_local_function = true:suggestion +csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:silent + +# Code-block preferences +csharp_prefer_braces = true:silent +csharp_prefer_simple_using_statement = true:suggestion + +# Expression-level preferences +csharp_prefer_simple_default_expression = true:suggestion +csharp_style_deconstructed_variable_declaration = true:suggestion +csharp_style_inlined_variable_declaration = true:suggestion +csharp_style_pattern_local_over_anonymous_function = true:suggestion +csharp_style_prefer_index_operator = true:suggestion +csharp_style_prefer_range_operator = true:suggestion +csharp_style_throw_expression = true:suggestion +csharp_style_unused_value_assignment_preference = discard_variable:suggestion +csharp_style_unused_value_expression_statement_preference = discard_variable:silent + +# 'using' directive preferences +csharp_using_directive_placement = outside_namespace:warning + +#### C# Formatting Rules #### + +# New line preferences +csharp_new_line_before_catch = true +csharp_new_line_before_else = true +csharp_new_line_before_finally = true +csharp_new_line_before_members_in_anonymous_types = true +csharp_new_line_before_members_in_object_initializers = true +csharp_new_line_before_open_brace = all +csharp_new_line_between_query_expression_clauses = true + +# Indentation preferences +csharp_indent_block_contents = true +csharp_indent_braces = false +csharp_indent_case_contents = true +csharp_indent_case_contents_when_block = false +csharp_indent_labels = flush_left +csharp_indent_switch_labels = true + +# Space preferences +csharp_space_after_cast = false +csharp_space_after_colon_in_inheritance_clause = true +csharp_space_after_comma = true +csharp_space_after_dot = false +csharp_space_after_keywords_in_control_flow_statements = true +csharp_space_after_semicolon_in_for_statement = true +csharp_space_around_binary_operators = before_and_after +csharp_space_around_declaration_statements = false +csharp_space_before_colon_in_inheritance_clause = true +csharp_space_before_comma = false +csharp_space_before_dot = false +csharp_space_before_open_square_brackets = false +csharp_space_before_semicolon_in_for_statement = false +csharp_space_between_empty_square_brackets = false +csharp_space_between_method_call_empty_parameter_list_parentheses = false +csharp_space_between_method_call_name_and_opening_parenthesis = false +csharp_space_between_method_call_parameter_list_parentheses = false +csharp_space_between_method_declaration_empty_parameter_list_parentheses = false +csharp_space_between_method_declaration_name_and_open_parenthesis = false +csharp_space_between_method_declaration_parameter_list_parentheses = false +csharp_space_between_parentheses = false +csharp_space_between_square_brackets = false + +# Wrapping preferences +csharp_preserve_single_line_blocks = true +csharp_preserve_single_line_statements = false + +#### Naming styles #### + +# Naming rules + +dotnet_naming_rule.interface_should_be_begins_with_i.severity = warning +dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface +dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i + +dotnet_naming_rule.types_should_be_pascal_case.severity = warning +dotnet_naming_rule.types_should_be_pascal_case.symbols = types +dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case + +dotnet_naming_rule.method_should_be_pascal_case.severity = warning +dotnet_naming_rule.method_should_be_pascal_case.symbols = method +dotnet_naming_rule.method_should_be_pascal_case.style = pascal_case + +dotnet_naming_rule.public_or_protected_field_should_be_pascal_case.severity = warning +dotnet_naming_rule.public_or_protected_field_should_be_pascal_case.symbols = public_or_protected_field +dotnet_naming_rule.public_or_protected_field_should_be_pascal_case.style = pascal_case + +dotnet_naming_rule.private_or_internal_static_field_should_be_pascal_case.severity = warning +dotnet_naming_rule.private_or_internal_static_field_should_be_pascal_case.symbols = private_or_internal_static_field +dotnet_naming_rule.private_or_internal_static_field_should_be_pascal_case.style = pascal_case + +dotnet_naming_rule.private_or_internal_field_should_be_camelcase.severity = warning +dotnet_naming_rule.private_or_internal_field_should_be_camelcase.symbols = private_or_internal_field +dotnet_naming_rule.private_or_internal_field_should_be_camelcase.style = camelcase + +dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = warning +dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members +dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case + +# Symbol specifications + +dotnet_naming_symbols.interface.applicable_kinds = interface +dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.interface.required_modifiers = + +dotnet_naming_symbols.method.applicable_kinds = method +dotnet_naming_symbols.method.applicable_accessibilities = public +dotnet_naming_symbols.method.required_modifiers = + +dotnet_naming_symbols.public_or_protected_field.applicable_kinds = field +dotnet_naming_symbols.public_or_protected_field.applicable_accessibilities = public, protected +dotnet_naming_symbols.public_or_protected_field.required_modifiers = + +dotnet_naming_symbols.private_or_internal_field.applicable_kinds = field +dotnet_naming_symbols.private_or_internal_field.applicable_accessibilities = internal, private, private_protected +dotnet_naming_symbols.private_or_internal_field.required_modifiers = + +dotnet_naming_symbols.private_or_internal_static_field.applicable_kinds = field +dotnet_naming_symbols.private_or_internal_static_field.applicable_accessibilities = internal, private, private_protected +dotnet_naming_symbols.private_or_internal_static_field.required_modifiers = static + +dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum +dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.types.required_modifiers = + +dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method +dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.non_field_members.required_modifiers = + +# Naming styles + +dotnet_naming_style.pascal_case.required_prefix = +dotnet_naming_style.pascal_case.required_suffix = +dotnet_naming_style.pascal_case.word_separator = +dotnet_naming_style.pascal_case.capitalization = pascal_case + +dotnet_naming_style.begins_with_i.required_prefix = I +dotnet_naming_style.begins_with_i.required_suffix = +dotnet_naming_style.begins_with_i.word_separator = +dotnet_naming_style.begins_with_i.capitalization = pascal_case + +dotnet_naming_style.camelcase.required_prefix = +dotnet_naming_style.camelcase.required_suffix = +dotnet_naming_style.camelcase.word_separator = +dotnet_naming_style.camelcase.capitalization = camel_case \ No newline at end of file diff --git a/Source/Cake.DotNetVersionDetector.Tests/Cake.DotNetVersionDetector.Tests.csproj b/Source/Cake.DotNetVersionDetector.Tests/Cake.DotNetVersionDetector.Tests.csproj index 390fe1a..b04244f 100644 --- a/Source/Cake.DotNetVersionDetector.Tests/Cake.DotNetVersionDetector.Tests.csproj +++ b/Source/Cake.DotNetVersionDetector.Tests/Cake.DotNetVersionDetector.Tests.csproj @@ -9,18 +9,18 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all - - + + runtime; build; native; contentfiles; analyzers; buildtransitive all - - - + + + diff --git a/Source/Cake.DotNetVersionDetector.ruleset b/Source/Cake.DotNetVersionDetector.ruleset new file mode 100644 index 0000000..1f9e1cc --- /dev/null +++ b/Source/Cake.DotNetVersionDetector.ruleset @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/Source/Cake.DotNetVersionDetector.sln b/Source/Cake.DotNetVersionDetector.sln index e28c2bd..ae49c1b 100644 --- a/Source/Cake.DotNetVersionDetector.sln +++ b/Source/Cake.DotNetVersionDetector.sln @@ -7,6 +7,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cake.DotNetVersionDetector" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cake.DotNetVersionDetector.Tests", "Cake.DotNetVersionDetector.Tests\Cake.DotNetVersionDetector.Tests.csproj", "{78EB146D-2178-47FE-B999-1FECF1F3407B}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SolutionItems", "SolutionItems", "{3D89E7D0-898E-4F5D-8CB7-E572FC56E317}" + ProjectSection(SolutionItems) = preProject + Cake.DotNetVersionDetector.ruleset = Cake.DotNetVersionDetector.ruleset + Directory.Build.targets = Directory.Build.targets + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU diff --git a/Source/Cake.DotNetVersionDetector/Cake.DotNetVersionDetector.csproj b/Source/Cake.DotNetVersionDetector/Cake.DotNetVersionDetector.csproj index ee6b689..e74ab75 100644 --- a/Source/Cake.DotNetVersionDetector/Cake.DotNetVersionDetector.csproj +++ b/Source/Cake.DotNetVersionDetector/Cake.DotNetVersionDetector.csproj @@ -1,14 +1,21 @@ - net50;netstandard2.0 + net461;net5.0;netstandard2.0 true pdbonly en-GB Cake DotNetVersionDetector addin Cake Contributors + $(ProjectDir)../Cake.DotNetVersionDetector.ruleset + + + + + + @@ -21,32 +28,36 @@ $(AssemblyTitle) gep13;$(Company) Copyright © $(FullYear) — $(Authors.Replace(';',',')) - Cake addin for executing DotNetVersionDetector (http://www.asoft.be/prod_netver.html) - icon.png - https://cdn.jsdelivr.net/gh/cake-contrib/graphics/png/cake-contrib-medium.png + Cake addin for executing DotNetVersionDetector (https://www.asoft.be/prod_netver.html) MIT https://cake-contrib.github.io/Cake.DotNetVersionDetector/ - Cake;Cake Script;Build;DotNetVersionDetector; + Cake;Cake Script;Build;DotNetVersionDetector;cake-build;addin;cake-addin git https://github.com/cake-contrib/Cake.DotNetVersionDetector $(PackageSourceProjectUrl).git All release notes for $(AssemblyName) can be found on our GitHub release page - $(PackageSourceProjectUrl)/releases/tag/$(Version) Development releases do not contain release notes, please see the closed issues in these cases - $(PackageSourceProjectUrl)/issues?q=milestone:$(FileVersion)+is:closed + README.md - + all - + all runtime; build; native; contentfiles; analyzers - + + runtime; build; native; contentfiles; analyzers; buildtransitive all + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/Source/Cake.DotNetVersionDetector/DotNetVersionDetectorAliases.cs b/Source/Cake.DotNetVersionDetector/DotNetVersionDetectorAliases.cs index 32f9e97..5a1f36d 100644 --- a/Source/Cake.DotNetVersionDetector/DotNetVersionDetectorAliases.cs +++ b/Source/Cake.DotNetVersionDetector/DotNetVersionDetectorAliases.cs @@ -3,10 +3,12 @@ using Cake.Core.Annotations; using Cake.Core.IO; +using JetBrains.Annotations; + namespace Cake.DotNetVersionDetector { /// - /// Contains functionality related to the .Net Version Detector tool. + /// Contains functionality related to the .Net Version Detector tool. /// /// In order to use the commands for this addin, you will need to have the .Net Version Detector tool available. This can be installed via Chocolatey. /// In addition, you will need to include the following: @@ -16,10 +18,11 @@ namespace Cake.DotNetVersionDetector /// /// [CakeAliasCategory("DotNetVersionDetector")] + [PublicAPI] public static class DotNetVersionDetectorAliases { /// - /// Runs .Net Version Detector, and outputs to specified output FilePath + /// Runs .Net Version Detector, and outputs to specified output FilePath. /// /// The context. /// The output file path. @@ -34,8 +37,8 @@ public static void DotNetVersionDetector(this ICakeContext context, FilePath out DotNetVersionDetector(context, outputFilePath, new DotNetVersionDetectorSettings()); } -/// - /// Runs .Net Version Detector, and outputs to specified output FilePath with the specified DotNetVersionDetectorSettings + /// + /// Runs .Net Version Detector, and outputs to specified output FilePath with the specified DotNetVersionDetectorSettings. /// /// The context. /// The output file path. @@ -53,12 +56,12 @@ public static void DotNetVersionDetector(this ICakeContext context, FilePath out { if (context == null) { - throw new ArgumentNullException("context"); + throw new ArgumentNullException(nameof(context)); } if (outputFilePath == null) { - throw new ArgumentNullException("outputFilePath"); + throw new ArgumentNullException(nameof(outputFilePath)); } var runner = new DotNetVersionDetectorRunner(context.FileSystem, context.Environment, context.ProcessRunner, context.Tools); diff --git a/Source/Cake.DotNetVersionDetector/DotNetVersionDetectorRunner.cs b/Source/Cake.DotNetVersionDetector/DotNetVersionDetectorRunner.cs index 2d8129a..6714f65 100644 --- a/Source/Cake.DotNetVersionDetector/DotNetVersionDetectorRunner.cs +++ b/Source/Cake.DotNetVersionDetector/DotNetVersionDetectorRunner.cs @@ -7,11 +7,11 @@ namespace Cake.DotNetVersionDetector { /// - /// The .Net Version Detector Runner + /// The .Net Version Detector Runner. /// public class DotNetVersionDetectorRunner : Tool { - private readonly ICakeEnvironment _environment; + private readonly ICakeEnvironment environment; /// /// Initializes a new instance of the class. @@ -19,11 +19,11 @@ public class DotNetVersionDetectorRunner : Tool /// The file system. /// The environment. /// The process runner. - /// The tool locator + /// The tool locator. public DotNetVersionDetectorRunner(IFileSystem fileSystem, ICakeEnvironment environment, IProcessRunner processRunner, IToolLocator toolLocator) : base(fileSystem, environment, processRunner, toolLocator) { - _environment = environment; + this.environment = environment; } /// @@ -65,7 +65,7 @@ private ProcessArgumentBuilder GetArguments(FilePath outputFilePath, DotNetVersi { var builder = new ProcessArgumentBuilder(); - builder.AppendQuoted(outputFilePath.MakeAbsolute(_environment).FullPath); + builder.AppendQuoted(outputFilePath.MakeAbsolute(environment).FullPath); if (settings.Extended) { diff --git a/Source/Cake.DotNetVersionDetector/DotNetVersionDetectorSettings.cs b/Source/Cake.DotNetVersionDetector/DotNetVersionDetectorSettings.cs index 9a19af3..581e22e 100644 --- a/Source/Cake.DotNetVersionDetector/DotNetVersionDetectorSettings.cs +++ b/Source/Cake.DotNetVersionDetector/DotNetVersionDetectorSettings.cs @@ -1,4 +1,3 @@ -using Cake.Core.IO; using Cake.Core.Tooling; namespace Cake.DotNetVersionDetector @@ -9,7 +8,7 @@ namespace Cake.DotNetVersionDetector public sealed class DotNetVersionDetectorSettings : ToolSettings { /// - /// Gets of sets a value indicating whether or not to output extended information in reports or not. + /// Gets or sets a value indicating whether, or not to output extended information in reports or not. /// public bool Extended { get; set; } } diff --git a/Source/Cake.DotNetVersionDetector/icon.png b/Source/Cake.DotNetVersionDetector/icon.png deleted file mode 100644 index 9881edc..0000000 Binary files a/Source/Cake.DotNetVersionDetector/icon.png and /dev/null differ diff --git a/Source/stylecop.json b/Source/stylecop.json new file mode 100644 index 0000000..3d7a981 --- /dev/null +++ b/Source/stylecop.json @@ -0,0 +1,22 @@ +{ + "$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json", + "settings": { + "indentation": { + "indentationSize": 4, + "tabSize": 4, + "useTabs": false + }, + "orderingRules": { + "usingDirectivesPlacement": "outsideNamespace", + "blankLinesBetweenUsingGroups": "allow", + "systemUsingDirectivesFirst": true + }, + "documentationRules": { + "xmlHeader": false, + "documentExposedElements": true, + "documentInternalElements": false, + "documentPrivateElements": false, + "documentPrivateFields": false + } + } +} \ No newline at end of file diff --git a/azure-pipelines.yml b/azure-pipelines.yml index edc8f43..91b9207 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -22,10 +22,33 @@ steps: inputs: key: '"$(Agent.OS)" | recipe.cake' path: 'tools' +- task: UseDotNet@2 + displayName: 'Install .NETCore 2.1' + inputs: + version: '2.1.x' +- task: UseDotNet@2 + displayName: 'Install .NETCore 3.1' + inputs: + version: '3.1.x' +- task: UseDotNet@2 + displayName: 'Install .NET 5' + inputs: + version: '5.x' +- task: UseDotNet@2 + displayName: 'Install .NET 6' + inputs: + version: '6.x' +- task: UseDotNet@2 + displayName: 'Install .NET 7' + inputs: + version: '7.x' +- task: UseDotNet@2 + displayName: 'Install .NET 8' + inputs: + version: '8.x' - task: Cake@2 inputs: script: 'recipe.cake' target: 'CI' verbosity: 'Normal' - Bootstrap: true - Version: '0.38.5' \ No newline at end of file + Version: '1.3.0' \ No newline at end of file diff --git a/build.ps1 b/build.ps1 index 0940a31..ea6b645 100644 --- a/build.ps1 +++ b/build.ps1 @@ -6,10 +6,6 @@ Write-Host "Restoring .NET Core tools" dotnet tool restore if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } -Write-Host "Bootstrapping Cake" -dotnet cake $SCRIPT_NAME --bootstrap -if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } - Write-Host "Running Build" dotnet cake $SCRIPT_NAME @args if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } \ No newline at end of file diff --git a/build.sh b/build.sh index ba5d0c9..9ed86f0 100755 --- a/build.sh +++ b/build.sh @@ -4,8 +4,5 @@ SCRIPT_NAME="recipe.cake" echo "Restoring .NET Core tools" dotnet tool restore -echo "Bootstrapping Cake" -dotnet cake $SCRIPT_NAME --bootstrap - echo "Running Build" dotnet cake $SCRIPT_NAME "$@" \ No newline at end of file diff --git a/docs/input/docs/usage/examples.md b/docs/input/docs/usage/examples.md index 3e74769..42d82fe 100644 --- a/docs/input/docs/usage/examples.md +++ b/docs/input/docs/usage/examples.md @@ -1,6 +1,17 @@ --- Title: Examples --- +# Install the DotNetVersionDetector + +The DotNetVersionDetector (`dotnetversion.exe`) needs to be installed on your system before +Cake.DotNetVersionDetector can make use of it. + +You can download and install it manually from the [ASoft website](https://www.asoft.be/prod_netver.html). +Alternatively, you can install it by utilizing [Chocolatey](https://chocolatey.org): + +```pwsh +choco install dotnetversiondetector +``` # Basic Usage diff --git a/docs/input/index.cshtml b/docs/input/index.cshtml index 499d655..f331f7d 100644 --- a/docs/input/index.cshtml +++ b/docs/input/index.cshtml @@ -8,6 +8,6 @@ NoGutter: true

What is it?

- Cake.DotNetVersionDetector is an Addin for Cake which allows executing the DotNetVersionDetector exectuable. + Cake.DotNetVersionDetector is an Addin for Cake which allows executing the ASoft .NET Version Detector exectuable.

diff --git a/recipe.cake b/recipe.cake index 477d62f..0193459 100644 --- a/recipe.cake +++ b/recipe.cake @@ -1,4 +1,4 @@ -#load nuget:?package=Cake.Recipe&version=2.2.0 +#load nuget:?package=Cake.Recipe&version=3.1.1 Environment.SetVariableNames(); @@ -10,11 +10,14 @@ BuildParameters.SetParameters(context: Context, repositoryName: "Cake.DotNetVersionDetector", appVeyorAccountName: "cakecontrib", shouldRunDotNetCorePack: true, - preferredBuildProviderType: BuildProviderType.AzurePipelines, + preferredBuildProviderType: BuildProviderType.GitHubActions, shouldRunCodecov: false); BuildParameters.PrintParameters(Context); +ToolSettings.SetToolPreprocessorDirectives( + gitReleaseManagerGlobalTool: "#tool dotnet:?package=GitReleaseManager.Tool&version=0.18.0"); + ToolSettings.SetToolSettings(context: Context, testCoverageFilter: "+[*]* -[xunit.*]* -[Cake.Core]* -[Cake.Testing]* -[*.Tests]*", testCoverageExcludeByAttribute: "*.ExcludeFromCodeCoverage*",