From 1e0064c1adf55a4de5f28253aa418779a69d1867 Mon Sep 17 00:00:00 2001 From: Joshua Hegedus Date: Wed, 12 Apr 2023 20:36:46 +0200 Subject: [PATCH] 7.0.1 Update modules-cicd.yml Update modules-cicd.yml Update modules-cicd.yml Update modules-cicd.yml added astray project and organized stuff (#3) Co-authored-by: Joshua Hegedus Create main.yml added to readme (#4) Co-authored-by: Joshua Hegedus Update modules-cicd.yml Asd (#5) * changed nuget * asd --------- Co-authored-by: Joshua Hegedus Fixes yml Update modules-cicd.yml Update modules-cicd.yml Update modules-cicd.yml Update modules-cicd.yml added push yml (#6) Co-authored-by: Joshua Hegedus Release/6.0.1 (#7) * fixed pusblisj * asd * asdsd small fix added assembly version asd version fix asd * fixed yml --------- Co-authored-by: Joshua Hegedus 6.1.1 (#8) * 6.1.0 * 6.1.1 --------- Co-authored-by: Joshua Hegedus 6.1.2 (#9) * asd * 6.1.2 --------- Co-authored-by: Joshua Hegedus 6.1.3 (#10) Co-authored-by: Joshua Hegedus some fixes (#11) Co-authored-by: Joshua Hegedus 7.0.0 (#12) Co-authored-by: Joshua Hegedus 7.0.0 --- .github/workflows/modules-cicd.yml | 111 ++++-------------- .github/workflows/publish-packages.yml | 57 +++++++++ ColorGenerator/ColorGenerator.sln | 25 ---- .../StandardIOManager/StandardIOManager.cs | 16 --- .../StandardIOManagerFactory.cs | 14 --- Modules/Infrastructure/IO/IIOManager.cs | 10 -- .../Infrastructure/IO/IIOManagerFactory.cs | 9 -- README.md | 2 + .../ColorGenerator/ColorGenerator.csproj | 0 .../ColorGenerator/Program.cs | 0 .../Implementation/Constants.cs | 0 .../Implementation/Core/Bootsrapper.cs | 3 +- .../Implementation/IO}/Reader.cs | 3 +- .../Implementation/IO}/Writer.cs | 3 +- .../Implementation/Implementation.csproj | 7 +- .../Implementation/Logger/Logger.cs | 0 .../Implementation/Logger/SqlLogger.cs | 0 .../Implementation/Navigator/Navigator.cs | 3 +- .../Navigator/NavigatorElement.cs | 0 .../IO/Factories/IReaderFactory.cs | 7 ++ .../Infrastructure/IO/IReader.cs | 0 .../Infrastructure/IO/IWriter.cs | 4 +- .../Infrastructure/Infrastructure.csproj | 3 - .../Infrastructure/Logger/ILogger.cs | 0 .../Infrastructure/MessageSeverity.cs | 0 .../Infrastructure/Navigator/INavigator.cs | 0 .../Navigator/INavigatorElement.cs | 0 {Modules => Solution}/Modules.sln | 24 ++-- .../ImplementationTest.csproj | 2 +- .../Tests}/ImplementationTest/ReaderTests.cs | 2 +- .../Resources/RT/0001_0.txt | 0 .../Resources/RT/0001_1.txt | 0 .../Resources/RT/0001_2.txt | 0 .../Resources/RT/0001_3.txt | 0 .../Resources/RT/0002_0.txt | 0 .../Resources/RT/0002_1.txt | 0 .../Resources/RT/readlineTest.txt | 0 .../StandardIOManagerTests.cs | 0 .../Tests}/ManualTests/ManualTests.csproj | 2 +- .../Tests}/ManualTests/Program.cs | 1 - .../Tests}/ManualTests/TestPersonClass.cs | 0 Solution/Tools/GetBuildVersion.psm1 | 34 ++++++ {Modules => Solution}/Tools/pack.ps1 | 0 {Modules => Solution}/global.json | 0 {Modules => Solution}/nuget.config | 1 + 45 files changed, 146 insertions(+), 197 deletions(-) create mode 100644 .github/workflows/publish-packages.yml delete mode 100644 ColorGenerator/ColorGenerator.sln delete mode 100644 Modules/Implementation/StandardIOManager/StandardIOManager.cs delete mode 100644 Modules/Implementation/StandardIOManager/StandardIOManagerFactory.cs delete mode 100644 Modules/Infrastructure/IO/IIOManager.cs delete mode 100644 Modules/Infrastructure/IO/IIOManagerFactory.cs rename {ColorGenerator => Solution}/ColorGenerator/ColorGenerator.csproj (100%) rename {ColorGenerator => Solution}/ColorGenerator/Program.cs (100%) rename {Modules => Solution}/Implementation/Constants.cs (100%) rename {Modules => Solution}/Implementation/Core/Bootsrapper.cs (94%) rename {Modules/Implementation/StandardIOManager => Solution/Implementation/IO}/Reader.cs (98%) rename {Modules/Implementation/StandardIOManager => Solution/Implementation/IO}/Writer.cs (98%) rename {Modules => Solution}/Implementation/Implementation.csproj (91%) rename {Modules => Solution}/Implementation/Logger/Logger.cs (100%) rename {Modules => Solution}/Implementation/Logger/SqlLogger.cs (100%) rename {Modules => Solution}/Implementation/Navigator/Navigator.cs (95%) rename {Modules => Solution}/Implementation/Navigator/NavigatorElement.cs (100%) create mode 100644 Solution/Infrastructure/IO/Factories/IReaderFactory.cs rename {Modules => Solution}/Infrastructure/IO/IReader.cs (100%) rename {Modules => Solution}/Infrastructure/IO/IWriter.cs (96%) rename {Modules => Solution}/Infrastructure/Infrastructure.csproj (86%) rename {Modules => Solution}/Infrastructure/Logger/ILogger.cs (100%) rename {Modules => Solution}/Infrastructure/MessageSeverity.cs (100%) rename {Modules => Solution}/Infrastructure/Navigator/INavigator.cs (100%) rename {Modules => Solution}/Infrastructure/Navigator/INavigatorElement.cs (100%) rename {Modules => Solution}/Modules.sln (68%) rename {Modules => Solution/Tests}/ImplementationTest/ImplementationTest.csproj (96%) rename {Modules => Solution/Tests}/ImplementationTest/ReaderTests.cs (98%) rename {Modules => Solution/Tests}/ImplementationTest/Resources/RT/0001_0.txt (100%) rename {Modules => Solution/Tests}/ImplementationTest/Resources/RT/0001_1.txt (100%) rename {Modules => Solution/Tests}/ImplementationTest/Resources/RT/0001_2.txt (100%) rename {Modules => Solution/Tests}/ImplementationTest/Resources/RT/0001_3.txt (100%) rename {Modules => Solution/Tests}/ImplementationTest/Resources/RT/0002_0.txt (100%) rename {Modules => Solution/Tests}/ImplementationTest/Resources/RT/0002_1.txt (100%) rename {Modules => Solution/Tests}/ImplementationTest/Resources/RT/readlineTest.txt (100%) rename {Modules => Solution/Tests}/ImplementationTest/StandardIOManagerTests.cs (100%) rename {Modules => Solution/Tests}/ManualTests/ManualTests.csproj (72%) rename {Modules => Solution/Tests}/ManualTests/Program.cs (95%) rename {Modules => Solution/Tests}/ManualTests/TestPersonClass.cs (100%) create mode 100644 Solution/Tools/GetBuildVersion.psm1 rename {Modules => Solution}/Tools/pack.ps1 (100%) rename {Modules => Solution}/global.json (100%) rename {Modules => Solution}/nuget.config (83%) diff --git a/.github/workflows/modules-cicd.yml b/.github/workflows/modules-cicd.yml index 9815db7..9bf621a 100644 --- a/.github/workflows/modules-cicd.yml +++ b/.github/workflows/modules-cicd.yml @@ -1,65 +1,21 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. - -# This workflow will build, test, sign and package a WPF or Windows Forms desktop application -# built on .NET Core. -# To learn how to migrate your existing application to .NET Core, -# refer to https://docs.microsoft.com/en-us/dotnet/desktop-wpf/migration/convert-project-from-net-framework -# -# To configure this workflow: -# -# 1. Configure environment variables -# GitHub sets default environment variables for every workflow run. -# Replace the variables relative to your project in the "env" section below. -# -# 2. Signing -# Generate a signing certificate in the Windows Application -# Packaging Project or add an existing signing certificate to the project. -# Next, use PowerShell to encode the .pfx file using Base64 encoding -# by running the following Powershell script to generate the output string: -# -# $pfx_cert = Get-Content '.\SigningCertificate.pfx' -Encoding Byte -# [System.Convert]::ToBase64String($pfx_cert) | Out-File 'SigningCertificate_Encoded.txt' -# -# Open the output file, SigningCertificate_Encoded.txt, and copy the -# string inside. Then, add the string to the repo as a GitHub secret -# and name it "Base64_Encoded_Pfx." -# For more information on how to configure your signing certificate for -# this workflow, refer to https://github.com/microsoft/github-actions-for-desktop-apps#signing -# -# Finally, add the signing certificate password to the repo as a secret and name it "Pfx_Key". -# See "Build the Windows Application Packaging project" below to see how the secret is used. -# -# For more information on GitHub Actions, refer to https://github.com/features/actions -# For a complete CI/CD sample to get started with GitHub Action workflows for Desktop Applications, -# refer to https://github.com/microsoft/github-actions-for-desktop-apps - -name: .NET Core Desktop +name: CI on: push: - branches: [ "master" ] - pull_request: - branches: [ "master" ] - + branches: + - master + # pull_request: + # branches: + # - master + jobs: - build: - strategy: - matrix: - configuration: [Release] - - runs-on: windows-latest # For a list of available runner types, refer to - # https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on - env: - Solution_Name: Modules\Modules.sln # Replace with your solution name, i.e. MyWpfApp.sln. - Test_Project_Path: Modules\ImplementationTest\ImplementationTest.csproj # Replace with the path to your test project, i.e. MyWpfApp.Tests\MyWpfApp.Tests.csproj. - # Wap_Project_Directory: your-wap-project-directory-name # Replace with the Wap project directory relative to the solution, i.e. MyWpfApp.Package. - # Wap_Project_Path: your-wap-project-path # Replace with the path to your Wap project, i.e. MyWpf.App.Package\MyWpfApp.Package.wapproj. + BUILD_CONFIG: 'Release' + SOLUTION: 'Solution/Modules.sln' + + runs-on: windows-latest steps: - name: Checkout @@ -67,49 +23,22 @@ jobs: with: fetch-depth: 0 - # Install the .NET Core workload - name: Install .NET Core uses: actions/setup-dotnet@v3 with: - dotnet-version: 7.0.5 + dotnet-version: 5.0.x - # Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild - name: Setup MSBuild.exe uses: microsoft/setup-msbuild@v1.0.2 - # Execute all unit tests in the solution - - name: Execute unit tests - run: dotnet test - - # Restore the application to populate the obj folder with RuntimeIdentifiers - - name: Restore the application - run: msbuild $env:Solution_Name /t:Restore /p:Configuration=$env:Configuration - env: - Configuration: ${{ matrix.configuration }} + # - name: Setup NuGet + # uses: NuGet/setup-nuget@v1.0.5 - # Decode the base 64 encoded pfx and save the Signing_Certificate - - name: Decode the pfx - run: | - $pfx_cert_byte = [System.Convert]::FromBase64String("${{ secrets.Base64_Encoded_Pfx }}") - $certificatePath = Join-Path -Path $env:Wap_Project_Directory -ChildPath GitHubActionsWorkflow.pfx - [IO.File]::WriteAllBytes("$certificatePath", $pfx_cert_byte) + - name: Restore dependencies + run: nuget restore $env:SOLUTION - # Create the app package by building and packaging the Windows Application Packaging project - # - name: Create the app package - # run: msbuild $env:Wap_Project_Path /p:Configuration=$env:Configuration /p:UapAppxPackageBuildMode=$env:Appx_Package_Build_Mode /p:AppxBundle=$env:Appx_Bundle /p:PackageCertificateKeyFile=GitHubActionsWorkflow.pfx /p:PackageCertificatePassword=${{ secrets.Pfx_Key }} - # env: - # Appx_Bundle: Always - # Appx_Bundle_Platforms: x86|x64 - # Appx_Package_Build_Mode: StoreUpload - # Configuration: ${{ matrix.configuration }} + - name: Build + run: dotnet build $env:SOLUTION --configuration $env:BUILD_CONFIG --no-restore - # Remove the pfx - - name: Remove the pfx - run: Remove-Item -path $env:Wap_Project_Directory\GitHubActionsWorkflow.pfx - - # Upload the MSIX package: https://github.com/marketplace/actions/upload-a-build-artifact - - name: Upload build artifacts - uses: actions/upload-artifact@v3 - with: - name: MSIX Package - path: ${{ env.Wap_Project_Directory }}\AppPackages + - name: Run tests + run: dotnet test $env:SOLUTION /p:Configuration=$env:BUILD_CONFIG --no-restore --no-build --verbosity normal diff --git a/.github/workflows/publish-packages.yml b/.github/workflows/publish-packages.yml new file mode 100644 index 0000000..1b70989 --- /dev/null +++ b/.github/workflows/publish-packages.yml @@ -0,0 +1,57 @@ +name: CD + + +on: + workflow_run: + workflows: ["CI"] + branches: [ master ] + types: + - completed + +jobs: + build: + + env: + BUILD_CONFIG: 'Release' + SOLUTION: './Solution/Modules.sln' + + runs-on: windows-latest + + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Get Build Version + run: | + Get-ChildItem + Import-Module .\Solution\Tools\GetBuildVersion.psm1 + $version_text = $(git log -1 --no-merges --pretty='format:%C(auto)%s') + Write-Host $version_text + $version = GetBuildVersion -VersionString $version_text + echo "BUILD_VERSION=$version" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append + shell: pwsh + + - name: Install .NET Core + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 5.0.x + + - name: Setup MSBuild.exe + uses: microsoft/setup-msbuild@v1.0.2 + + - name: Restore dependencies + run: nuget restore $env:SOLUTION + + - name: Build + run: dotnet build $env:SOLUTION --configuration $env:BUILD_CONFIG /p:AssemblyVersion=$BUILD_VERSION --no-restore + + - name: Run tests + run: dotnet test $env:SOLUTION /p:Configuration=$env:BUILD_CONFIG --no-restore --no-build --verbosity normal + + - name: Publish + if: startsWith(github.ref, 'refs/heads/master') + run: | + dotnet nuget push **\*.nupkg --source 'https://api.nuget.org/v3/index.json' --api-key ${{secrets.NUGET_API_KEY}} + dotnet nuget push **\*.nupkg --source 'https://nuget.pkg.github.com/joshika39/index.json' --api-key ${{secrets.GIT_API_KEY}} \ No newline at end of file diff --git a/ColorGenerator/ColorGenerator.sln b/ColorGenerator/ColorGenerator.sln deleted file mode 100644 index 94b23c2..0000000 --- a/ColorGenerator/ColorGenerator.sln +++ /dev/null @@ -1,25 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.3.32825.248 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ColorGenerator", "ColorGenerator\ColorGenerator.csproj", "{910A97DF-C81F-4411-B8C4-3DFAA284A3C0}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {910A97DF-C81F-4411-B8C4-3DFAA284A3C0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {910A97DF-C81F-4411-B8C4-3DFAA284A3C0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {910A97DF-C81F-4411-B8C4-3DFAA284A3C0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {910A97DF-C81F-4411-B8C4-3DFAA284A3C0}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {BD91BD6B-63F1-4414-9237-60D031C50FD2} - EndGlobalSection -EndGlobal diff --git a/Modules/Implementation/StandardIOManager/StandardIOManager.cs b/Modules/Implementation/StandardIOManager/StandardIOManager.cs deleted file mode 100644 index 189175d..0000000 --- a/Modules/Implementation/StandardIOManager/StandardIOManager.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using Infrastructure; -using Infrastructure.IOManager; -using Infrastructure.Logger; - -namespace Implementation.StandardIOManager -{ - internal class StandardIOManager : IIOManager - { - - } -} diff --git a/Modules/Implementation/StandardIOManager/StandardIOManagerFactory.cs b/Modules/Implementation/StandardIOManager/StandardIOManagerFactory.cs deleted file mode 100644 index 8efc26c..0000000 --- a/Modules/Implementation/StandardIOManager/StandardIOManagerFactory.cs +++ /dev/null @@ -1,14 +0,0 @@ -using Infrastructure.IOManager; -using Infrastructure.Logger; - -namespace Implementation.StandardIOManager -{ - internal class StandardIOManagerFactory : IIOManagerFactory - { - public IIOManager CreateIOManager(ILogger logger) - { - return new StandardIOManager(); - } - } -} - diff --git a/Modules/Infrastructure/IO/IIOManager.cs b/Modules/Infrastructure/IO/IIOManager.cs deleted file mode 100644 index c8cf494..0000000 --- a/Modules/Infrastructure/IO/IIOManager.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; - -namespace Infrastructure.IOManager -{ - public interface IIOManager - { - } -} diff --git a/Modules/Infrastructure/IO/IIOManagerFactory.cs b/Modules/Infrastructure/IO/IIOManagerFactory.cs deleted file mode 100644 index 02ed33c..0000000 --- a/Modules/Infrastructure/IO/IIOManagerFactory.cs +++ /dev/null @@ -1,9 +0,0 @@ -using Infrastructure.Logger; - -namespace Infrastructure.IOManager -{ - public interface IIOManagerFactory - { - IIOManager CreateIOManager(ILogger logger); - } -} diff --git a/README.md b/README.md index d0f78ab..6d7e711 100644 --- a/README.md +++ b/README.md @@ -1 +1,3 @@ # CsTools + +[![CI](https://github.com/joshika39/cs-tools/actions/workflows/main.yml/badge.svg)](https://github.com/joshika39/cs-tools/actions/workflows/main.yml) \ No newline at end of file diff --git a/ColorGenerator/ColorGenerator/ColorGenerator.csproj b/Solution/ColorGenerator/ColorGenerator.csproj similarity index 100% rename from ColorGenerator/ColorGenerator/ColorGenerator.csproj rename to Solution/ColorGenerator/ColorGenerator.csproj diff --git a/ColorGenerator/ColorGenerator/Program.cs b/Solution/ColorGenerator/Program.cs similarity index 100% rename from ColorGenerator/ColorGenerator/Program.cs rename to Solution/ColorGenerator/Program.cs diff --git a/Modules/Implementation/Constants.cs b/Solution/Implementation/Constants.cs similarity index 100% rename from Modules/Implementation/Constants.cs rename to Solution/Implementation/Constants.cs diff --git a/Modules/Implementation/Core/Bootsrapper.cs b/Solution/Implementation/Core/Bootsrapper.cs similarity index 94% rename from Modules/Implementation/Core/Bootsrapper.cs rename to Solution/Implementation/Core/Bootsrapper.cs index b047751..8f9bb44 100644 --- a/Modules/Implementation/Core/Bootsrapper.cs +++ b/Solution/Implementation/Core/Bootsrapper.cs @@ -1,8 +1,7 @@ using System; using System.Reflection; -using Implementation.StandardIOManager; +using Implementation.IO; using Infrastructure.IO; -using Infrastructure.IOManager; using Infrastructure.Logger; using Infrastructure.Navigator; using Unity; diff --git a/Modules/Implementation/StandardIOManager/Reader.cs b/Solution/Implementation/IO/Reader.cs similarity index 98% rename from Modules/Implementation/StandardIOManager/Reader.cs rename to Solution/Implementation/IO/Reader.cs index 44cf19f..00b507b 100644 --- a/Modules/Implementation/StandardIOManager/Reader.cs +++ b/Solution/Implementation/IO/Reader.cs @@ -3,12 +3,11 @@ using System.IO; using System.Linq; using System.Text; -using System.Xml.Linq; using Infrastructure; using Infrastructure.IO; using Infrastructure.Logger; -namespace Implementation.StandardIOManager +namespace Implementation.IO { internal class Reader : IReader { diff --git a/Modules/Implementation/StandardIOManager/Writer.cs b/Solution/Implementation/IO/Writer.cs similarity index 98% rename from Modules/Implementation/StandardIOManager/Writer.cs rename to Solution/Implementation/IO/Writer.cs index d8badbe..453379d 100644 --- a/Modules/Implementation/StandardIOManager/Writer.cs +++ b/Solution/Implementation/IO/Writer.cs @@ -1,8 +1,9 @@ using System; using Infrastructure; +using Infrastructure.IO; using Infrastructure.Logger; -namespace Implementation.StandardIOManager +namespace Implementation.IO { public class Writer : IWriter { diff --git a/Modules/Implementation/Implementation.csproj b/Solution/Implementation/Implementation.csproj similarity index 91% rename from Modules/Implementation/Implementation.csproj rename to Solution/Implementation/Implementation.csproj index c3b1d7e..97d5cb2 100644 --- a/Modules/Implementation/Implementation.csproj +++ b/Solution/Implementation/Implementation.csproj @@ -4,12 +4,9 @@ net5.0 joshika39-$(AssemblyName) Implementation - 0.0.6 Joshua Hegedus JHost This is the backend for my base library. - 0.0.6 - 0.0.6 en @@ -37,4 +34,8 @@ + + + + diff --git a/Modules/Implementation/Logger/Logger.cs b/Solution/Implementation/Logger/Logger.cs similarity index 100% rename from Modules/Implementation/Logger/Logger.cs rename to Solution/Implementation/Logger/Logger.cs diff --git a/Modules/Implementation/Logger/SqlLogger.cs b/Solution/Implementation/Logger/SqlLogger.cs similarity index 100% rename from Modules/Implementation/Logger/SqlLogger.cs rename to Solution/Implementation/Logger/SqlLogger.cs diff --git a/Modules/Implementation/Navigator/Navigator.cs b/Solution/Implementation/Navigator/Navigator.cs similarity index 95% rename from Modules/Implementation/Navigator/Navigator.cs rename to Solution/Implementation/Navigator/Navigator.cs index 7909d38..7ea5c8d 100644 --- a/Modules/Implementation/Navigator/Navigator.cs +++ b/Solution/Implementation/Navigator/Navigator.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; -using Implementation.StandardIOManager; -using Infrastructure.IOManager; +using Infrastructure.IO; using Infrastructure.Navigator; namespace Implementation.Navigator diff --git a/Modules/Implementation/Navigator/NavigatorElement.cs b/Solution/Implementation/Navigator/NavigatorElement.cs similarity index 100% rename from Modules/Implementation/Navigator/NavigatorElement.cs rename to Solution/Implementation/Navigator/NavigatorElement.cs diff --git a/Solution/Infrastructure/IO/Factories/IReaderFactory.cs b/Solution/Infrastructure/IO/Factories/IReaderFactory.cs new file mode 100644 index 0000000..78a8618 --- /dev/null +++ b/Solution/Infrastructure/IO/Factories/IReaderFactory.cs @@ -0,0 +1,7 @@ +namespace Infrastructure.IO.Factories +{ + public interface IReaderFactory + { + + } +} \ No newline at end of file diff --git a/Modules/Infrastructure/IO/IReader.cs b/Solution/Infrastructure/IO/IReader.cs similarity index 100% rename from Modules/Infrastructure/IO/IReader.cs rename to Solution/Infrastructure/IO/IReader.cs diff --git a/Modules/Infrastructure/IO/IWriter.cs b/Solution/Infrastructure/IO/IWriter.cs similarity index 96% rename from Modules/Infrastructure/IO/IWriter.cs rename to Solution/Infrastructure/IO/IWriter.cs index 4fea131..db6b411 100644 --- a/Modules/Infrastructure/IO/IWriter.cs +++ b/Solution/Infrastructure/IO/IWriter.cs @@ -1,6 +1,4 @@ -using Infrastructure; - -namespace Implementation.StandardIOManager +namespace Infrastructure.IO { public interface IWriter { diff --git a/Modules/Infrastructure/Infrastructure.csproj b/Solution/Infrastructure/Infrastructure.csproj similarity index 86% rename from Modules/Infrastructure/Infrastructure.csproj rename to Solution/Infrastructure/Infrastructure.csproj index 037a830..d5597e2 100644 --- a/Modules/Infrastructure/Infrastructure.csproj +++ b/Solution/Infrastructure/Infrastructure.csproj @@ -4,12 +4,9 @@ net5.0 joshika39-$(AssemblyName) Infrastructure - 0.0.6 Joshua Hegedus JHost This contains the interfaces for my base library. - 0.0.6 - 0.0.6 en diff --git a/Modules/Infrastructure/Logger/ILogger.cs b/Solution/Infrastructure/Logger/ILogger.cs similarity index 100% rename from Modules/Infrastructure/Logger/ILogger.cs rename to Solution/Infrastructure/Logger/ILogger.cs diff --git a/Modules/Infrastructure/MessageSeverity.cs b/Solution/Infrastructure/MessageSeverity.cs similarity index 100% rename from Modules/Infrastructure/MessageSeverity.cs rename to Solution/Infrastructure/MessageSeverity.cs diff --git a/Modules/Infrastructure/Navigator/INavigator.cs b/Solution/Infrastructure/Navigator/INavigator.cs similarity index 100% rename from Modules/Infrastructure/Navigator/INavigator.cs rename to Solution/Infrastructure/Navigator/INavigator.cs diff --git a/Modules/Infrastructure/Navigator/INavigatorElement.cs b/Solution/Infrastructure/Navigator/INavigatorElement.cs similarity index 100% rename from Modules/Infrastructure/Navigator/INavigatorElement.cs rename to Solution/Infrastructure/Navigator/INavigatorElement.cs diff --git a/Modules/Modules.sln b/Solution/Modules.sln similarity index 68% rename from Modules/Modules.sln rename to Solution/Modules.sln index b17b1ee..602d60e 100644 --- a/Modules/Modules.sln +++ b/Solution/Modules.sln @@ -6,9 +6,9 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Infrastructure", "Infrastru EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{DEB88BE8-A621-4605-A6A5-0F9109BC7EAF}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ImplementationTest", "ImplementationTest\ImplementationTest.csproj", "{DEFB6E53-D74D-42C7-9AE7-E830E5D324D2}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ImplementationTest", "Tests\ImplementationTest\ImplementationTest.csproj", "{A4F3EE57-ABB8-4EC3-938F-2EBFFA08D383}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ManualTests", "ManualTests\ManualTests.csproj", "{3CD99AF8-E792-42AE-8AEC-9AC31F663105}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ManualTests", "Tests\ManualTests\ManualTests.csproj", "{44069A97-2742-46AB-B719-9C4773B31295}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -24,17 +24,17 @@ Global {EB4F6E5E-3AE0-4ED4-B018-DF06BC7BB4A3}.Debug|Any CPU.Build.0 = Debug|Any CPU {EB4F6E5E-3AE0-4ED4-B018-DF06BC7BB4A3}.Release|Any CPU.ActiveCfg = Release|Any CPU {EB4F6E5E-3AE0-4ED4-B018-DF06BC7BB4A3}.Release|Any CPU.Build.0 = Release|Any CPU - {DEFB6E53-D74D-42C7-9AE7-E830E5D324D2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DEFB6E53-D74D-42C7-9AE7-E830E5D324D2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DEFB6E53-D74D-42C7-9AE7-E830E5D324D2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DEFB6E53-D74D-42C7-9AE7-E830E5D324D2}.Release|Any CPU.Build.0 = Release|Any CPU - {3CD99AF8-E792-42AE-8AEC-9AC31F663105}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3CD99AF8-E792-42AE-8AEC-9AC31F663105}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3CD99AF8-E792-42AE-8AEC-9AC31F663105}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3CD99AF8-E792-42AE-8AEC-9AC31F663105}.Release|Any CPU.Build.0 = Release|Any CPU + {A4F3EE57-ABB8-4EC3-938F-2EBFFA08D383}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A4F3EE57-ABB8-4EC3-938F-2EBFFA08D383}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A4F3EE57-ABB8-4EC3-938F-2EBFFA08D383}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A4F3EE57-ABB8-4EC3-938F-2EBFFA08D383}.Release|Any CPU.Build.0 = Release|Any CPU + {44069A97-2742-46AB-B719-9C4773B31295}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {44069A97-2742-46AB-B719-9C4773B31295}.Debug|Any CPU.Build.0 = Debug|Any CPU + {44069A97-2742-46AB-B719-9C4773B31295}.Release|Any CPU.ActiveCfg = Release|Any CPU + {44069A97-2742-46AB-B719-9C4773B31295}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(NestedProjects) = preSolution - {DEFB6E53-D74D-42C7-9AE7-E830E5D324D2} = {DEB88BE8-A621-4605-A6A5-0F9109BC7EAF} - {3CD99AF8-E792-42AE-8AEC-9AC31F663105} = {DEB88BE8-A621-4605-A6A5-0F9109BC7EAF} + {A4F3EE57-ABB8-4EC3-938F-2EBFFA08D383} = {DEB88BE8-A621-4605-A6A5-0F9109BC7EAF} + {44069A97-2742-46AB-B719-9C4773B31295} = {DEB88BE8-A621-4605-A6A5-0F9109BC7EAF} EndGlobalSection EndGlobal diff --git a/Modules/ImplementationTest/ImplementationTest.csproj b/Solution/Tests/ImplementationTest/ImplementationTest.csproj similarity index 96% rename from Modules/ImplementationTest/ImplementationTest.csproj rename to Solution/Tests/ImplementationTest/ImplementationTest.csproj index 37ac2ac..feacb96 100644 --- a/Modules/ImplementationTest/ImplementationTest.csproj +++ b/Solution/Tests/ImplementationTest/ImplementationTest.csproj @@ -20,7 +20,7 @@ - + diff --git a/Modules/ImplementationTest/ReaderTests.cs b/Solution/Tests/ImplementationTest/ReaderTests.cs similarity index 98% rename from Modules/ImplementationTest/ReaderTests.cs rename to Solution/Tests/ImplementationTest/ReaderTests.cs index c9b5c4f..4d757cb 100644 --- a/Modules/ImplementationTest/ReaderTests.cs +++ b/Solution/Tests/ImplementationTest/ReaderTests.cs @@ -2,8 +2,8 @@ using System.Collections.Generic; using System.IO; using System.Linq; +using Implementation.IO; using Implementation.Logger; -using Implementation.StandardIOManager; using Xunit; namespace ImplementationTest diff --git a/Modules/ImplementationTest/Resources/RT/0001_0.txt b/Solution/Tests/ImplementationTest/Resources/RT/0001_0.txt similarity index 100% rename from Modules/ImplementationTest/Resources/RT/0001_0.txt rename to Solution/Tests/ImplementationTest/Resources/RT/0001_0.txt diff --git a/Modules/ImplementationTest/Resources/RT/0001_1.txt b/Solution/Tests/ImplementationTest/Resources/RT/0001_1.txt similarity index 100% rename from Modules/ImplementationTest/Resources/RT/0001_1.txt rename to Solution/Tests/ImplementationTest/Resources/RT/0001_1.txt diff --git a/Modules/ImplementationTest/Resources/RT/0001_2.txt b/Solution/Tests/ImplementationTest/Resources/RT/0001_2.txt similarity index 100% rename from Modules/ImplementationTest/Resources/RT/0001_2.txt rename to Solution/Tests/ImplementationTest/Resources/RT/0001_2.txt diff --git a/Modules/ImplementationTest/Resources/RT/0001_3.txt b/Solution/Tests/ImplementationTest/Resources/RT/0001_3.txt similarity index 100% rename from Modules/ImplementationTest/Resources/RT/0001_3.txt rename to Solution/Tests/ImplementationTest/Resources/RT/0001_3.txt diff --git a/Modules/ImplementationTest/Resources/RT/0002_0.txt b/Solution/Tests/ImplementationTest/Resources/RT/0002_0.txt similarity index 100% rename from Modules/ImplementationTest/Resources/RT/0002_0.txt rename to Solution/Tests/ImplementationTest/Resources/RT/0002_0.txt diff --git a/Modules/ImplementationTest/Resources/RT/0002_1.txt b/Solution/Tests/ImplementationTest/Resources/RT/0002_1.txt similarity index 100% rename from Modules/ImplementationTest/Resources/RT/0002_1.txt rename to Solution/Tests/ImplementationTest/Resources/RT/0002_1.txt diff --git a/Modules/ImplementationTest/Resources/RT/readlineTest.txt b/Solution/Tests/ImplementationTest/Resources/RT/readlineTest.txt similarity index 100% rename from Modules/ImplementationTest/Resources/RT/readlineTest.txt rename to Solution/Tests/ImplementationTest/Resources/RT/readlineTest.txt diff --git a/Modules/ImplementationTest/StandardIOManagerTests.cs b/Solution/Tests/ImplementationTest/StandardIOManagerTests.cs similarity index 100% rename from Modules/ImplementationTest/StandardIOManagerTests.cs rename to Solution/Tests/ImplementationTest/StandardIOManagerTests.cs diff --git a/Modules/ManualTests/ManualTests.csproj b/Solution/Tests/ManualTests/ManualTests.csproj similarity index 72% rename from Modules/ManualTests/ManualTests.csproj rename to Solution/Tests/ManualTests/ManualTests.csproj index 373be2f..abd4de9 100644 --- a/Modules/ManualTests/ManualTests.csproj +++ b/Solution/Tests/ManualTests/ManualTests.csproj @@ -6,7 +6,7 @@ - + diff --git a/Modules/ManualTests/Program.cs b/Solution/Tests/ManualTests/Program.cs similarity index 95% rename from Modules/ManualTests/Program.cs rename to Solution/Tests/ManualTests/Program.cs index 9b99348..f80ee35 100644 --- a/Modules/ManualTests/Program.cs +++ b/Solution/Tests/ManualTests/Program.cs @@ -1,7 +1,6 @@ using System; using System.IO; using Implementation.Core; -using Implementation.StandardIOManager; using Infrastructure.IO; using Infrastructure.Logger; using Unity; diff --git a/Modules/ManualTests/TestPersonClass.cs b/Solution/Tests/ManualTests/TestPersonClass.cs similarity index 100% rename from Modules/ManualTests/TestPersonClass.cs rename to Solution/Tests/ManualTests/TestPersonClass.cs diff --git a/Solution/Tools/GetBuildVersion.psm1 b/Solution/Tools/GetBuildVersion.psm1 new file mode 100644 index 0000000..11ea5d0 --- /dev/null +++ b/Solution/Tools/GetBuildVersion.psm1 @@ -0,0 +1,34 @@ +Function GetBuildVersion { + Param ( + [string]$VersionString + ) + + # Process through regex + $VersionString -match "(?\d+)(\.(?\d+))?(\.(?\d+))?(\-(?
[0-9A-Za-z\-\.]+))?(\+(?\d+))?" | Out-Null
+
+    if ($matches -eq $null) {
+        return "1.0.0-build"
+    }
+
+    # Extract the build metadata
+    $BuildRevision = [uint64]$matches['build']
+    # Extract the pre-release tag
+    $PreReleaseTag = [string]$matches['pre']
+    # Extract the patch
+    $Patch = [uint64]$matches['patch']
+    # Extract the minor
+    $Minor = [uint64]$matches['minor']
+    # Extract the major
+    $Major = [uint64]$matches['major']
+
+    $Version = [string]$Major + '.' + [string]$Minor + '.' + [string]$Patch;
+    if ($PreReleaseTag -ne [string]::Empty) {
+        $Version = $Version + '-' + $PreReleaseTag
+    }
+
+    if ($BuildRevision -ne 0) {
+        $Version = $Version + '.' + [string]$BuildRevision
+    }
+
+    return $Version
+}
\ No newline at end of file
diff --git a/Modules/Tools/pack.ps1 b/Solution/Tools/pack.ps1
similarity index 100%
rename from Modules/Tools/pack.ps1
rename to Solution/Tools/pack.ps1
diff --git a/Modules/global.json b/Solution/global.json
similarity index 100%
rename from Modules/global.json
rename to Solution/global.json
diff --git a/Modules/nuget.config b/Solution/nuget.config
similarity index 83%
rename from Modules/nuget.config
rename to Solution/nuget.config
index 74730cb..8c26fdd 100644
--- a/Modules/nuget.config
+++ b/Solution/nuget.config
@@ -2,6 +2,7 @@
 
     
         
+