Skip to content

Commit ea8fb1e

Browse files
[csharp] Add script for create example project structure.
1 parent c20df65 commit ea8fb1e

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
param([Parameter(Mandatory=$true)][string]$ContextName, [Parameter(Mandatory=$true)][string]$ExampleName)
2+
3+
# Create folder and sln
4+
New-Item -ItemType Directory -Path $ExampleName | Set-Location
5+
dotnet new sln -n $ExampleName
6+
7+
# Create project
8+
dotnet new classlib -n $ContextName -o "./src/$($ContextName)" --framework net5.0
9+
dotnet sln "$($ExampleName).sln" add "./src/$($ContextName)/$($ContextName).csproj" -s "src"
10+
11+
# Create test project
12+
dotnet new xunit -n "$($ContextName).Tests" -o "./test/$($ContextName).Tests" --framework net5.0
13+
dotnet sln "$($ExampleName).sln" add "./test/$($ContextName).Tests/$($ContextName).Tests.csproj" -s "test"
14+
15+
# Return to original Path
16+
Set-Location ..

0 commit comments

Comments
 (0)