diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..1e10e86 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,18 @@ +[*.cs] +csharp_style_prefer_primary_constructors = false +dotnet_style_prefer_collection_expression = false + +# ReSharper properties +resharper_align_multiline_binary_expressions_chain = false +resharper_braces_for_foreach = required +resharper_braces_for_ifelse = required +resharper_braces_for_while = required +resharper_csharp_keep_blank_lines_in_code = 1 +resharper_csharp_keep_blank_lines_in_declarations = 1 +resharper_csharp_wrap_before_binary_opsign = true +resharper_csharp_wrap_parameters_style = chop_if_long +resharper_method_or_operator_body = expression_body +resharper_place_single_method_argument_lambda_on_same_line = false +resharper_wrap_after_declaration_lpar = true +resharper_wrap_after_invocation_lpar = true +resharper_wrap_chained_binary_expressions = chop_if_long diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 0000000..46cadf9 --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,30 @@ +name: PR Workflow +on: + pull_request: # Triggers when you create a PR +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read + actions: read + checks: write + steps: + - uses: actions/checkout@v7 + - name: Setup .NET + uses: actions/setup-dotnet@v5 + with: + dotnet-version: 10.0.x + - name: Restore dependencies + run: dotnet restore + - name: Build + run: dotnet build --no-restore + - name: Run Tests + run: dotnet test --report-trx --results-directory=".artifacts/test-results" --no-build --no-restore || true + - name: Publish Test Report + uses: dorny/test-reporter@v3 + if: ${{ !cancelled() }} + with: + name: .NET Core Tests + path: ".artifacts/test-results/**/*.trx" + reporter: dotnet-trx + fail-on-error: true diff --git a/.github/workflows/release-nuget.yml b/.github/workflows/release-nuget.yml new file mode 100644 index 0000000..4808152 --- /dev/null +++ b/.github/workflows/release-nuget.yml @@ -0,0 +1,31 @@ +name: Release NuGet Package +on: + release: + types: [published] # Triggers when you create a GitHub Release +jobs: + deploy: + runs-on: ubuntu-latest + permissions: + id-token: write # Required for OIDC + contents: read + steps: + - uses: actions/checkout@v7 + - name: Setup .NET + uses: actions/setup-dotnet@v5 + with: + dotnet-version: 10.0.x + - name: Restore dependencies + run: dotnet restore + - name: Build + run: dotnet build -c Release -p:Version=${GITHUB_REF_NAME#v} --no-restore + - name: Run Tests + run: dotnet test -c Release --report-trx --results-directory=".artifacts/test-results" --no-build --no-restore + - name: Pack Nuget + run: dotnet pack -c Release -p:Version=${GITHUB_REF_NAME#v} -o .artifacts/packages --no-build --no-restore + - name: Authenticate with NuGet via OIDC + uses: NuGet/login@v1 + id: nuget-login + with: + user: ig-sinicyn + - name: Push Nuget + run: dotnet nuget push ".artifacts/packages/**/*.nupkg" -s https://api.nuget.org/v3/index.json -k ${{ steps.nuget-login.outputs.NUGET_API_KEY }} --skip-duplicate \ No newline at end of file diff --git a/CodeMe.ScaffoldCS.sln.DotSettings b/CodeMe.ScaffoldCS.sln.DotSettings new file mode 100644 index 0000000..ed3bda4 --- /dev/null +++ b/CodeMe.ScaffoldCS.sln.DotSettings @@ -0,0 +1,13 @@ + + HINT + HINT + SUGGESTION + True + <?xml version="1.0" encoding="utf-16"?><Profile name="Cleanup on Save"><CSCodeStyleAttributes ArrangeVarStyle="True" ArrangeTypeAccessModifier="True" ArrangeTypeMemberAccessModifier="True" SortModifiers="True" ArrangeAccessors="True" RemoveRedundantParentheses="True" AddMissingParentheses="True" ArrangeAttributes="True" ArrangeCodeBodyStyle="True" ArrangeTrailingCommas="True" ArrangeObjectCreation="True" ArrangeDefaultValue="True" ArrangeEmptyString="True" ArrangeNamespaces="True" ArrangeNullCheckingPattern="True" ArrangeBraces="True" /><CSArrangeQualifiers>True</CSArrangeQualifiers><CSFixBuiltinTypeReferences>True</CSFixBuiltinTypeReferences><XMLReformatCode>True</XMLReformatCode><CSMakeFieldReadonly>True</CSMakeFieldReadonly><CSMakeAutoPropertyGetOnly>True</CSMakeAutoPropertyGetOnly><CSOptimizeUsings><OptimizeUsings>True</OptimizeUsings></CSOptimizeUsings><CSShortenReferences>True</CSShortenReferences><CSReformatCode>True</CSReformatCode><CSharpFormatDocComments>True</CSharpFormatDocComments><CSharpReformatComments>True</CSharpReformatComments><XAMLCollapseEmptyTags>False</XAMLCollapseEmptyTags><RemoveCodeRedundancies>True</RemoveCodeRedundancies></Profile> + Required + ZeroIndent + False + <Policy><Descriptor Staticness="Static" AccessRightKinds="Private" Description="Static readonly fields (private)"><ElementKinds><Kind Name="READONLY_FIELD" /></ElementKinds></Descriptor><Policy Inspect="True" WarnAboutPrefixesAndSuffixes="False" Prefix="_" Suffix="" Style="aaBb" /></Policy> + True + + \ No newline at end of file diff --git a/CodeMe.ScaffoldCS.slnx b/CodeMe.ScaffoldCS.slnx new file mode 100644 index 0000000..76332cd --- /dev/null +++ b/CodeMe.ScaffoldCS.slnx @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/Directory.Build.props b/Directory.Build.props new file mode 100644 index 0000000..fe5d5ce --- /dev/null +++ b/Directory.Build.props @@ -0,0 +1,70 @@ + + + + true + $(MSBuildThisFileDirectory).artifacts/ + + + + enable + enable + false + + + + true + true + true + + + + false + true + true + + + + false + true + true + $([System.String]::Copy('$(MSBuildProjectName)').Replace('.UnitTests','').Replace('.IntegrationTests','').Replace('.Tests','')) + + + + true + MIT + Igor Sinicyn + CodeMe + CodeMe.ScaffoldCS + https://github.com/ig-sinicyn/CodeMe.ScaffoldCS + true + true + snupkg + true + README.md + + + + + + + + + + + Exe + true + true + true + + + + + + + + + + + + \ No newline at end of file diff --git a/Directory.Packages.props b/Directory.Packages.props new file mode 100644 index 0000000..6d54c12 --- /dev/null +++ b/Directory.Packages.props @@ -0,0 +1,10 @@ + + + true + + + + + + + \ No newline at end of file diff --git a/README.md b/README.md index e0f4472..1c2b6d1 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,2 @@ # CodeMe.ScaffoldCS -Scaffolding platform inspired by CodegenCS +Scaffolding framework inspired by CodegenCS diff --git a/cicd/cicd.csproj b/cicd/cicd.csproj new file mode 100644 index 0000000..3cd1421 --- /dev/null +++ b/cicd/cicd.csproj @@ -0,0 +1,13 @@ + + + + netstandard2.0 + + + + + .github/%(RecursiveDir)%(Filename)%(Extension) + + + + diff --git a/cicd/debug.build.ps1 b/cicd/debug.build.ps1 new file mode 100644 index 0000000..c5994cd --- /dev/null +++ b/cicd/debug.build.ps1 @@ -0,0 +1,4 @@ +$ErrorActionPreference = 'Stop' +$PSNativeCommandUseErrorActionPreference = $true + +dotnet build --tl:off \ No newline at end of file diff --git a/cicd/local.publish.ps1 b/cicd/local.publish.ps1 new file mode 100644 index 0000000..d31ef2e --- /dev/null +++ b/cicd/local.publish.ps1 @@ -0,0 +1,6 @@ +$ErrorActionPreference = 'Stop' +$PSNativeCommandUseErrorActionPreference = $true + +dotnet restore +dotnet build -c Release --no-restore +dotnet pack -c Release -o .artifacts\packages --no-restore --no-build /p:Version="0.0.1-local" \ No newline at end of file diff --git a/docs/docs.csproj b/docs/docs.csproj new file mode 100644 index 0000000..4b859fc --- /dev/null +++ b/docs/docs.csproj @@ -0,0 +1,11 @@ + + + + netstandard2.0 + + + + + + + diff --git a/env/env.csproj b/env/env.csproj new file mode 100644 index 0000000..970527f --- /dev/null +++ b/env/env.csproj @@ -0,0 +1,14 @@ + + + + netstandard2.0 + + + + + %(Filename)%(Extension) + + + + + diff --git a/global.json b/global.json new file mode 100644 index 0000000..8f73781 --- /dev/null +++ b/global.json @@ -0,0 +1,5 @@ +{ + "test": { + "runner": "Microsoft.Testing.Platform" + } +} \ No newline at end of file diff --git a/src/CodeMe.ScaffoldCS/CodeMe.ScaffoldCS.csproj b/src/CodeMe.ScaffoldCS/CodeMe.ScaffoldCS.csproj new file mode 100644 index 0000000..7c9158a --- /dev/null +++ b/src/CodeMe.ScaffoldCS/CodeMe.ScaffoldCS.csproj @@ -0,0 +1,9 @@ + + + + net10.0 + Scaffolding framework inspired by CodegenCS + Scaffolld;Template;Codegen;Code Generation + + + \ No newline at end of file diff --git a/src/CodeMe.ScaffoldCS/README.md b/src/CodeMe.ScaffoldCS/README.md new file mode 100644 index 0000000..5075096 --- /dev/null +++ b/src/CodeMe.ScaffoldCS/README.md @@ -0,0 +1,2 @@ +# CodeMe.ScaffoldCS +Scaffolding framework inspired by CodegenCS \ No newline at end of file diff --git a/src/CodeMe.ScaffoldCS/packages.lock.json b/src/CodeMe.ScaffoldCS/packages.lock.json new file mode 100644 index 0000000..6afd678 --- /dev/null +++ b/src/CodeMe.ScaffoldCS/packages.lock.json @@ -0,0 +1,6 @@ +{ + "version": 2, + "dependencies": { + "net10.0": {} + } +} \ No newline at end of file diff --git a/tests/CodeMe.ScaffoldCS.UnitTests/CodeMe.ScaffoldCS.UnitTests.csproj b/tests/CodeMe.ScaffoldCS.UnitTests/CodeMe.ScaffoldCS.UnitTests.csproj new file mode 100644 index 0000000..4077e5c --- /dev/null +++ b/tests/CodeMe.ScaffoldCS.UnitTests/CodeMe.ScaffoldCS.UnitTests.csproj @@ -0,0 +1,7 @@ + + + + net10.0 + + + \ No newline at end of file diff --git a/tests/CodeMe.ScaffoldCS.UnitTests/packages.lock.json b/tests/CodeMe.ScaffoldCS.UnitTests/packages.lock.json new file mode 100644 index 0000000..11823c8 --- /dev/null +++ b/tests/CodeMe.ScaffoldCS.UnitTests/packages.lock.json @@ -0,0 +1,139 @@ +{ + "version": 2, + "dependencies": { + "net10.0": { + "AwesomeAssertions": { + "type": "Direct", + "requested": "[9.5.0, )", + "resolved": "9.5.0", + "contentHash": "F92MsjoF8B7IdcWETru4QGZx6VAl38qQPKNGS3kwPwlLB5lb0O4bhFqG8a8sz2estQJWkKmZkVy1r19HTaFcpg==" + }, + "Microsoft.Testing.Extensions.TrxReport": { + "type": "Direct", + "requested": "[2.3.3, )", + "resolved": "2.3.3", + "contentHash": "vYBqGSlT94B8d6d4PRdPQ83ogn3kK4kXcnI3SlHBHZu1XsU01IDTMnWoto5v5wXN/Mz4XsVM3Do/sJdGRgH29g==", + "dependencies": { + "Microsoft.Testing.Extensions.TrxReport.Abstractions": "2.3.3", + "Microsoft.Testing.Platform": "2.3.3" + } + }, + "xunit.v3.mtp-v2": { + "type": "Direct", + "requested": "[3.2.2, )", + "resolved": "3.2.2", + "contentHash": "S0LJpeMIMrmbVLXDCvPVX47OLk28qBYfGU+5SNCbarOEdw8oKLfiVqaACwuYRvLiOqDEB/+VJ8gTSB1ZwheoOQ==", + "dependencies": { + "xunit.analyzers": "1.27.0", + "xunit.v3.assert": "[3.2.2]", + "xunit.v3.core.mtp-v2": "[3.2.2]" + } + }, + "Microsoft.ApplicationInsights": { + "type": "Transitive", + "resolved": "2.23.0", + "contentHash": "nWArUZTdU7iqZLycLKWe0TDms48KKGE6pONH2terYNa8REXiqixrMOkf1sk5DHGMaUTqONU2YkS4SAXBhLStgw==" + }, + "Microsoft.Bcl.AsyncInterfaces": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "UcSjPsst+DfAdJGVDsu346FX0ci0ah+lw3WRtn18NUwEqRt70HaOQ7lI72vy3+1LxtqI3T5GWwV39rQSrCzAeg==" + }, + "Microsoft.Testing.Extensions.Telemetry": { + "type": "Transitive", + "resolved": "2.0.2", + "contentHash": "H580BvHyuADoWzlH9zRk5fqVyGucm6mhph+k40CQc9O4ie+Buxa4Pk9Q92BEClqIICqi25J7fuMII9qFYYgKtw==", + "dependencies": { + "Microsoft.ApplicationInsights": "2.23.0", + "Microsoft.Testing.Platform": "2.0.2" + } + }, + "Microsoft.Testing.Extensions.TrxReport.Abstractions": { + "type": "Transitive", + "resolved": "2.3.3", + "contentHash": "dceVNxnfTEjKnrIreLcMfkgrzzBY8kgCCJX5NAv7Lq/6vPlTP4VB5zxKeuYy0yfCoBtWuPkLjUG6qtOBMfpypA==", + "dependencies": { + "Microsoft.Testing.Platform": "2.3.3" + } + }, + "Microsoft.Testing.Platform": { + "type": "Transitive", + "resolved": "2.3.3", + "contentHash": "ENbH4BQh9riXtOKc25KKITfiGGWhWMBJA7pZuNaF9zxzzSaVkp5AMeZxGQ6sXYaR6xb724NLz985Is6XIYqLSg==" + }, + "Microsoft.Testing.Platform.MSBuild": { + "type": "Transitive", + "resolved": "2.0.2", + "contentHash": "2zKkQKaUoaKgb/3AekboWOdLMh4upCo1nLWQnjGzp8r9YjiNOZRrzTsJQ3A4U03AcbH0evlIvFDKYSUqmTVuug==", + "dependencies": { + "Microsoft.Testing.Platform": "2.0.2" + } + }, + "Microsoft.Win32.Registry": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==" + }, + "xunit.analyzers": { + "type": "Transitive", + "resolved": "1.27.0", + "contentHash": "y/pxIQaLvk/kxAoDkZW9GnHLCEqzwl5TW0vtX3pweyQpjizB9y3DXhb9pkw2dGeUqhLjsxvvJM1k89JowU6z3g==" + }, + "xunit.v3.assert": { + "type": "Transitive", + "resolved": "3.2.2", + "contentHash": "BPciBghgEEaJN/JG00QfCYDfEfnLgQhfnYEy+j1izoeHVNYd5+3Wm8GJ6JgYysOhpBPYGE+sbf75JtrRc7jrdA==" + }, + "xunit.v3.common": { + "type": "Transitive", + "resolved": "3.2.2", + "contentHash": "Hj775PEH6GTbbg0wfKRvG2hNspDCvTH9irXhH4qIWgdrOSV1sQlqPie+DOvFeigsFg2fxSM3ZAaaCDQs+KreFA==", + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "6.0.0" + } + }, + "xunit.v3.core.mtp-v2": { + "type": "Transitive", + "resolved": "3.2.2", + "contentHash": "zW82tdCm+T1uUD1JKE+SmhgMq8nCAvcFPRLIVEiRgaxBSjcyJEKopLU3bHGOa416q+N3Dz7m1zLoPR5VJ5OQ+Q==", + "dependencies": { + "Microsoft.Testing.Extensions.Telemetry": "2.0.2", + "Microsoft.Testing.Extensions.TrxReport.Abstractions": "2.0.2", + "Microsoft.Testing.Platform": "2.0.2", + "Microsoft.Testing.Platform.MSBuild": "2.0.2", + "xunit.v3.extensibility.core": "[3.2.2]", + "xunit.v3.runner.inproc.console": "[3.2.2]" + } + }, + "xunit.v3.extensibility.core": { + "type": "Transitive", + "resolved": "3.2.2", + "contentHash": "srY8z/oMPvh/t8axtO2DwrHajhFMH7tnqKildvYrVQIfICi8fOn3yIBWkVPAcrKmHMwvXRJ/XsQM3VMR6DOYfQ==", + "dependencies": { + "xunit.v3.common": "[3.2.2]" + } + }, + "xunit.v3.runner.common": { + "type": "Transitive", + "resolved": "3.2.2", + "contentHash": "/hkHkQCzGrugelOAehprm7RIWdsUFVmIVaD6jDH/8DNGCymTlKKPTbGokD5czbAfqfex47mBP0sb0zbHYwrO/g==", + "dependencies": { + "Microsoft.Win32.Registry": "[5.0.0]", + "xunit.v3.common": "[3.2.2]" + } + }, + "xunit.v3.runner.inproc.console": { + "type": "Transitive", + "resolved": "3.2.2", + "contentHash": "ulWOdSvCk+bPXijJZ73bth9NyoOHsAs1ZOvamYbCkD4DNLX/Bd29Ve2ZNUwBbK0MqfIYWXHZViy/HKrdEC/izw==", + "dependencies": { + "xunit.v3.extensibility.core": "[3.2.2]", + "xunit.v3.runner.common": "[3.2.2]" + } + }, + "codeme.scaffoldcs": { + "type": "Project" + } + } + } +} \ No newline at end of file