fix: download source zip instead of git clone (no SSH needed)
Some checks are pending
Build Windows DLL / Build for Windows (push) Waiting to run
Some checks are pending
Build Windows DLL / Build for Windows (push) Waiting to run
This commit is contained in:
parent
77234228a2
commit
cd449bb46d
1 changed files with 38 additions and 28 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
#Requires -Version 5.1
|
#Requires -Version 5.1
|
||||||
<#
|
<#
|
||||||
.SYNOPSIS
|
.SYNOPSIS
|
||||||
Build Vulcast Vertical OBS plugin - v6 (writes cmake cache directly)
|
Build Vulcast Vertical OBS plugin - v7 (downloads zip, no git needed)
|
||||||
#>
|
#>
|
||||||
param()
|
param()
|
||||||
$ErrorActionPreference = 'Stop'
|
$ErrorActionPreference = 'Stop'
|
||||||
|
|
@ -9,7 +9,7 @@ $CacheDir = Join-Path $env:LOCALAPPDATA "vulcast-build"
|
||||||
$PluginDir = Join-Path $CacheDir "vulcast-vertical"
|
$PluginDir = Join-Path $CacheDir "vulcast-vertical"
|
||||||
$buildDir = Join-Path $PluginDir "build_x64"
|
$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
|
# 1. Find VS Build Tools
|
||||||
$vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
|
$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" }
|
if (!$installPath) { throw "VS Build Tools not found" }
|
||||||
$vcvarsall = Join-Path $installPath "VC\Auxiliary\Build\vcvarsall.bat"
|
$vcvarsall = Join-Path $installPath "VC\Auxiliary\Build\vcvarsall.bat"
|
||||||
|
|
||||||
# 2. Clone or update plugin source
|
# 2. Download and extract plugin source (no git needed)
|
||||||
if (!(Test-Path (Join-Path $PluginDir ".git"))) {
|
$zipPath = Join-Path $CacheDir "vulcast-vertical-latest.zip"
|
||||||
Write-Host "[1/4] Cloning source..." -ForegroundColor Cyan
|
if (!(Test-Path (Join-Path $PluginDir "CMakeLists.txt"))) {
|
||||||
git clone --depth 1 "ssh://git@git.216-75-142-55.sslip.io:2222/wawadmin/vulcast-vertical.git" $PluginDir
|
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 {
|
} else {
|
||||||
Write-Host "[1/4] Pulling updates..." -ForegroundColor Cyan
|
Write-Host "[1/4] Source already cached." -ForegroundColor Green
|
||||||
git -C $PluginDir pull
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# 3. Write CMakeUserPresets.json to avoid long command lines
|
# 3. Write CMakeUserPresets.json
|
||||||
Write-Host "[2/4] Writing cmake presets..." -ForegroundColor Cyan
|
Write-Host "[2/4] Writing cmake presets..." -ForegroundColor Cyan
|
||||||
$preset = @{
|
$presetJson = @'
|
||||||
version = 6
|
{
|
||||||
configurePresets = @(
|
"version": 6,
|
||||||
@{
|
"configurePresets": [
|
||||||
name = "vulcast-local"
|
{
|
||||||
displayName = "Vulcast Local Build"
|
"name": "vulcast-local",
|
||||||
generator = "Visual Studio 17 2022"
|
"displayName": "Vulcast Local Build",
|
||||||
architecture = "x64"
|
"generator": "Visual Studio 17 2022",
|
||||||
binaryDir = "${sourceDir}/build_x64"
|
"architecture": "x64",
|
||||||
cacheVariables = @{
|
"binaryDir": "${sourceDir}/build_x64",
|
||||||
CMAKE_BUILD_TYPE = "Release"
|
"cacheVariables": {
|
||||||
CMAKE_SYSTEM_VERSION = "10.0.18363.657"
|
"CMAKE_BUILD_TYPE": "Release",
|
||||||
QT_VERSION = "6"
|
"CMAKE_SYSTEM_VERSION": "10.0.18363.657",
|
||||||
}
|
"QT_VERSION": "6"
|
||||||
}
|
}
|
||||||
)
|
}
|
||||||
} | ConvertTo-Json -Depth 10
|
]
|
||||||
|
}
|
||||||
|
'@
|
||||||
$presetPath = Join-Path $PluginDir "CMakeUserPresets.json"
|
$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
|
# 4. Configure cmake
|
||||||
Write-Host "[3/4] Configuring cmake..." -ForegroundColor Cyan
|
Write-Host "[3/4] Configuring cmake..." -ForegroundColor Cyan
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue