-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart-monster.ps1
More file actions
executable file
·129 lines (114 loc) · 3.83 KB
/
start-monster.ps1
File metadata and controls
executable file
·129 lines (114 loc) · 3.83 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
120
121
122
123
124
125
126
127
128
129
# C++ Heavy Development Environment Launcher (PowerShell)
# Launches the devcontainer for C++ development on Windows
param(
[switch]$Help,
[switch]$Rebuild
)
# Color functions
function Write-Info {
param([string]$Message)
Write-Host "[INFO] $Message" -ForegroundColor Blue
}
function Write-Success {
param([string]$Message)
Write-Host "[SUCCESS] $Message" -ForegroundColor Green
}
function Write-Warning {
param([string]$Message)
Write-Host "[WARNING] $Message" -ForegroundColor Yellow
}
function Write-Error {
param([string]$Message)
Write-Host "[ERROR] $Message" -ForegroundColor Red
}
# Help text
if ($Help) {
Write-Host "C++ Heavy Development Environment Launcher" -ForegroundColor Cyan
Write-Host ""
Write-Host "Usage:"
Write-Host " .\start-monster.ps1 # Launch the development environment"
Write-Host " .\start-monster.ps1 -Rebuild # Rebuild the container before launching"
Write-Host " .\start-monster.ps1 -Help # Show this help message"
Write-Host ""
Write-Host "Requirements:"
Write-Host " • Docker Desktop for Windows"
Write-Host " • VS Code with Dev Containers extension"
Write-Host " • WSL 2 (recommended)"
exit 0
}
Write-Host "🚀 C++ Heavy Development Environment Launcher" -ForegroundColor Cyan
Write-Host "=============================================" -ForegroundColor Cyan
# Check if Docker is running
Write-Info "Checking Docker status..."
try {
docker info | Out-Null
Write-Success "Docker is running"
}
catch {
Write-Error "Docker is not running or not accessible"
Write-Info "Please start Docker Desktop and try again"
exit 1
}
# Check if VS Code is installed
Write-Info "Checking VS Code installation..."
try {
$codeVersion = code --version 2>$null
if ($LASTEXITCODE -eq 0) {
Write-Success "VS Code is installed"
} else {
throw "VS Code not found"
}
}
catch {
Write-Error "VS Code is not installed or not in PATH"
Write-Info "Please install VS Code and the Dev Containers extension"
Write-Info "Download from: https://code.visualstudio.com/"
exit 1
}
# Get script directory
$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
Set-Location $scriptDir
Write-Info "Script directory: $scriptDir"
# Rebuild container if requested
if ($Rebuild) {
Write-Info "Rebuilding container..."
try {
docker-compose -f .devcontainer/docker-compose.yml build --no-cache
Write-Success "Container rebuilt successfully"
}
catch {
Write-Error "Failed to rebuild container"
exit 1
}
}
# Launch VS Code with devcontainer
Write-Info "🚀 Launching C++ Heavy Development Environment..."
Write-Info "This will build and start the devcontainer if needed."
try {
code .
Write-Success "VS Code launched successfully!"
}
catch {
Write-Error "Failed to launch VS Code"
exit 1
}
Write-Host ""
Write-Host "📚 Quick Start Guide:" -ForegroundColor Cyan
Write-Host " 1. Wait for the container to build (first time only)"
Write-Host " 2. Open terminal in VS Code (Ctrl+``)"
Write-Host " 3. Navigate to sample project: cd /workspace/projects/sample-cpp"
Write-Host " 4. Build sample project: ./build.sh"
Write-Host ""
Write-Host "🔧 Environment Features:" -ForegroundColor Cyan
Write-Host " • Modern C++ compilers (GCC 12, Clang 15)"
Write-Host " • Build systems (CMake, Ninja)"
Write-Host " • Package managers (vcpkg, Conan)"
Write-Host " • Debugging tools (GDB, Valgrind)"
Write-Host " • Static analysis (Clang-Tidy, CppCheck)"
Write-Host " • Testing framework (Google Test)"
Write-Host " • Complete VS Code C++ extension suite"
Write-Host ""
Write-Host "📖 For troubleshooting:" -ForegroundColor Yellow
Write-Host " See .devcontainer/BUILD_FIXES.md"
Write-Host ""
Write-Success "Environment ready for heavy C++ development! 🛠️"