-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup-dev.ps1
More file actions
67 lines (57 loc) · 2.67 KB
/
setup-dev.ps1
File metadata and controls
67 lines (57 loc) · 2.67 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
#!/usr/bin/env pwsh
# Windows development environment setup for JAStudio
# Run this once after cloning the repository to set up the development environment.
param(
[switch]$SkipVenv,
[switch]$SkipSubmodules
)
$ErrorActionPreference = "Stop"
$ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
Push-Location $ScriptDir
try {
Write-Host "`n=== JAStudio Windows Development Setup ===" -ForegroundColor Cyan
# 1. Enable long paths for Git (required for Compze submodule)
if(-not $SkipSubmodules) {
Write-Host "`nEnabling Git long paths support..." -ForegroundColor Yellow
git config --global core.longpaths true
Write-Host "✓ Git long paths enabled" -ForegroundColor Green
}
# 2. Initialize git submodules
if(-not $SkipSubmodules) {
Write-Host "`nInitializing git submodules..." -ForegroundColor Yellow
git submodule update --init --recursive
if($LASTEXITCODE -ne 0) { throw "Git submodule initialization failed" }
Write-Host "✓ Submodules initialized" -ForegroundColor Green
}
# 3. Create Python virtual environment
if(-not $SkipVenv) {
if(Test-Path "venv") {
Write-Host "`nvenv directory already exists, skipping creation" -ForegroundColor Yellow
} else {
Write-Host "`nCreating Python virtual environment..." -ForegroundColor Yellow
python -m venv venv
if($LASTEXITCODE -ne 0) { throw "Python venv creation failed" }
Write-Host "✓ Virtual environment created" -ForegroundColor Green
}
# 4. Install Python dependencies
Write-Host "`nInstalling Python dependencies..." -ForegroundColor Yellow
& venv\Scripts\pip.exe install -r requirements.txt --quiet
if($LASTEXITCODE -ne 0) { throw "Python dependency installation failed" }
Write-Host "✓ Python dependencies installed" -ForegroundColor Green
}
# 5. Build .NET solution
Write-Host "`nBuilding .NET solution..." -ForegroundColor Yellow
dotnet build src\src_dotnet\JAStudio.slnx -c Debug
if($LASTEXITCODE -ne 0) { throw ".NET build failed" }
Write-Host "✓ .NET build successful" -ForegroundColor Green
Write-Host "`n=== Setup Complete ===" -ForegroundColor Green
Write-Host "`nYou can now:" -ForegroundColor Cyan
Write-Host " • Run tests: dotnet test src\src_dotnet\JAStudio.slnx" -ForegroundColor White
Write-Host " • Run Python tests: venv\Scripts\python.exe -m pytest" -ForegroundColor White
Write-Host " • Full validation: .\full-build.ps1" -ForegroundColor White
} catch {
Write-Host "`n❌ Setup failed: $_" -ForegroundColor Red
exit 1
} finally {
Pop-Location
}