-
Notifications
You must be signed in to change notification settings - Fork 0
/
dotnetp.cmd
69 lines (58 loc) · 1.33 KB
/
dotnetp.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
@echo off
@rem Create dotnet project
set project_name=
:label_top
if "%~1"=="" (
set /P project_name="ProjectName ? : "
) else (
set project_name=%~1
)
if "%project_name%"=="" (
goto :label_top
) else (
echo ProjectName : %project_name%
)
set test_project_name=%project_name%.Tests
set solution_name=%project_name%Sln
mkdir %project_name%
pushd %project_name%
dotnet new sln --name %solution_name%
dotnet new console --name %project_name% --use-program-main --aot
dotnet new nunit --name %test_project_name%
dotnet sln %solution_name%.sln add %project_name%
dotnet sln %solution_name%.sln add %test_project_name%
pushd %project_name%.Tests
dotnet add reference ../%project_name%/%project_name%.csproj
popd
(
echo version: '3'
echo.
echo vars:
echo PROJECT_NAME: %project_name%
echo.
echo tasks:
echo run:
echo dir: ./{{.PROJECT_NAME}}
echo cmds:
echo - dotnet run
echo silent: true
echo.
echo build:
echo dir: ./{{.PROJECT_NAME}}
echo cmds:
echo - dotnet build
echo silent: true
echo.
echo publish:
echo dir: ./{{.PROJECT_NAME}}
echo cmds:
echo - dotnet publish -r win-x64 -c Release
echo silent: true
echo.
echo test:
echo cmds:
echo - dotnet test
echo silent: true
echo.
) > Taskfile.yml
popd