-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdotnet-tools.cmd
More file actions
85 lines (70 loc) · 3.41 KB
/
dotnet-tools.cmd
File metadata and controls
85 lines (70 loc) · 3.41 KB
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
@echo off
setlocal enabledelayedexpansion
REM Unified wrapper to dispatch to PowerShell command scripts
REM Usage: dotnet-tools <build|bump|clean|tag|test|init-lib|init-min> [args]
set "SELF_DIR=%~dp0"
if "%~1"=="" goto :usage
set "SUB=%~1"
shift
if /I "%SUB%"=="build" goto :do_build
if /I "%SUB%"=="bump" goto :do_bump
if /I "%SUB%"=="clean" goto :do_clean
if /I "%SUB%"=="tag" goto :do_tag
if /I "%SUB%"=="test" goto :do_test
if /I "%SUB%"=="init-lib" goto :do_init_lib
if /I "%SUB%"=="init-min" goto :do_init_min
if /I "%SUB%"=="init-proj" goto :do_init_proj
if /I "%SUB%"=="cmd-test-all" goto :do_cmd_test_all
if /I "%SUB%"=="cmd-test-lib" goto :do_cmd_test_lib
if /I "%SUB%"=="cmd-test-min" goto :do_cmd_test_min
echo [ERROR] Unknown command: %SUB%
goto :usage
:do_build
powershell -NoProfile -ExecutionPolicy Bypass -File "%SELF_DIR%commands\build.ps1" %*
exit /b %ERRORLEVEL%
:do_bump
powershell -NoProfile -ExecutionPolicy Bypass -File "%SELF_DIR%commands\bump.ps1" %*
exit /b %ERRORLEVEL%
:do_clean
powershell -NoProfile -ExecutionPolicy Bypass -File "%SELF_DIR%commands\clean.ps1" %*
exit /b %ERRORLEVEL%
:do_tag
powershell -NoProfile -ExecutionPolicy Bypass -File "%SELF_DIR%commands\tag.ps1" %*
exit /b %ERRORLEVEL%
:do_test
powershell -NoProfile -ExecutionPolicy Bypass -File "%SELF_DIR%commands\test.ps1" %*
exit /b %ERRORLEVEL%
:do_init_lib
powershell -NoProfile -ExecutionPolicy Bypass -File "%SELF_DIR%commands\init-lib.ps1" %*
exit /b %ERRORLEVEL%
:do_init_min
powershell -NoProfile -ExecutionPolicy Bypass -File "%SELF_DIR%commands\init-min.ps1" %*
exit /b %ERRORLEVEL%
:do_init_proj
powershell -NoProfile -ExecutionPolicy Bypass -File "%SELF_DIR%commands\init-proj.ps1" %*
exit /b %ERRORLEVEL%
:do_cmd_test_all
powershell -NoProfile -ExecutionPolicy Bypass -File "%SELF_DIR%tests\run.ps1" -Suite cmd-test-all -VerboseOutput
exit /b %ERRORLEVEL%
:do_cmd_test_lib
powershell -NoProfile -ExecutionPolicy Bypass -File "%SELF_DIR%tests\run.ps1" -Suite cmd-test-lib -VerboseOutput
exit /b %ERRORLEVEL%
:do_cmd_test_min
powershell -NoProfile -ExecutionPolicy Bypass -File "%SELF_DIR%tests\run.ps1" -Suite cmd-test-min -VerboseOutput
exit /b %ERRORLEVEL%
:usage
echo Usage: dotnet-tools ^<command^> [args]
echo.
echo Commands:
echo build ^- Build a solution. Example: dotnet-tools build [path] [--no-restore] [--solution Name.sln] [--configuration Debug^|Release]
echo bump ^- Bump csproj ^<Version^>. Example: dotnet-tools bump --patch [path]
echo clean ^- Clean bin/ and obj/ under src. Example: dotnet-tools clean [path]
echo tag ^- Create git tag from csproj version. Example: dotnet-tools tag [path] [--push] [--remote origin]
echo test ^- Run tests and generate coverage. Example: dotnet-tools test [tests-path]
echo init-lib ^- Scaffold new library repo. Example: dotnet-tools init-lib MyLib --author "Jane Doe" --description "My library" --version 0.1.0
echo init-min ^- Scaffold minimal repo (no NuGet metadata; tests/.gitkeep). Example: dotnet-tools init-min --root MyLib --solution MyLib --project MyLib --author "Jane Doe" --description "My library"
echo init-proj ^- Scaffold single project (--min|--nuget). Example: dotnet-tools init-proj --name MyProj --nuget
echo cmd-test-all ^- Run both CMD suites
echo cmd-test-lib ^- Run CMD suite with init-lib
echo cmd-test-min ^- Run CMD suite without init-lib
exit /b 1