diff --git a/build-vulcast-vertical.ps1 b/build-vulcast-vertical.ps1 index 4ef62f6..702b531 100644 --- a/build-vulcast-vertical.ps1 +++ b/build-vulcast-vertical.ps1 @@ -1,7 +1,7 @@ #Requires -Version 5.1 <# .SYNOPSIS - Build Vulcast Vertical OBS plugin - v6 (writes cmake cache directly) + Build Vulcast Vertical OBS plugin - v7 (downloads zip, no git needed) #> param() $ErrorActionPreference = 'Stop' @@ -9,7 +9,7 @@ $CacheDir = Join-Path $env:LOCALAPPDATA "vulcast-build" $PluginDir = Join-Path $CacheDir "vulcast-vertical" $buildDir = Join-Path $PluginDir "build_x64" -Write-Host "=== Vulcast Vertical Build v6 ===" -ForegroundColor Cyan +Write-Host "=== Vulcast Vertical Build v7 ===" -ForegroundColor Cyan # 1. Find VS Build Tools $vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" @@ -18,37 +18,47 @@ $installPath = & $vswhere -latest -products * -requires Microsoft.VisualStudio.C if (!$installPath) { throw "VS Build Tools not found" } $vcvarsall = Join-Path $installPath "VC\Auxiliary\Build\vcvarsall.bat" -# 2. Clone or update plugin source -if (!(Test-Path (Join-Path $PluginDir ".git"))) { - Write-Host "[1/4] Cloning source..." -ForegroundColor Cyan - git clone --depth 1 "ssh://git@git.216-75-142-55.sslip.io:2222/wawadmin/vulcast-vertical.git" $PluginDir +# 2. Download and extract plugin source (no git needed) +$zipPath = Join-Path $CacheDir "vulcast-vertical-latest.zip" +if (!(Test-Path (Join-Path $PluginDir "CMakeLists.txt"))) { + Write-Host "[1/4] Downloading source..." -ForegroundColor Cyan + if (Test-Path $PluginDir) { Remove-Item $PluginDir -Recurse -Force } + New-Item -ItemType Directory -Path $CacheDir -Force | Out-Null + Invoke-WebRequest -Uri "https://vulcast.xyz/dl/vulcast-vertical-latest.zip" -OutFile $zipPath + Expand-Archive -Path $zipPath -DestinationPath $PluginDir -Force + # If zip has a root folder, flatten it + $inner = Get-ChildItem -Path $PluginDir -Directory | Select-Object -First 1 + if ($inner -and (Test-Path (Join-Path $inner.FullName "CMakeLists.txt"))) { + Get-ChildItem -Path $inner.FullName -Force | Move-Item -Destination $PluginDir -Force + Remove-Item $inner.FullName -Recurse -Force -ErrorAction SilentlyContinue + } } else { - Write-Host "[1/4] Pulling updates..." -ForegroundColor Cyan - git -C $PluginDir pull + Write-Host "[1/4] Source already cached." -ForegroundColor Green } -# 3. Write CMakeUserPresets.json to avoid long command lines +# 3. Write CMakeUserPresets.json Write-Host "[2/4] Writing cmake presets..." -ForegroundColor Cyan -$preset = @{ - version = 6 - configurePresets = @( - @{ - name = "vulcast-local" - displayName = "Vulcast Local Build" - generator = "Visual Studio 17 2022" - architecture = "x64" - binaryDir = "${sourceDir}/build_x64" - cacheVariables = @{ - CMAKE_BUILD_TYPE = "Release" - CMAKE_SYSTEM_VERSION = "10.0.18363.657" - QT_VERSION = "6" - } - } - ) -} | ConvertTo-Json -Depth 10 - +$presetJson = @' +{ + "version": 6, + "configurePresets": [ + { + "name": "vulcast-local", + "displayName": "Vulcast Local Build", + "generator": "Visual Studio 17 2022", + "architecture": "x64", + "binaryDir": "${sourceDir}/build_x64", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release", + "CMAKE_SYSTEM_VERSION": "10.0.18363.657", + "QT_VERSION": "6" + } + } + ] +} +'@ $presetPath = Join-Path $PluginDir "CMakeUserPresets.json" -Set-Content -Path $presetPath -Value $preset -Encoding UTF8 +Set-Content -Path $presetPath -Value $presetJson -Encoding UTF8 # 4. Configure cmake Write-Host "[3/4] Configuring cmake..." -ForegroundColor Cyan