forked from mouseless/baked
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmake.cmd
More file actions
119 lines (103 loc) · 2.07 KB
/
make.cmd
File metadata and controls
119 lines (103 loc) · 2.07 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
@REM Generated By GPT
@echo off
setlocal enabledelayedexpansion
title Project Runner
if "%1"=="" (
echo Usage: %0 ^<command^>
echo.
echo Available commands: run, format, build, test, coverage, install
exit /b 1
)
set CMD=%1
if /i "%CMD%"=="format" goto format
if /i "%CMD%"=="install" goto install
if /i "%CMD%"=="build" goto build
if /i "%CMD%"=="test" goto test
if /i "%CMD%"=="coverage" goto coverage
if /i "%CMD%"=="run" goto run
echo Invalid command: %CMD%
exit /b 1
:format
echo Formatting code...
cd core
dotnet format --verbosity normal
cd ..
cd ui
npm run lint -- --fix
cd ..
cd docs\.theme
npm run lint -- --fix
cd ..\..
goto end
:install
echo Installing dependencies...
cd docs\.theme
call npm i
cd ..\..
cd ui
call npm i
cd ..
cd core\playground\Baked.Playground.Load
call npm i
cd ..\..\..
goto end
:build
echo Building projects...
cd core
dotnet build -v d /p:GenerateArgs="--warn-for-missing-component"
cd ..
cd ui
npm run build
cd ..
goto end
:test
echo Running tests...
cd core
dotnet test --logger quackers
cd ..
cd ui
set BUILD_SILENT=1
npm test
cd ..
goto end
:coverage
echo Generating coverage report...
cd core
if exist .coverage rmdir /s /q .coverage
dotnet test -c Release --collect:"XPlat Code Coverage" --logger trx --results-directory .coverage --settings test\runsettings.xml
dotnet reportgenerator -reports:.coverage\*\coverage.cobertura.xml -targetdir:.coverage\html
start .coverage\html\index.html
cd ..
goto end
:run
echo (1) API (Development)
echo (2) UI (Development)
echo (3) Docker (Production)
echo (4) Docs
set /p choice="Please select 1-4: "
if "%choice%"=="1" goto api
if "%choice%"=="2" goto ui
if "%choice%"=="3" goto docker
if "%choice%"=="4" goto docs
:api
echo Running API (Development)...
dotnet run --project core\playground\Baked.Playground.Application /p:GenerateArgs="--warn-for-missing-component"
goto end
:ui
echo Starting Playground (Development)...
cd ui
npm run dev
cd ..
goto end
:docker
echo Running Docker (Production)...
docker compose up --build
goto end
:docs
echo Running Docs...
cd docs
make run
cd ..
goto end
:end
echo Done.