From bd3a0f132dc26e53b04687129878c9e7d584d7f0 Mon Sep 17 00:00:00 2001 From: Guilherme Branco Stracini Date: Fri, 20 Sep 2024 00:59:38 +0100 Subject: [PATCH] Rename project (#6) * Rename project * Fix files * Update POCTensorFlow.sln --------- Co-authored-by: Guilherme Branco Stracini --- .github/workflows/build.yml | 4 +- .github/workflows/deep-source.yml | 6 +-- POCTemplate.sln => POCTensorFlow.sln | 4 +- README.md | 40 ++++++++++--------- README.template.md | 35 ---------------- .../POCTensorFlow.csproj} | 0 Src/{POCTemplate => POCTensorFlow}/Program.cs | 2 +- .../POCTensorFlow.Tests.csproj} | 2 +- .../UnitTest1.cs | 2 +- install.bat | 1 - install.ps1 | 36 ----------------- install.sh | 34 ---------------- 12 files changed, 32 insertions(+), 134 deletions(-) rename POCTemplate.sln => POCTensorFlow.sln (83%) delete mode 100644 README.template.md rename Src/{POCTemplate/POCTemplate.csproj => POCTensorFlow/POCTensorFlow.csproj} (100%) rename Src/{POCTemplate => POCTensorFlow}/Program.cs (87%) rename Tests/{POCTemplate.Tests/POCTemplate.Tests.csproj => POCTensorFlow.Tests/POCTensorFlow.Tests.csproj} (92%) rename Tests/{POCTemplate.Tests => POCTensorFlow.Tests}/UnitTest1.cs (87%) delete mode 100644 install.bat delete mode 100644 install.ps1 delete mode 100644 install.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b10cb82..0ea96eb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,7 +30,7 @@ jobs: dotnet-version: '8.0.x' - name: Build solution - run: dotnet build -c Debug + run: dotnet build -c Release - name: Run tests - run: dotnet test -c Debug --no-build --no-restore + run: dotnet test -c Release --no-build --no-restore diff --git a/.github/workflows/deep-source.yml b/.github/workflows/deep-source.yml index d554de0..9cc7939 100644 --- a/.github/workflows/deep-source.yml +++ b/.github/workflows/deep-source.yml @@ -22,7 +22,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v4 with: - dotnet-version: '8.0.x' + dotnet-version: "8.0.x" - name: Build and analyze if: >- @@ -38,6 +38,6 @@ jobs: env: DEEPSOURCE_DSN: ${{ secrets.DEEPSOURCE_DSN }} run: | - dotnet build -c Debug --verbosity minimal - dotnet test -c Debug --verbosity minimal --no-build --no-restore /p:CollectCoverage=true /p:CoverletOutputFormat="cobertura" /p:CoverletOutput='../Results/' + dotnet build -c Release --verbosity minimal + dotnet test -c Release --verbosity minimal --no-build --no-restore /p:CollectCoverage=true /p:CoverletOutputFormat="cobertura" /p:CoverletOutput='../Results/' ./bin/deepsource report --analyzer test-coverage --key csharp --value-file Tests/Results/coverage.cobertura.xml diff --git a/POCTemplate.sln b/POCTensorFlow.sln similarity index 83% rename from POCTemplate.sln rename to POCTensorFlow.sln index 5eebf2d..302aba5 100644 --- a/POCTemplate.sln +++ b/POCTensorFlow.sln @@ -5,11 +5,11 @@ VisualStudioVersion = 17.0.31903.59 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Src", "Src", "{CCFE3371-AE28-446A-B8D1-8D1027A2D23B}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "POCTemplate", "Src\POCTemplate\POCTemplate.csproj", "{5E214FC8-0D9B-4DD7-B952-DA994D094EC4}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "POCTensorFlow", "Src\POCTensorFlow\POCTensorFlow.csproj", "{5E214FC8-0D9B-4DD7-B952-DA994D094EC4}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{279F38EF-A29A-48E2-9201-BA9D5BACAF5B}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "POCTemplate.Tests", "Tests\POCTemplate.Tests\POCTemplate.Tests.csproj", "{43CA48B4-6FC2-425E-82AF-19B643029326}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "POCTensorFlow.Tests", "Tests\POCTensorFlow.Tests\POCTensorFlow.Tests.csproj", "{43CA48B4-6FC2-425E-82AF-19B643029326}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/README.md b/README.md index f168a7c..90eeb4b 100644 --- a/README.md +++ b/README.md @@ -1,31 +1,35 @@ -# PoC .NET template +# Project Title -A template repository for .NET PoC (Proof of Concept) +One Paragraph of the project description goes here. ---- +## Getting Started -- Create a new repository using this one as a template (click the green button at the top right of this page). -- Edit [README.md](README.md) file to align with your PoC. -- Change the solution and projects to suit your investigation/test/concept. +These instructions will get you a copy of the project up and running on your local machine for development and testing. See deployment for notes on deploying the project on a live system. -## Installation Guide +## Useful links -Follow these steps to set up the project. This guide includes installation scripts for PowerShell, Shell/Bash, and Batch. +- A list of links +- Documentation +- Or just examples -### PowerShell +### Prerequisites -```ps -.\install.ps1 +What things do you need to install the software, and how to install them + +``` +Give examples ``` -### Shell/Bash +### Installing -```bash -./install.sh -``` +A step-by-step series of examples that tell you how to get a development env running -### Batch +Say what the step will be -```batch -.\install.bat ``` +Give the example +``` + +Repeat until finished + +End with an example of getting some data out of the system or using it for a little demo. diff --git a/README.template.md b/README.template.md deleted file mode 100644 index 90eeb4b..0000000 --- a/README.template.md +++ /dev/null @@ -1,35 +0,0 @@ -# Project Title - -One Paragraph of the project description goes here. - -## Getting Started - -These instructions will get you a copy of the project up and running on your local machine for development and testing. See deployment for notes on deploying the project on a live system. - -## Useful links - -- A list of links -- Documentation -- Or just examples - -### Prerequisites - -What things do you need to install the software, and how to install them - -``` -Give examples -``` - -### Installing - -A step-by-step series of examples that tell you how to get a development env running - -Say what the step will be - -``` -Give the example -``` - -Repeat until finished - -End with an example of getting some data out of the system or using it for a little demo. diff --git a/Src/POCTemplate/POCTemplate.csproj b/Src/POCTensorFlow/POCTensorFlow.csproj similarity index 100% rename from Src/POCTemplate/POCTemplate.csproj rename to Src/POCTensorFlow/POCTensorFlow.csproj diff --git a/Src/POCTemplate/Program.cs b/Src/POCTensorFlow/Program.cs similarity index 87% rename from Src/POCTemplate/Program.cs rename to Src/POCTensorFlow/Program.cs index a01014d..1cd2bda 100644 --- a/Src/POCTemplate/Program.cs +++ b/Src/POCTensorFlow/Program.cs @@ -1,4 +1,4 @@ -namespace POCTemplate; +namespace POCTensorFlow; internal static class Program { diff --git a/Tests/POCTemplate.Tests/POCTemplate.Tests.csproj b/Tests/POCTensorFlow.Tests/POCTensorFlow.Tests.csproj similarity index 92% rename from Tests/POCTemplate.Tests/POCTemplate.Tests.csproj rename to Tests/POCTensorFlow.Tests/POCTensorFlow.Tests.csproj index 441dede..dc13801 100644 --- a/Tests/POCTemplate.Tests/POCTemplate.Tests.csproj +++ b/Tests/POCTensorFlow.Tests/POCTensorFlow.Tests.csproj @@ -28,7 +28,7 @@ - + diff --git a/Tests/POCTemplate.Tests/UnitTest1.cs b/Tests/POCTensorFlow.Tests/UnitTest1.cs similarity index 87% rename from Tests/POCTemplate.Tests/UnitTest1.cs rename to Tests/POCTensorFlow.Tests/UnitTest1.cs index 9e1df13..9155284 100644 --- a/Tests/POCTemplate.Tests/UnitTest1.cs +++ b/Tests/POCTensorFlow.Tests/UnitTest1.cs @@ -1,6 +1,6 @@ using FluentAssertions; -namespace POCTemplate.Tests; +namespace POCTensorFlow.Tests; public class UnitTest1 { diff --git a/install.bat b/install.bat deleted file mode 100644 index 197e18d..0000000 --- a/install.bat +++ /dev/null @@ -1 +0,0 @@ -powershell -ExecutionPolicy Bypass -File install.ps1 \ No newline at end of file diff --git a/install.ps1 b/install.ps1 deleted file mode 100644 index e22a24d..0000000 --- a/install.ps1 +++ /dev/null @@ -1,36 +0,0 @@ -$POCName = Read-Host -Prompt 'POC name (file name)' -$POCNameReadable = Read-Host -Prompt 'POC name (readable version)' -$MainProjectFile = "Src/POCTemplate/POCTemplate.csproj" -$UnitTestProjectFile = "Tests/POCTemplate.Tests/POCTemplate.Tests.csproj" -$MainDir = "Src/POCTemplate" -$UnitTestDir = "Tests/POCTemplate.Tests" - -rm README.md -mv "README.template.md" "README.md" - -(Get-Content README.md) | ForEach-Object {$_ -replace "POCTemplate", $POCNameReadable} | Set-Content README.md -(Get-Content .wakatime-project) | ForEach-Object {$_ -replace "POC .NET Template", "$POCNameReadable"} | Set-Content .wakatime-project -(Get-Content _config.yml) | ForEach-Object {$_ -replace "POCTemplate", $POCNameReadable} | Set-Content _config.yml - -(Get-ChildItem -Recurse -Include *.cs*) | ForEach-Object { - $Content = Get-Content $_ - $Content = $Content -replace "POCTemplate", $POCName - Set-Content -Path $_.fullname -Value $Content -} - -(Get-ChildItem -Recurse -Include *.csproj*) | ForEach-Object { - $Content = Get-Content $_ - $Content = $Content -replace "POCTemplate", $POCName - Set-Content -Path $_.fullname -Value $Content -} - -(Get-Content POCTemplate.sln) | ForEach-Object {$_ -replace "POCTemplate", $POCName} | Set-Content POCTemplate.sln -Rename-Item -Path ".\POCTemplate.sln" ".\$POCName.sln" -Rename-Item -Path $MainProjectFile -NewName "$POCName.csproj" -Rename-Item -Path $UnitTestProjectFile -NewName "$POCName.Tests.csproj" -Rename-Item -Path $MainDir $POCName -Rename-Item -Path $UnitTestDir "$POCName.Tests" - -Remove-Item install.bat -Remove-Item install.ps1 -Remove-Item install.sh diff --git a/install.sh b/install.sh deleted file mode 100644 index 39c95ef..0000000 --- a/install.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash -read -p 'POC name (file name): ' POCName -read -p 'POC name (readable version): ' POCNameReadable - -MainProjectFile="Src/POCTemplate/POCTemplate.csproj" -UnitTestProjectFile="Tests/POCTemplate.Tests/POCTemplate.Tests.csproj" -MainDir="Src/POCTemplate" -UnitTestDir="Tests/POCTemplate.Tests" - -rm README.md -mv "README.template.md" "README.md" - -sed -i "s/POCTemplate/$POCNameReadable/g" README.md -sed -i "s/POC .NET Template/$POCNameReadable/g" .wakatime-project -sed -i "s/POCTemplate/$POCNameReadable/g" _config.yml - -for file in $(find . -type f -name '*.cs*'); do - sed -i "s/POCTemplate/$POCName/g" "$file" -done - -for file in $(find . -type f -name '*.csproj*'); do - sed -i "s/POCTemplate/$POCName/g" "$file" -done - -sed -i "s/POCTemplate/$POCName/" "POCTemplate.sln" -mv "POCTemplate.sln" "$POCName.sln" -mv "$MainProjectFile" "$POCName.csproj" -mv "$UnitTestProjectFile" "$POCName.Tests.csproj" -mv "$MainDir" "$POCName" -mv "$UnitTestDir" "$POCName.Tests" - -rm install.bat -rm install.ps1 -rm install.sh